package msg

import "encoding/json"

// Entry 登录
type ChapterSyncEntry struct {
	PlayerId   int64  `json:"userId"`
	Token      string `json:"token"`
	LineId     int    `json:"serverId"`
	SyncRoomId int64  `json:"matchRoomId,string"`
	ReLogin    int32  `json:"reLogin"` // 重连1
}

type ResponseChapterSyncEntry struct {
	ErrCode int    `json:"errCode"`
	Msg     string `json:"msg,omitempty"`
	Data    int    `json:"data"`
}

// Entry 重连
type ChapterSyncReLogin struct {
	PlayerId int64 `json:"userId"`
}

// Entry 重连
type ChapterSynToken struct {
	PlayerId int64 `json:"userId"`
}

type JoinerAttr struct {
	PlayerId int64 `json:"userId"`
}

// 创建帧同步房间
type CreateFrameSyncGroupIs struct {
	RpcRequestMsg
	SyncGroupId int64         `json:"SyncGroupId,string"`
	Token       string        `json:"token"`
	Joiners     []*JoinerAttr `json:"joiners"`
}

type ResponseCreateChapterSyncRoomIs struct {
	RpcResponseMsg
}

type FrameSyncToServer struct {
	PlayerId    int64           `json:"userId"`
	SyncGroupId int64           `json:"syncGroupId,string"`
	FrameId     int64           `json:"frameId"`
	RawData     json.RawMessage `json:"raw,omitempty"`
}
