From 360f2fc22bdfd301531b7bb966859adc0682b03b Mon Sep 17 00:00:00 2001 From: genxium Date: Mon, 21 Nov 2022 17:27:32 +0800 Subject: [PATCH] Simplified backend config loading. --- battle_srv/api/v1/player.go | 33 +- battle_srv/env_tools/load_pre_conf.go | 16 +- battle_srv/env_tools/test_env_db.go | 5 +- battle_srv/models/pb_type_convert.go | 18 +- battle_srv/models/player.go | 74 +- battle_srv/models/player_dao_helper.go | 11 + battle_srv/models/room.go | 48 +- battle_srv/protos/room_downsync_frame.pb.go | 438 ++--- dnmshared/sharedprotos/geometry.pb.go | 2 +- .../pbfiles/room_downsync_frame.proto | 19 +- frontend/assets/scenes/login.fire | 2 +- frontend/assets/scripts/Map.js | 51 +- frontend/assets/scripts/TouchEventsManager.js | 6 +- ...om_downsync_frame_proto_bundle.forcemsg.js | 1433 +++++++++-------- 14 files changed, 1070 insertions(+), 1086 deletions(-) diff --git a/battle_srv/api/v1/player.go b/battle_srv/api/v1/player.go index 180f62a..997727c 100644 --- a/battle_srv/api/v1/player.go +++ b/battle_srv/api/v1/player.go @@ -5,6 +5,7 @@ import ( . "battle_srv/common" "battle_srv/common/utils" "battle_srv/models" + . "battle_srv/protos" "battle_srv/storage" "bytes" "crypto/sha256" @@ -526,8 +527,10 @@ func (p *playerController) maybeCreatePlayerWechatAuthBinding(userInfo utils.Use } if player != nil { updateInfo := models.Player{ - Avatar: userInfo.HeadImgURL, - DisplayName: userInfo.Nickname, + PlayerDownsync: PlayerDownsync{ + Avatar: userInfo.HeadImgURL, + DisplayName: userInfo.Nickname, + }, } tx := storage.MySQLManagerIns.MustBegin() defer tx.Rollback() @@ -542,10 +545,12 @@ func (p *playerController) maybeCreatePlayerWechatAuthBinding(userInfo utils.Use } now := utils.UnixtimeMilli() player := models.Player{ - CreatedAt: now, - UpdatedAt: now, - DisplayName: userInfo.Nickname, - Avatar: userInfo.HeadImgURL, + PlayerDownsync: PlayerDownsync{ + DisplayName: userInfo.Nickname, + Avatar: userInfo.HeadImgURL, + }, + CreatedAt: now, + UpdatedAt: now, } return p.createNewPlayer(player, userInfo.OpenID, int(Constants.AuthChannel.Wechat)) } @@ -562,8 +567,10 @@ func (p *playerController) maybeCreatePlayerWechatGameAuthBinding(userInfo utils } if player != nil { updateInfo := models.Player{ - Avatar: userInfo.HeadImgURL, - DisplayName: userInfo.Nickname, + PlayerDownsync: PlayerDownsync{ + Avatar: userInfo.HeadImgURL, + DisplayName: userInfo.Nickname, + }, } tx := storage.MySQLManagerIns.MustBegin() defer tx.Rollback() @@ -578,10 +585,12 @@ func (p *playerController) maybeCreatePlayerWechatGameAuthBinding(userInfo utils } now := utils.UnixtimeMilli() player := models.Player{ - CreatedAt: now, - UpdatedAt: now, - DisplayName: userInfo.Nickname, - Avatar: userInfo.HeadImgURL, + PlayerDownsync: PlayerDownsync{ + DisplayName: userInfo.Nickname, + Avatar: userInfo.HeadImgURL, + }, + CreatedAt: now, + UpdatedAt: now, } return p.createNewPlayer(player, userInfo.OpenID, int(Constants.AuthChannel.WechatGame)) } diff --git a/battle_srv/env_tools/load_pre_conf.go b/battle_srv/env_tools/load_pre_conf.go index fec7eb7..09be2b0 100644 --- a/battle_srv/env_tools/load_pre_conf.go +++ b/battle_srv/env_tools/load_pre_conf.go @@ -4,6 +4,7 @@ import ( . "battle_srv/common" "battle_srv/common/utils" "battle_srv/models" + . "battle_srv/protos" "battle_srv/storage" . "dnmshared" sq "github.com/Masterminds/squirrel" @@ -71,7 +72,6 @@ func createMysqlData(rows *sqlx.Rows, v string) { } } -// 加上tableName参数, 用于pre_conf_data.sqlite里bot_player表的复用 --kobako func maybeCreateNewPlayerFromBotTable(db *sqlx.DB, tableName string) { var ls []*dbBotPlayer err := db.Select(&ls, "SELECT name, magic_phone_country_code, magic_phone_num, display_name FROM "+tableName) @@ -88,7 +88,6 @@ func maybeCreateNewPlayerFromBotTable(db *sqlx.DB, tableName string) { panic(err) } query = storage.MySQLManagerIns.Rebind(query) - // existNames := make([]string, len(ls), len(ls)) var existPlayers []*models.Player err = storage.MySQLManagerIns.Select(&existPlayers, query, args...) if nil != err { @@ -99,13 +98,11 @@ func maybeCreateNewPlayerFromBotTable(db *sqlx.DB, tableName string) { var flag bool for _, v := range existPlayers { if botPlayer.Name == v.Name { - // 已有数据,合并处理 flag = true break } } if !flag { - // 找不到,新增 Logger.Debug("create", zap.Any(tableName, botPlayer)) err := createNewBotPlayer(botPlayer) if err != nil { @@ -120,11 +117,14 @@ func createNewBotPlayer(p *dbBotPlayer) error { defer tx.Rollback() now := utils.UnixtimeMilli() player := models.Player{ - CreatedAt: now, - UpdatedAt: now, - Name: p.Name, - DisplayName: p.DisplayName, + CreatedAt: now, + UpdatedAt: now, + PlayerDownsync: PlayerDownsync{ + Name: p.Name, + DisplayName: p.DisplayName, + }, } + err := player.Insert(tx) if err != nil { return err diff --git a/battle_srv/env_tools/test_env_db.go b/battle_srv/env_tools/test_env_db.go index 152f244..aa3c74b 100644 --- a/battle_srv/env_tools/test_env_db.go +++ b/battle_srv/env_tools/test_env_db.go @@ -4,6 +4,7 @@ import ( . "battle_srv/common" "battle_srv/common/utils" "battle_srv/models" + . "battle_srv/protos" "battle_srv/storage" . "dnmshared" @@ -75,9 +76,11 @@ func createNewPlayer(p *dbTestPlayer) error { defer tx.Rollback() now := utils.UnixtimeMilli() player := models.Player{ + PlayerDownsync: PlayerDownsync{ + Name: p.Name, + }, CreatedAt: now, UpdatedAt: now, - Name: p.Name, } err := player.Insert(tx) if err != nil { diff --git a/battle_srv/models/pb_type_convert.go b/battle_srv/models/pb_type_convert.go index 7686d81..52684aa 100644 --- a/battle_srv/models/pb_type_convert.go +++ b/battle_srv/models/pb_type_convert.go @@ -5,7 +5,7 @@ import ( . "dnmshared/sharedprotos" ) -func toPbPlayers(modelInstances map[int32]*Player) map[int32]*PlayerDownsync { +func toPbPlayers(modelInstances map[int32]*Player, withMetaInfo bool) map[int32]*PlayerDownsync { toRet := make(map[int32]*PlayerDownsync, 0) if nil == modelInstances { return toRet @@ -20,11 +20,17 @@ func toPbPlayers(modelInstances map[int32]*Player) map[int32]*PlayerDownsync { Dx: last.Dir.Dx, Dy: last.Dir.Dy, }, - Speed: last.Speed, - BattleState: last.BattleState, - Score: last.Score, - Removed: last.Removed, - JoinIndex: last.JoinIndex, + ColliderRadius: last.ColliderRadius, + Speed: last.Speed, + BattleState: last.BattleState, + Score: last.Score, + Removed: last.Removed, + JoinIndex: last.JoinIndex, + } + if withMetaInfo { + toRet[k].Name = last.Name + toRet[k].DisplayName = last.DisplayName + toRet[k].Avatar = last.Avatar } } diff --git a/battle_srv/models/player.go b/battle_srv/models/player.go index 92110d7..e545faa 100644 --- a/battle_srv/models/player.go +++ b/battle_srv/models/player.go @@ -1,11 +1,14 @@ package models import ( - "database/sql" + . "battle_srv/protos" + "battle_srv/storage" + . "dnmshared" . "dnmshared/sharedprotos" "fmt" sq "github.com/Masterminds/squirrel" "github.com/jmoiron/sqlx" + "go.uber.org/zap" ) type PlayerBattleState struct { @@ -33,12 +36,7 @@ func InitPlayerBattleStateIns() { } type Player struct { - // Meta info fields - Id int32 `json:"id,omitempty" db:"id"` - Name string `json:"name,omitempty" db:"name"` - DisplayName string `json:"displayName,omitempty" db:"display_name"` - Avatar string `json:"avatar,omitempty"` - ColliderRadius float64 `json:"-"` + PlayerDownsync // DB only fields CreatedAt int64 `db:"created_at"` @@ -46,19 +44,10 @@ type Player struct { DeletedAt NullInt64 `db:"deleted_at"` TutorialStage int `db:"tutorial_stage"` - // in-battle info fields - VirtualGridX int32 - VirtualGridY int32 - Dir *Direction - Speed int32 - BattleState int32 - LastMoveGmtMillis int32 - Score int32 - Removed bool - JoinIndex int32 + // other in-battle info fields + LastSentInputFrameId int32 AckingFrameId int32 AckingInputFrameId int32 - LastSentInputFrameId int32 } func ExistPlayerByName(name string) (bool, error) { @@ -74,15 +63,48 @@ func GetPlayerById(id int) (*Player, error) { } func getPlayer(cond sq.Eq) (*Player, error) { - var p Player - err := getObj("player", cond, &p) - if err == sql.ErrNoRows { - return nil, nil + p := Player{} + pd := PlayerDownsync{ + Dir: &Direction{ + Dx: 0, + Dy: 0, + }, } - p.Dir = &Direction{ - Dx: 0, - Dy: 0, + query, args, err := sq.Select("*").From("player").Where(cond).Limit(1).ToSql() + if err != nil { + return nil, err } + rows, err := storage.MySQLManagerIns.Queryx(query, args...) + if err != nil { + return nil, err + } + cols, err := rows.Columns() + if nil != err { + panic(err) + } + for rows.Next() { + // TODO: Do it more elegantly, but by now I don't have time to learn reflection of Golang + vals := rowValues(rows, cols) + for i, col := range cols { + val := *vals[i].(*interface{}) + if "id" == col { + pd.Id = int32(val.(int64)) + } + if "name" == col { + switch v := val.(type) { + case []byte: + pd.Name = string(v) + default: + pd.Name = fmt.Sprintf("%v", v) + } + } + if "created_at" == col { + p.CreatedAt = int64(val.(int64)) + } + } + Logger.Info("Queried player from db", zap.Any("cond", cond), zap.Any("p", p), zap.Any("pd", pd), zap.Any("cols", cols), zap.Any("rowValues", vals)) + } + p.PlayerDownsync = pd return &p, nil } @@ -113,8 +135,6 @@ func Update(tx *sqlx.Tx, id int32, p *Player) (bool, error) { } result, err := tx.Exec(query, args...) if err != nil { - fmt.Println("ERRRRRRR: ") - fmt.Println(err) return false, err } rowsAffected, err := result.RowsAffected() diff --git a/battle_srv/models/player_dao_helper.go b/battle_srv/models/player_dao_helper.go index ca3bbe1..a674dd6 100644 --- a/battle_srv/models/player_dao_helper.go +++ b/battle_srv/models/player_dao_helper.go @@ -10,6 +10,17 @@ import ( "go.uber.org/zap" ) +func rowValues(rows *sqlx.Rows, cols []string) []interface{} { + results := make([]interface{}, len(cols)) + for i := range results { + results[i] = new(interface{}) + } + if err := rows.Scan(results[:]...); err != nil { + panic(err) + } + return results +} + func exist(t string, cond sq.Eq) (bool, error) { c, err := getCount(t, cond) if err != nil { diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index e2e18d7..030c5ea 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -375,7 +375,7 @@ func (pR *Room) StartBattle() { pR.CurDynamicsRenderFrameId = 0 kickoffFrame := &RoomDownsyncFrame{ Id: pR.RenderFrameId, - Players: toPbPlayers(pR.Players), + Players: toPbPlayers(pR.Players, false), CountdownNanos: pR.BattleDurationNanos, } pR.RenderFrameBuffer.Put(kickoffFrame) @@ -669,7 +669,7 @@ func (pR *Room) StopBattleForSettlement() { for playerId, _ := range pR.Players { assembledFrame := RoomDownsyncFrame{ Id: pR.RenderFrameId, - Players: toPbPlayers(pR.Players), + Players: toPbPlayers(pR.Players, false), CountdownNanos: -1, // TODO: Replace this magic constant! } pR.sendSafely(&assembledFrame, nil, DOWNSYNC_MSG_ACT_BATTLE_STOPPED, playerId) @@ -693,22 +693,9 @@ func (pR *Room) onBattlePrepare(cb BattleStartCbType) { pR.State = RoomBattleStateIns.PREPARE Logger.Info("Battle state transitted to RoomBattleStateIns.PREPARE for:", zap.Any("roomId", pR.Id)) - playerMetas := make(map[int32]*PlayerDownsyncMeta, 0) - for _, player := range pR.Players { - playerMetas[player.Id] = &PlayerDownsyncMeta{ - Id: player.Id, - Name: player.Name, - DisplayName: player.DisplayName, - Avatar: player.Avatar, - ColliderRadius: player.ColliderRadius, // hardcoded for now - JoinIndex: player.JoinIndex, - } - } - battleReadyToStartFrame := &RoomDownsyncFrame{ Id: DOWNSYNC_MSG_ACT_BATTLE_READY_TO_START, - Players: toPbPlayers(pR.Players), - PlayerMetas: playerMetas, + Players: toPbPlayers(pR.Players, true), CountdownNanos: pR.BattleDurationNanos, } @@ -954,18 +941,6 @@ func (pR *Room) OnPlayerBattleColliderAcked(playerId int32) bool { return false } - playerMetas := make(map[int32]*PlayerDownsyncMeta, 0) - for _, eachPlayer := range pR.Players { - playerMetas[eachPlayer.Id] = &PlayerDownsyncMeta{ - Id: eachPlayer.Id, - Name: eachPlayer.Name, - DisplayName: eachPlayer.DisplayName, - Avatar: eachPlayer.Avatar, - JoinIndex: eachPlayer.JoinIndex, - ColliderRadius: eachPlayer.ColliderRadius, - } - } - // Broadcast added or readded player info to all players in the same room for _, eachPlayer := range pR.Players { /* @@ -979,16 +954,14 @@ func (pR *Room) OnPlayerBattleColliderAcked(playerId int32) bool { switch targetPlayer.BattleState { case PlayerBattleStateIns.ADDED_PENDING_BATTLE_COLLIDER_ACK: playerAckedFrame := &RoomDownsyncFrame{ - Id: pR.RenderFrameId, - Players: toPbPlayers(pR.Players), - PlayerMetas: playerMetas, + Id: pR.RenderFrameId, + Players: toPbPlayers(pR.Players, true), } pR.sendSafely(playerAckedFrame, nil, DOWNSYNC_MSG_ACT_PLAYER_ADDED_AND_ACKED, eachPlayer.Id) case PlayerBattleStateIns.READDED_PENDING_BATTLE_COLLIDER_ACK: playerAckedFrame := &RoomDownsyncFrame{ - Id: pR.RenderFrameId, - Players: toPbPlayers(pR.Players), - PlayerMetas: playerMetas, + Id: pR.RenderFrameId, + Players: toPbPlayers(pR.Players, true), } pR.sendSafely(playerAckedFrame, nil, DOWNSYNC_MSG_ACT_PLAYER_READDED_AND_ACKED, eachPlayer.Id) default: @@ -1229,9 +1202,10 @@ func (pR *Room) applyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputF // Update in the collision system playerCollider.Update() - - nextRenderFramePlayers[playerId].Dir.Dx = decodedInput.Dx - nextRenderFramePlayers[playerId].Dir.Dy = decodedInput.Dy + if 0 != decodedInput.Dx || 0 != decodedInput.Dy { + nextRenderFramePlayers[playerId].Dir.Dx = decodedInput.Dx + nextRenderFramePlayers[playerId].Dir.Dy = decodedInput.Dy + } } // handle pushbacks upon collision after all movements treated as simultaneous diff --git a/battle_srv/protos/room_downsync_frame.pb.go b/battle_srv/protos/room_downsync_frame.pb.go index b45eddf..d435a6b 100644 --- a/battle_srv/protos/room_downsync_frame.pb.go +++ b/battle_srv/protos/room_downsync_frame.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.7.1 +// protoc v3.21.4 // source: room_downsync_frame.proto package protos @@ -255,10 +255,14 @@ type PlayerDownsync struct { Dir *sharedprotos.Direction `protobuf:"bytes,4,opt,name=dir,proto3" json:"dir,omitempty"` Speed int32 `protobuf:"varint,5,opt,name=speed,proto3" json:"speed,omitempty"` // in terms of virtual grid units BattleState int32 `protobuf:"varint,6,opt,name=battleState,proto3" json:"battleState,omitempty"` - LastMoveGmtMillis int32 `protobuf:"varint,7,opt,name=lastMoveGmtMillis,proto3" json:"lastMoveGmtMillis,omitempty"` + JoinIndex int32 `protobuf:"varint,7,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` + ColliderRadius float64 `protobuf:"fixed64,8,opt,name=colliderRadius,proto3" json:"colliderRadius,omitempty"` + Removed bool `protobuf:"varint,9,opt,name=removed,proto3" json:"removed,omitempty"` Score int32 `protobuf:"varint,10,opt,name=score,proto3" json:"score,omitempty"` - Removed bool `protobuf:"varint,11,opt,name=removed,proto3" json:"removed,omitempty"` - JoinIndex int32 `protobuf:"varint,12,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` + LastMoveGmtMillis int32 `protobuf:"varint,11,opt,name=lastMoveGmtMillis,proto3" json:"lastMoveGmtMillis,omitempty"` + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,13,opt,name=displayName,proto3" json:"displayName,omitempty"` + Avatar string `protobuf:"bytes,14,opt,name=avatar,proto3" json:"avatar,omitempty"` } func (x *PlayerDownsync) Reset() { @@ -335,16 +339,16 @@ func (x *PlayerDownsync) GetBattleState() int32 { return 0 } -func (x *PlayerDownsync) GetLastMoveGmtMillis() int32 { +func (x *PlayerDownsync) GetJoinIndex() int32 { if x != nil { - return x.LastMoveGmtMillis + return x.JoinIndex } return 0 } -func (x *PlayerDownsync) GetScore() int32 { +func (x *PlayerDownsync) GetColliderRadius() float64 { if x != nil { - return x.Score + return x.ColliderRadius } return 0 } @@ -356,100 +360,41 @@ func (x *PlayerDownsync) GetRemoved() bool { return false } -func (x *PlayerDownsync) GetJoinIndex() int32 { +func (x *PlayerDownsync) GetScore() int32 { if x != nil { - return x.JoinIndex + return x.Score } return 0 } -type PlayerDownsyncMeta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - DisplayName string `protobuf:"bytes,3,opt,name=displayName,proto3" json:"displayName,omitempty"` - Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` - JoinIndex int32 `protobuf:"varint,5,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` - ColliderRadius float64 `protobuf:"fixed64,6,opt,name=colliderRadius,proto3" json:"colliderRadius,omitempty"` -} - -func (x *PlayerDownsyncMeta) Reset() { - *x = PlayerDownsyncMeta{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlayerDownsyncMeta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlayerDownsyncMeta) ProtoMessage() {} - -func (x *PlayerDownsyncMeta) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlayerDownsyncMeta.ProtoReflect.Descriptor instead. -func (*PlayerDownsyncMeta) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{2} -} - -func (x *PlayerDownsyncMeta) GetId() int32 { +func (x *PlayerDownsync) GetLastMoveGmtMillis() int32 { if x != nil { - return x.Id + return x.LastMoveGmtMillis } return 0 } -func (x *PlayerDownsyncMeta) GetName() string { +func (x *PlayerDownsync) GetName() string { if x != nil { return x.Name } return "" } -func (x *PlayerDownsyncMeta) GetDisplayName() string { +func (x *PlayerDownsync) GetDisplayName() string { if x != nil { return x.DisplayName } return "" } -func (x *PlayerDownsyncMeta) GetAvatar() string { +func (x *PlayerDownsync) GetAvatar() string { if x != nil { return x.Avatar } return "" } -func (x *PlayerDownsyncMeta) GetJoinIndex() int32 { - if x != nil { - return x.JoinIndex - } - return 0 -} - -func (x *PlayerDownsyncMeta) GetColliderRadius() float64 { - if x != nil { - return x.ColliderRadius - } - return 0 -} - type InputFrameDecoded struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -463,7 +408,7 @@ type InputFrameDecoded struct { func (x *InputFrameDecoded) Reset() { *x = InputFrameDecoded{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[3] + mi := &file_room_downsync_frame_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -476,7 +421,7 @@ func (x *InputFrameDecoded) String() string { func (*InputFrameDecoded) ProtoMessage() {} func (x *InputFrameDecoded) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[3] + mi := &file_room_downsync_frame_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -489,7 +434,7 @@ func (x *InputFrameDecoded) ProtoReflect() protoreflect.Message { // Deprecated: Use InputFrameDecoded.ProtoReflect.Descriptor instead. func (*InputFrameDecoded) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{3} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{2} } func (x *InputFrameDecoded) GetDx() int32 { @@ -525,7 +470,7 @@ type InputFrameUpsync struct { func (x *InputFrameUpsync) Reset() { *x = InputFrameUpsync{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[4] + mi := &file_room_downsync_frame_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -538,7 +483,7 @@ func (x *InputFrameUpsync) String() string { func (*InputFrameUpsync) ProtoMessage() {} func (x *InputFrameUpsync) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[4] + mi := &file_room_downsync_frame_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -551,7 +496,7 @@ func (x *InputFrameUpsync) ProtoReflect() protoreflect.Message { // Deprecated: Use InputFrameUpsync.ProtoReflect.Descriptor instead. func (*InputFrameUpsync) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{4} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{3} } func (x *InputFrameUpsync) GetInputFrameId() int32 { @@ -581,7 +526,7 @@ type InputFrameDownsync struct { func (x *InputFrameDownsync) Reset() { *x = InputFrameDownsync{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[5] + mi := &file_room_downsync_frame_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -594,7 +539,7 @@ func (x *InputFrameDownsync) String() string { func (*InputFrameDownsync) ProtoMessage() {} func (x *InputFrameDownsync) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[5] + mi := &file_room_downsync_frame_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -607,7 +552,7 @@ func (x *InputFrameDownsync) ProtoReflect() protoreflect.Message { // Deprecated: Use InputFrameDownsync.ProtoReflect.Descriptor instead. func (*InputFrameDownsync) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{5} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{4} } func (x *InputFrameDownsync) GetInputFrameId() int32 { @@ -642,7 +587,7 @@ type HeartbeatUpsync struct { func (x *HeartbeatUpsync) Reset() { *x = HeartbeatUpsync{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[6] + mi := &file_room_downsync_frame_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -655,7 +600,7 @@ func (x *HeartbeatUpsync) String() string { func (*HeartbeatUpsync) ProtoMessage() {} func (x *HeartbeatUpsync) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[6] + mi := &file_room_downsync_frame_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -668,7 +613,7 @@ func (x *HeartbeatUpsync) ProtoReflect() protoreflect.Message { // Deprecated: Use HeartbeatUpsync.ProtoReflect.Descriptor instead. func (*HeartbeatUpsync) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{6} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{5} } func (x *HeartbeatUpsync) GetClientTimestamp() int64 { @@ -683,16 +628,15 @@ type RoomDownsyncFrame struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Players map[int32]*PlayerDownsync `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"` - PlayerMetas map[int32]*PlayerDownsyncMeta `protobuf:"bytes,4,rep,name=playerMetas,proto3" json:"playerMetas,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Players map[int32]*PlayerDownsync `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"` } func (x *RoomDownsyncFrame) Reset() { *x = RoomDownsyncFrame{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[7] + mi := &file_room_downsync_frame_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -705,7 +649,7 @@ func (x *RoomDownsyncFrame) String() string { func (*RoomDownsyncFrame) ProtoMessage() {} func (x *RoomDownsyncFrame) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[7] + mi := &file_room_downsync_frame_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -718,7 +662,7 @@ func (x *RoomDownsyncFrame) ProtoReflect() protoreflect.Message { // Deprecated: Use RoomDownsyncFrame.ProtoReflect.Descriptor instead. func (*RoomDownsyncFrame) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{7} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{6} } func (x *RoomDownsyncFrame) GetId() int32 { @@ -742,13 +686,6 @@ func (x *RoomDownsyncFrame) GetCountdownNanos() int64 { return 0 } -func (x *RoomDownsyncFrame) GetPlayerMetas() map[int32]*PlayerDownsyncMeta { - if x != nil { - return x.PlayerMetas - } - return nil -} - type WsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -767,7 +704,7 @@ type WsReq struct { func (x *WsReq) Reset() { *x = WsReq{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[8] + mi := &file_room_downsync_frame_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -780,7 +717,7 @@ func (x *WsReq) String() string { func (*WsReq) ProtoMessage() {} func (x *WsReq) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[8] + mi := &file_room_downsync_frame_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -793,7 +730,7 @@ func (x *WsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use WsReq.ProtoReflect.Descriptor instead. func (*WsReq) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{8} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{7} } func (x *WsReq) GetMsgId() int32 { @@ -868,7 +805,7 @@ type WsResp struct { func (x *WsResp) Reset() { *x = WsResp{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[9] + mi := &file_room_downsync_frame_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -881,7 +818,7 @@ func (x *WsResp) String() string { func (*WsResp) ProtoMessage() {} func (x *WsResp) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[9] + mi := &file_room_downsync_frame_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -894,7 +831,7 @@ func (x *WsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use WsResp.ProtoReflect.Descriptor instead. func (*WsResp) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{9} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{8} } func (x *WsResp) GetRet() int32 { @@ -1033,7 +970,7 @@ var file_room_downsync_frame_proto_rawDesc = []byte{ 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc7, 0x02, 0x0a, 0x0e, 0x50, 0x6c, 0x61, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbd, 0x03, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x58, 0x18, 0x02, 0x20, 0x01, 0x28, @@ -1046,111 +983,96 @@ var file_room_downsync_frame_proto_rawDesc = []byte{ 0x0a, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, - 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, - 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x22, 0xb8, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, - 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, - 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x63, - 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x22, 0x51, 0x0a, - 0x11, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, - 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, - 0x64, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, - 0x64, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, - 0x22, 0x50, 0x0a, 0x10, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, - 0x73, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, - 0x6d, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, - 0x65, 0x64, 0x22, 0x7c, 0x0a, 0x12, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, - 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, - 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, - 0x22, 0x3b, 0x0a, 0x0f, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, - 0x79, 0x6e, 0x63, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x8b, 0x03, - 0x0a, 0x11, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, - 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, - 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, - 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, - 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x4c, 0x0a, - 0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, - 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, - 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x1a, 0x52, 0x0a, 0x0c, 0x50, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, - 0x73, 0x79, 0x6e, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x5a, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x74, 0x61, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb8, 0x02, 0x0a, 0x05, - 0x57, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, - 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, - 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, - 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, - 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, - 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, - 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, - 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x4e, 0x0a, - 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, - 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, - 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, - 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x27, 0x0a, - 0x02, 0x68, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, - 0x6e, 0x63, 0x52, 0x02, 0x68, 0x62, 0x22, 0x89, 0x02, 0x0a, 0x06, 0x57, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x72, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73, 0x67, - 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, - 0x4d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x03, 0x72, 0x64, 0x66, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, - 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, - 0x03, 0x72, 0x64, 0x66, 0x12, 0x54, 0x0a, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, - 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, - 0x63, 0x52, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, - 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x36, 0x0a, 0x08, 0x62, 0x63, - 0x69, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, - 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72, 0x61, - 0x6d, 0x65, 0x42, 0x13, 0x5a, 0x11, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x73, 0x72, 0x76, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, + 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x63, 0x6f, + 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x11, + 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, + 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, + 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x51, 0x0a, 0x11, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x0e, 0x0a, + 0x02, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x78, 0x12, 0x0e, 0x0a, + 0x02, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x79, 0x12, 0x1c, 0x0a, + 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x50, 0x0a, 0x10, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x12, + 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x22, 0x7c, 0x0a, + 0x12, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, + 0x79, 0x6e, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, + 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x0f, 0x48, + 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x28, + 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x52, 0x6f, 0x6f, + 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x40, + 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, + 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, + 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, + 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, + 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x1a, 0x52, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, + 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb8, 0x02, 0x0a, + 0x05, 0x57, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, + 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, + 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x69, + 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x2e, + 0x0a, 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x63, 0x6b, 0x69, + 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x4e, + 0x0a, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, + 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, + 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x27, + 0x0a, 0x02, 0x68, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, + 0x79, 0x6e, 0x63, 0x52, 0x02, 0x68, 0x62, 0x22, 0x89, 0x02, 0x0a, 0x06, 0x57, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x72, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73, + 0x67, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, + 0x64, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x03, 0x72, 0x64, 0x66, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, + 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, + 0x52, 0x03, 0x72, 0x64, 0x66, 0x12, 0x54, 0x0a, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, + 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, + 0x6e, 0x63, 0x52, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, + 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x36, 0x0a, 0x08, 0x62, + 0x63, 0x69, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, + 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72, + 0x61, 0x6d, 0x65, 0x42, 0x13, 0x5a, 0x11, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x73, 0x72, + 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1165,46 +1087,42 @@ func file_room_downsync_frame_proto_rawDescGZIP() []byte { return file_room_downsync_frame_proto_rawDescData } -var file_room_downsync_frame_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_room_downsync_frame_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_room_downsync_frame_proto_goTypes = []interface{}{ (*BattleColliderInfo)(nil), // 0: protos.BattleColliderInfo (*PlayerDownsync)(nil), // 1: protos.PlayerDownsync - (*PlayerDownsyncMeta)(nil), // 2: protos.PlayerDownsyncMeta - (*InputFrameDecoded)(nil), // 3: protos.InputFrameDecoded - (*InputFrameUpsync)(nil), // 4: protos.InputFrameUpsync - (*InputFrameDownsync)(nil), // 5: protos.InputFrameDownsync - (*HeartbeatUpsync)(nil), // 6: protos.HeartbeatUpsync - (*RoomDownsyncFrame)(nil), // 7: protos.RoomDownsyncFrame - (*WsReq)(nil), // 8: protos.WsReq - (*WsResp)(nil), // 9: protos.WsResp - nil, // 10: protos.BattleColliderInfo.StrToVec2DListMapEntry - nil, // 11: protos.BattleColliderInfo.StrToPolygon2DListMapEntry - nil, // 12: protos.RoomDownsyncFrame.PlayersEntry - nil, // 13: protos.RoomDownsyncFrame.PlayerMetasEntry - (*sharedprotos.Direction)(nil), // 14: sharedprotos.Direction - (*sharedprotos.Vec2DList)(nil), // 15: sharedprotos.Vec2DList - (*sharedprotos.Polygon2DList)(nil), // 16: sharedprotos.Polygon2DList + (*InputFrameDecoded)(nil), // 2: protos.InputFrameDecoded + (*InputFrameUpsync)(nil), // 3: protos.InputFrameUpsync + (*InputFrameDownsync)(nil), // 4: protos.InputFrameDownsync + (*HeartbeatUpsync)(nil), // 5: protos.HeartbeatUpsync + (*RoomDownsyncFrame)(nil), // 6: protos.RoomDownsyncFrame + (*WsReq)(nil), // 7: protos.WsReq + (*WsResp)(nil), // 8: protos.WsResp + nil, // 9: protos.BattleColliderInfo.StrToVec2DListMapEntry + nil, // 10: protos.BattleColliderInfo.StrToPolygon2DListMapEntry + nil, // 11: protos.RoomDownsyncFrame.PlayersEntry + (*sharedprotos.Direction)(nil), // 12: sharedprotos.Direction + (*sharedprotos.Vec2DList)(nil), // 13: sharedprotos.Vec2DList + (*sharedprotos.Polygon2DList)(nil), // 14: sharedprotos.Polygon2DList } var file_room_downsync_frame_proto_depIdxs = []int32{ - 10, // 0: protos.BattleColliderInfo.strToVec2DListMap:type_name -> protos.BattleColliderInfo.StrToVec2DListMapEntry - 11, // 1: protos.BattleColliderInfo.strToPolygon2DListMap:type_name -> protos.BattleColliderInfo.StrToPolygon2DListMapEntry - 14, // 2: protos.PlayerDownsync.dir:type_name -> sharedprotos.Direction - 12, // 3: protos.RoomDownsyncFrame.players:type_name -> protos.RoomDownsyncFrame.PlayersEntry - 13, // 4: protos.RoomDownsyncFrame.playerMetas:type_name -> protos.RoomDownsyncFrame.PlayerMetasEntry - 4, // 5: protos.WsReq.inputFrameUpsyncBatch:type_name -> protos.InputFrameUpsync - 6, // 6: protos.WsReq.hb:type_name -> protos.HeartbeatUpsync - 7, // 7: protos.WsResp.rdf:type_name -> protos.RoomDownsyncFrame - 5, // 8: protos.WsResp.inputFrameDownsyncBatch:type_name -> protos.InputFrameDownsync - 0, // 9: protos.WsResp.bciFrame:type_name -> protos.BattleColliderInfo - 15, // 10: protos.BattleColliderInfo.StrToVec2DListMapEntry.value:type_name -> sharedprotos.Vec2DList - 16, // 11: protos.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> sharedprotos.Polygon2DList - 1, // 12: protos.RoomDownsyncFrame.PlayersEntry.value:type_name -> protos.PlayerDownsync - 2, // 13: protos.RoomDownsyncFrame.PlayerMetasEntry.value:type_name -> protos.PlayerDownsyncMeta - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 9, // 0: protos.BattleColliderInfo.strToVec2DListMap:type_name -> protos.BattleColliderInfo.StrToVec2DListMapEntry + 10, // 1: protos.BattleColliderInfo.strToPolygon2DListMap:type_name -> protos.BattleColliderInfo.StrToPolygon2DListMapEntry + 12, // 2: protos.PlayerDownsync.dir:type_name -> sharedprotos.Direction + 11, // 3: protos.RoomDownsyncFrame.players:type_name -> protos.RoomDownsyncFrame.PlayersEntry + 3, // 4: protos.WsReq.inputFrameUpsyncBatch:type_name -> protos.InputFrameUpsync + 5, // 5: protos.WsReq.hb:type_name -> protos.HeartbeatUpsync + 6, // 6: protos.WsResp.rdf:type_name -> protos.RoomDownsyncFrame + 4, // 7: protos.WsResp.inputFrameDownsyncBatch:type_name -> protos.InputFrameDownsync + 0, // 8: protos.WsResp.bciFrame:type_name -> protos.BattleColliderInfo + 13, // 9: protos.BattleColliderInfo.StrToVec2DListMapEntry.value:type_name -> sharedprotos.Vec2DList + 14, // 10: protos.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> sharedprotos.Polygon2DList + 1, // 11: protos.RoomDownsyncFrame.PlayersEntry.value:type_name -> protos.PlayerDownsync + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_room_downsync_frame_proto_init() } @@ -1238,18 +1156,6 @@ func file_room_downsync_frame_proto_init() { } } file_room_downsync_frame_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlayerDownsyncMeta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_downsync_frame_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InputFrameDecoded); i { case 0: return &v.state @@ -1261,7 +1167,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InputFrameUpsync); i { case 0: return &v.state @@ -1273,7 +1179,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InputFrameDownsync); i { case 0: return &v.state @@ -1285,7 +1191,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HeartbeatUpsync); i { case 0: return &v.state @@ -1297,7 +1203,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RoomDownsyncFrame); i { case 0: return &v.state @@ -1309,7 +1215,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WsReq); i { case 0: return &v.state @@ -1321,7 +1227,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WsResp); i { case 0: return &v.state @@ -1340,7 +1246,7 @@ func file_room_downsync_frame_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_room_downsync_frame_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/dnmshared/sharedprotos/geometry.pb.go b/dnmshared/sharedprotos/geometry.pb.go index e3aedc9..b96f64b 100644 --- a/dnmshared/sharedprotos/geometry.pb.go +++ b/dnmshared/sharedprotos/geometry.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.7.1 +// protoc v3.21.4 // source: geometry.proto package sharedprotos diff --git a/frontend/assets/resources/pbfiles/room_downsync_frame.proto b/frontend/assets/resources/pbfiles/room_downsync_frame.proto index ad3960f..b33f9a1 100644 --- a/frontend/assets/resources/pbfiles/room_downsync_frame.proto +++ b/frontend/assets/resources/pbfiles/room_downsync_frame.proto @@ -40,19 +40,15 @@ message PlayerDownsync { sharedprotos.Direction dir = 4; int32 speed = 5; // in terms of virtual grid units int32 battleState = 6; - int32 lastMoveGmtMillis = 7; + int32 joinIndex = 7; + double colliderRadius = 8; + bool removed = 9; int32 score = 10; - bool removed = 11; - int32 joinIndex = 12; -} + int32 lastMoveGmtMillis = 11; -message PlayerDownsyncMeta { - int32 id = 1; - string name = 2; - string displayName = 3; - string avatar = 4; - int32 joinIndex = 5; - double colliderRadius = 6; + string name = 12; + string displayName = 13; + string avatar = 14; } message InputFrameDecoded { @@ -80,7 +76,6 @@ message RoomDownsyncFrame { int32 id = 1; map players = 2; int64 countdownNanos = 3; - map playerMetas = 4; } message WsReq { diff --git a/frontend/assets/scenes/login.fire b/frontend/assets/scenes/login.fire index 2b9da7c..5cbb696 100644 --- a/frontend/assets/scenes/login.fire +++ b/frontend/assets/scenes/login.fire @@ -440,7 +440,7 @@ "array": [ 0, 0, - 344.6705889248102, + 210.4441731196186, 0, 0, 0, diff --git a/frontend/assets/scripts/Map.js b/frontend/assets/scripts/Map.js index 5bb3452..dea1087 100644 --- a/frontend/assets/scripts/Map.js +++ b/frontend/assets/scripts/Map.js @@ -210,7 +210,7 @@ cc.Class({ } } - // console.info(`inputFrameUpsyncBatch: ${JSON.stringify(inputFrameUpsyncBatch)}`); + // console.info(`inputFrameUpsyncBatch: ${JSON.stringify(inputFrameUpsyncBatch)}`); const reqData = window.pb.protos.WsReq.encode({ msgId: Date.now(), playerId: self.selfPlayerInfo.id, @@ -376,8 +376,7 @@ cc.Class({ window.clearBoundRoomIdInBothVolatileAndPersistentStorage(); window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ ); }; - resultPanelScriptIns.onCloseDelegate = () => { - }; + resultPanelScriptIns.onCloseDelegate = () => {}; self.gameRuleNode = cc.instantiate(self.gameRulePrefab); self.gameRuleNode.width = self.canvasNode.width; @@ -608,15 +607,13 @@ cc.Class({ } const players = rdf.players; - const playerMetas = rdf.playerMetas; - self._initPlayerRichInfoDict(players, playerMetas); + self._initPlayerRichInfoDict(players); // Show the top status indicators for IN_BATTLE if (self.playersInfoNode) { const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo"); - for (let i in playerMetas) { - const playerMeta = playerMetas[i]; - playersInfoScriptIns.updateData(playerMeta); + for (let i in players) { + playersInfoScriptIns.updateData(players[i]); } } @@ -716,7 +713,7 @@ cc.Class({ self.showPopupInCanvas(self.findingPlayerNode); } let findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer"); - findingPlayerScriptIns.updatePlayersInfo(rdf.playerMetas); + findingPlayerScriptIns.updatePlayersInfo(rdf.players); }, logBattleStats() { @@ -764,7 +761,9 @@ cc.Class({ playerScriptIns.setSpecies("SoldierElf"); } else if (2 == joinIndex) { playerScriptIns.setSpecies("SoldierFireGhost"); - playerScriptIns.animComp.node.scaleX = (-1.0); + if (0 == playerRichInfo.dir.dx && 0 == playerRichInfo.dir.dy) { + playerScriptIns.animComp.node.scaleX = (-1.0); + } } const wpos = self.virtualGridToWorldPos(vx, vy); @@ -937,29 +936,27 @@ cc.Class({ if (null == self.findingPlayerNode.parent) return; self.findingPlayerNode.parent.removeChild(self.findingPlayerNode); if (null != rdf) { - self._initPlayerRichInfoDict(rdf.players, rdf.playerMetas); + self._initPlayerRichInfoDict(rdf.players); } }, onBattleReadyToStart(rdf) { const self = this; const players = rdf.players; - const playerMetas = rdf.playerMetas; - self._initPlayerRichInfoDict(players, playerMetas); + self._initPlayerRichInfoDict(players); // Show the top status indicators for IN_BATTLE if (self.playersInfoNode) { const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo"); - for (let i in playerMetas) { - const playerMeta = playerMetas[i]; - playersInfoScriptIns.updateData(playerMeta); + for (let i in players) { + playersInfoScriptIns.updateData(players[i]); } } - console.log("Calling `onBattleReadyToStart` with:", playerMetas); + console.log("Calling `onBattleReadyToStart` with:", players); if (self.findingPlayerNode) { const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer"); findingPlayerScriptIns.hideExitButton(); - findingPlayerScriptIns.updatePlayersInfo(playerMetas); + findingPlayerScriptIns.updatePlayersInfo(players); } // Delay to hide the "finding player" GUI, then show a countdown clock @@ -975,6 +972,7 @@ cc.Class({ applyRoomDownsyncFrameDynamics(rdf) { const self = this; + const delayedInputFrameForPrevRenderFrame = self.getCachedInputFrameDownsyncWithPrediction(self._convertToInputFrameId(rdf.id - 1, self.inputDelayFrames)); self.playerRichInfoDict.forEach((playerRichInfo, playerId) => { const immediatePlayerInfo = rdf.players[playerId]; @@ -985,7 +983,10 @@ cc.Class({ playerRichInfo.node.setPosition(wpos[0], wpos[1]); playerRichInfo.virtualGridX = immediatePlayerInfo.virtualGridX; playerRichInfo.virtualGridY = immediatePlayerInfo.virtualGridY; - playerRichInfo.scriptIns.scheduleNewDirection(immediatePlayerInfo.dir, false); + if (null != delayedInputFrameForPrevRenderFrame) { + const decodedInput = self.ctrl.decodeInput(delayedInputFrameForPrevRenderFrame.inputList[playerRichInfo.joinIndex - 1]); + playerRichInfo.scriptIns.scheduleNewDirection(decodedInput, false); + } playerRichInfo.scriptIns.updateSpeed(immediatePlayerInfo.speed); }); }, @@ -1053,9 +1054,11 @@ cc.Class({ const newCpos = self.virtualGridToPlayerColliderPos(newVx, newVy, self.playerRichInfoArr[joinIndex - 1]); playerCollider.x = newCpos[0]; playerCollider.y = newCpos[1]; - // Update directions and thus would eventually update moving animation accordingly - nextRenderFramePlayers[playerId].dir.dx = decodedInput.dx; - nextRenderFramePlayers[playerId].dir.dy = decodedInput.dy; + if (0 != decodedInput.dx || 0 != decodedInput.dy) { + // Update directions and thus would eventually update moving animation accordingly + nextRenderFramePlayers[playerId].dir.dx = decodedInput.dx; + nextRenderFramePlayers[playerId].dir.dy = decodedInput.dy; + } } collisionSys.update(); @@ -1142,15 +1145,13 @@ cc.Class({ return latestRdf; }, - _initPlayerRichInfoDict(players, playerMetas) { + _initPlayerRichInfoDict(players) { const self = this; for (let k in players) { const playerId = parseInt(k); if (self.playerRichInfoDict.has(playerId)) continue; // Skip already put keys const immediatePlayerInfo = players[playerId]; - const immediatePlayerMeta = playerMetas[playerId]; self.playerRichInfoDict.set(playerId, immediatePlayerInfo); - Object.assign(self.playerRichInfoDict.get(playerId), immediatePlayerMeta); const nodeAndScriptIns = self.spawnPlayerNode(immediatePlayerInfo.joinIndex, immediatePlayerInfo.virtualGridX, immediatePlayerInfo.virtualGridY, self.playerRichInfoDict.get(playerId)); diff --git a/frontend/assets/scripts/TouchEventsManager.js b/frontend/assets/scripts/TouchEventsManager.js index 13b9c69..5a61093 100644 --- a/frontend/assets/scripts/TouchEventsManager.js +++ b/frontend/assets/scripts/TouchEventsManager.js @@ -410,10 +410,10 @@ cc.Class({ console.error("Unexpected encodedDirection = ", encodedDirection); } const btnALevel = ((encodedInput >> 4) & 1); - return { + return window.pb.protos.InputFrameDecoded.create({ dx: mappedDirection[0], dy: mappedDirection[1], - a: btnALevel, - }; + btnALevel: btnALevel, + }); }, }); diff --git a/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js b/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js index 71c7970..6a40721 100644 --- a/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js +++ b/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js @@ -83,9 +83,9 @@ $root.sharedprotos = (function() { Direction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dx != null && message.hasOwnProperty("dx")) + if (message.dx != null && Object.hasOwnProperty.call(message, "dx")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dx); - if (message.dy != null && message.hasOwnProperty("dy")) + if (message.dy != null && Object.hasOwnProperty.call(message, "dy")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dy); return writer; }; @@ -121,12 +121,14 @@ $root.sharedprotos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.dx = reader.int32(); - break; - case 2: - message.dy = reader.int32(); - break; + case 1: { + message.dx = reader.int32(); + break; + } + case 2: { + message.dy = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -225,6 +227,21 @@ $root.sharedprotos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Direction + * @function getTypeUrl + * @memberof sharedprotos.Direction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Direction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/sharedprotos.Direction"; + }; + return Direction; })(); @@ -293,9 +310,9 @@ $root.sharedprotos = (function() { Vec2D.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.x != null && message.hasOwnProperty("x")) + if (message.x != null && Object.hasOwnProperty.call(message, "x")) writer.uint32(/* id 1, wireType 1 =*/9).double(message.x); - if (message.y != null && message.hasOwnProperty("y")) + if (message.y != null && Object.hasOwnProperty.call(message, "y")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.y); return writer; }; @@ -331,12 +348,14 @@ $root.sharedprotos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.x = reader.double(); - break; - case 2: - message.y = reader.double(); - break; + case 1: { + message.x = reader.double(); + break; + } + case 2: { + message.y = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -435,6 +454,21 @@ $root.sharedprotos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Vec2D + * @function getTypeUrl + * @memberof sharedprotos.Vec2D + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vec2D.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/sharedprotos.Vec2D"; + }; + return Vec2D; })(); @@ -504,7 +538,7 @@ $root.sharedprotos = (function() { Polygon2D.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.anchor != null && message.hasOwnProperty("anchor")) + if (message.anchor != null && Object.hasOwnProperty.call(message, "anchor")) $root.sharedprotos.Vec2D.encode(message.anchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.points != null && message.points.length) for (var i = 0; i < message.points.length; ++i) @@ -543,14 +577,16 @@ $root.sharedprotos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.anchor = $root.sharedprotos.Vec2D.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.points && message.points.length)) - message.points = []; - message.points.push($root.sharedprotos.Vec2D.decode(reader, reader.uint32())); - break; + case 1: { + message.anchor = $root.sharedprotos.Vec2D.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.points && message.points.length)) + message.points = []; + message.points.push($root.sharedprotos.Vec2D.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -671,6 +707,21 @@ $root.sharedprotos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Polygon2D + * @function getTypeUrl + * @memberof sharedprotos.Polygon2D + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Polygon2D.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/sharedprotos.Polygon2D"; + }; + return Polygon2D; })(); @@ -768,11 +819,12 @@ $root.sharedprotos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.eles && message.eles.length)) - message.eles = []; - message.eles.push($root.sharedprotos.Vec2D.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.eles && message.eles.length)) + message.eles = []; + message.eles.push($root.sharedprotos.Vec2D.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -879,6 +931,21 @@ $root.sharedprotos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Vec2DList + * @function getTypeUrl + * @memberof sharedprotos.Vec2DList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vec2DList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/sharedprotos.Vec2DList"; + }; + return Vec2DList; })(); @@ -976,11 +1043,12 @@ $root.sharedprotos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.eles && message.eles.length)) - message.eles = []; - message.eles.push($root.sharedprotos.Polygon2D.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.eles && message.eles.length)) + message.eles = []; + message.eles.push($root.sharedprotos.Polygon2D.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -1087,6 +1155,21 @@ $root.sharedprotos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Polygon2DList + * @function getTypeUrl + * @memberof sharedprotos.Polygon2DList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Polygon2DList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/sharedprotos.Polygon2DList"; + }; + return Polygon2DList; })(); @@ -1358,57 +1441,57 @@ $root.protos = (function() { BattleColliderInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stageName != null && message.hasOwnProperty("stageName")) + if (message.stageName != null && Object.hasOwnProperty.call(message, "stageName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.stageName); - if (message.strToVec2DListMap != null && message.hasOwnProperty("strToVec2DListMap")) + if (message.strToVec2DListMap != null && Object.hasOwnProperty.call(message, "strToVec2DListMap")) for (var keys = Object.keys(message.strToVec2DListMap), i = 0; i < keys.length; ++i) { writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.sharedprotos.Vec2DList.encode(message.strToVec2DListMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.strToPolygon2DListMap != null && message.hasOwnProperty("strToPolygon2DListMap")) + if (message.strToPolygon2DListMap != null && Object.hasOwnProperty.call(message, "strToPolygon2DListMap")) for (var keys = Object.keys(message.strToPolygon2DListMap), i = 0; i < keys.length; ++i) { writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.sharedprotos.Polygon2DList.encode(message.strToPolygon2DListMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.stageDiscreteW != null && message.hasOwnProperty("stageDiscreteW")) + if (message.stageDiscreteW != null && Object.hasOwnProperty.call(message, "stageDiscreteW")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.stageDiscreteW); - if (message.stageDiscreteH != null && message.hasOwnProperty("stageDiscreteH")) + if (message.stageDiscreteH != null && Object.hasOwnProperty.call(message, "stageDiscreteH")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.stageDiscreteH); - if (message.stageTileW != null && message.hasOwnProperty("stageTileW")) + if (message.stageTileW != null && Object.hasOwnProperty.call(message, "stageTileW")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.stageTileW); - if (message.stageTileH != null && message.hasOwnProperty("stageTileH")) + if (message.stageTileH != null && Object.hasOwnProperty.call(message, "stageTileH")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.stageTileH); - if (message.intervalToPing != null && message.hasOwnProperty("intervalToPing")) + if (message.intervalToPing != null && Object.hasOwnProperty.call(message, "intervalToPing")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.intervalToPing); - if (message.willKickIfInactiveFor != null && message.hasOwnProperty("willKickIfInactiveFor")) + if (message.willKickIfInactiveFor != null && Object.hasOwnProperty.call(message, "willKickIfInactiveFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.willKickIfInactiveFor); - if (message.boundRoomId != null && message.hasOwnProperty("boundRoomId")) + if (message.boundRoomId != null && Object.hasOwnProperty.call(message, "boundRoomId")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.boundRoomId); - if (message.battleDurationNanos != null && message.hasOwnProperty("battleDurationNanos")) + if (message.battleDurationNanos != null && Object.hasOwnProperty.call(message, "battleDurationNanos")) writer.uint32(/* id 11, wireType 0 =*/88).int64(message.battleDurationNanos); - if (message.serverFps != null && message.hasOwnProperty("serverFps")) + if (message.serverFps != null && Object.hasOwnProperty.call(message, "serverFps")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.serverFps); - if (message.inputDelayFrames != null && message.hasOwnProperty("inputDelayFrames")) + if (message.inputDelayFrames != null && Object.hasOwnProperty.call(message, "inputDelayFrames")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.inputDelayFrames); - if (message.inputScaleFrames != null && message.hasOwnProperty("inputScaleFrames")) + if (message.inputScaleFrames != null && Object.hasOwnProperty.call(message, "inputScaleFrames")) writer.uint32(/* id 14, wireType 0 =*/112).uint32(message.inputScaleFrames); - if (message.nstDelayFrames != null && message.hasOwnProperty("nstDelayFrames")) + if (message.nstDelayFrames != null && Object.hasOwnProperty.call(message, "nstDelayFrames")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.nstDelayFrames); - if (message.inputFrameUpsyncDelayTolerance != null && message.hasOwnProperty("inputFrameUpsyncDelayTolerance")) + if (message.inputFrameUpsyncDelayTolerance != null && Object.hasOwnProperty.call(message, "inputFrameUpsyncDelayTolerance")) writer.uint32(/* id 16, wireType 0 =*/128).int32(message.inputFrameUpsyncDelayTolerance); - if (message.maxChasingRenderFramesPerUpdate != null && message.hasOwnProperty("maxChasingRenderFramesPerUpdate")) + if (message.maxChasingRenderFramesPerUpdate != null && Object.hasOwnProperty.call(message, "maxChasingRenderFramesPerUpdate")) writer.uint32(/* id 17, wireType 0 =*/136).int32(message.maxChasingRenderFramesPerUpdate); - if (message.playerBattleState != null && message.hasOwnProperty("playerBattleState")) + if (message.playerBattleState != null && Object.hasOwnProperty.call(message, "playerBattleState")) writer.uint32(/* id 18, wireType 0 =*/144).int32(message.playerBattleState); - if (message.rollbackEstimatedDtMillis != null && message.hasOwnProperty("rollbackEstimatedDtMillis")) + if (message.rollbackEstimatedDtMillis != null && Object.hasOwnProperty.call(message, "rollbackEstimatedDtMillis")) writer.uint32(/* id 19, wireType 1 =*/153).double(message.rollbackEstimatedDtMillis); - if (message.rollbackEstimatedDtNanos != null && message.hasOwnProperty("rollbackEstimatedDtNanos")) + if (message.rollbackEstimatedDtNanos != null && Object.hasOwnProperty.call(message, "rollbackEstimatedDtNanos")) writer.uint32(/* id 20, wireType 0 =*/160).int64(message.rollbackEstimatedDtNanos); - if (message.worldToVirtualGridRatio != null && message.hasOwnProperty("worldToVirtualGridRatio")) + if (message.worldToVirtualGridRatio != null && Object.hasOwnProperty.call(message, "worldToVirtualGridRatio")) writer.uint32(/* id 21, wireType 1 =*/169).double(message.worldToVirtualGridRatio); - if (message.virtualGridToWorldRatio != null && message.hasOwnProperty("virtualGridToWorldRatio")) + if (message.virtualGridToWorldRatio != null && Object.hasOwnProperty.call(message, "virtualGridToWorldRatio")) writer.uint32(/* id 22, wireType 1 =*/177).double(message.virtualGridToWorldRatio); - if (message.spAtkLookupFrames != null && message.hasOwnProperty("spAtkLookupFrames")) + if (message.spAtkLookupFrames != null && Object.hasOwnProperty.call(message, "spAtkLookupFrames")) writer.uint32(/* id 23, wireType 0 =*/184).int32(message.spAtkLookupFrames); return writer; }; @@ -1440,89 +1523,140 @@ $root.protos = (function() { BattleColliderInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.BattleColliderInfo(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.BattleColliderInfo(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.stageName = reader.string(); - break; - case 2: - reader.skip().pos++; - if (message.strToVec2DListMap === $util.emptyObject) - message.strToVec2DListMap = {}; - key = reader.string(); - reader.pos++; - message.strToVec2DListMap[key] = $root.sharedprotos.Vec2DList.decode(reader, reader.uint32()); - break; - case 3: - reader.skip().pos++; - if (message.strToPolygon2DListMap === $util.emptyObject) - message.strToPolygon2DListMap = {}; - key = reader.string(); - reader.pos++; - message.strToPolygon2DListMap[key] = $root.sharedprotos.Polygon2DList.decode(reader, reader.uint32()); - break; - case 4: - message.stageDiscreteW = reader.int32(); - break; - case 5: - message.stageDiscreteH = reader.int32(); - break; - case 6: - message.stageTileW = reader.int32(); - break; - case 7: - message.stageTileH = reader.int32(); - break; - case 8: - message.intervalToPing = reader.int32(); - break; - case 9: - message.willKickIfInactiveFor = reader.int32(); - break; - case 10: - message.boundRoomId = reader.int32(); - break; - case 11: - message.battleDurationNanos = reader.int64(); - break; - case 12: - message.serverFps = reader.int32(); - break; - case 13: - message.inputDelayFrames = reader.int32(); - break; - case 14: - message.inputScaleFrames = reader.uint32(); - break; - case 15: - message.nstDelayFrames = reader.int32(); - break; - case 16: - message.inputFrameUpsyncDelayTolerance = reader.int32(); - break; - case 17: - message.maxChasingRenderFramesPerUpdate = reader.int32(); - break; - case 18: - message.playerBattleState = reader.int32(); - break; - case 19: - message.rollbackEstimatedDtMillis = reader.double(); - break; - case 20: - message.rollbackEstimatedDtNanos = reader.int64(); - break; - case 21: - message.worldToVirtualGridRatio = reader.double(); - break; - case 22: - message.virtualGridToWorldRatio = reader.double(); - break; - case 23: - message.spAtkLookupFrames = reader.int32(); - break; + case 1: { + message.stageName = reader.string(); + break; + } + case 2: { + if (message.strToVec2DListMap === $util.emptyObject) + message.strToVec2DListMap = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.sharedprotos.Vec2DList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.strToVec2DListMap[key] = value; + break; + } + case 3: { + if (message.strToPolygon2DListMap === $util.emptyObject) + message.strToPolygon2DListMap = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.sharedprotos.Polygon2DList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.strToPolygon2DListMap[key] = value; + break; + } + case 4: { + message.stageDiscreteW = reader.int32(); + break; + } + case 5: { + message.stageDiscreteH = reader.int32(); + break; + } + case 6: { + message.stageTileW = reader.int32(); + break; + } + case 7: { + message.stageTileH = reader.int32(); + break; + } + case 8: { + message.intervalToPing = reader.int32(); + break; + } + case 9: { + message.willKickIfInactiveFor = reader.int32(); + break; + } + case 10: { + message.boundRoomId = reader.int32(); + break; + } + case 11: { + message.battleDurationNanos = reader.int64(); + break; + } + case 12: { + message.serverFps = reader.int32(); + break; + } + case 13: { + message.inputDelayFrames = reader.int32(); + break; + } + case 14: { + message.inputScaleFrames = reader.uint32(); + break; + } + case 15: { + message.nstDelayFrames = reader.int32(); + break; + } + case 16: { + message.inputFrameUpsyncDelayTolerance = reader.int32(); + break; + } + case 17: { + message.maxChasingRenderFramesPerUpdate = reader.int32(); + break; + } + case 18: { + message.playerBattleState = reader.int32(); + break; + } + case 19: { + message.rollbackEstimatedDtMillis = reader.double(); + break; + } + case 20: { + message.rollbackEstimatedDtNanos = reader.int64(); + break; + } + case 21: { + message.worldToVirtualGridRatio = reader.double(); + break; + } + case 22: { + message.virtualGridToWorldRatio = reader.double(); + break; + } + case 23: { + message.spAtkLookupFrames = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1856,6 +1990,21 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BattleColliderInfo + * @function getTypeUrl + * @memberof protos.BattleColliderInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BattleColliderInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.BattleColliderInfo"; + }; + return BattleColliderInfo; })(); @@ -1871,10 +2020,14 @@ $root.protos = (function() { * @property {sharedprotos.Direction|null} [dir] PlayerDownsync dir * @property {number|null} [speed] PlayerDownsync speed * @property {number|null} [battleState] PlayerDownsync battleState - * @property {number|null} [lastMoveGmtMillis] PlayerDownsync lastMoveGmtMillis - * @property {number|null} [score] PlayerDownsync score - * @property {boolean|null} [removed] PlayerDownsync removed * @property {number|null} [joinIndex] PlayerDownsync joinIndex + * @property {number|null} [colliderRadius] PlayerDownsync colliderRadius + * @property {boolean|null} [removed] PlayerDownsync removed + * @property {number|null} [score] PlayerDownsync score + * @property {number|null} [lastMoveGmtMillis] PlayerDownsync lastMoveGmtMillis + * @property {string|null} [name] PlayerDownsync name + * @property {string|null} [displayName] PlayerDownsync displayName + * @property {string|null} [avatar] PlayerDownsync avatar */ /** @@ -1941,20 +2094,20 @@ $root.protos = (function() { PlayerDownsync.prototype.battleState = 0; /** - * PlayerDownsync lastMoveGmtMillis. - * @member {number} lastMoveGmtMillis + * PlayerDownsync joinIndex. + * @member {number} joinIndex * @memberof protos.PlayerDownsync * @instance */ - PlayerDownsync.prototype.lastMoveGmtMillis = 0; + PlayerDownsync.prototype.joinIndex = 0; /** - * PlayerDownsync score. - * @member {number} score + * PlayerDownsync colliderRadius. + * @member {number} colliderRadius * @memberof protos.PlayerDownsync * @instance */ - PlayerDownsync.prototype.score = 0; + PlayerDownsync.prototype.colliderRadius = 0; /** * PlayerDownsync removed. @@ -1965,12 +2118,44 @@ $root.protos = (function() { PlayerDownsync.prototype.removed = false; /** - * PlayerDownsync joinIndex. - * @member {number} joinIndex + * PlayerDownsync score. + * @member {number} score * @memberof protos.PlayerDownsync * @instance */ - PlayerDownsync.prototype.joinIndex = 0; + PlayerDownsync.prototype.score = 0; + + /** + * PlayerDownsync lastMoveGmtMillis. + * @member {number} lastMoveGmtMillis + * @memberof protos.PlayerDownsync + * @instance + */ + PlayerDownsync.prototype.lastMoveGmtMillis = 0; + + /** + * PlayerDownsync name. + * @member {string} name + * @memberof protos.PlayerDownsync + * @instance + */ + PlayerDownsync.prototype.name = ""; + + /** + * PlayerDownsync displayName. + * @member {string} displayName + * @memberof protos.PlayerDownsync + * @instance + */ + PlayerDownsync.prototype.displayName = ""; + + /** + * PlayerDownsync avatar. + * @member {string} avatar + * @memberof protos.PlayerDownsync + * @instance + */ + PlayerDownsync.prototype.avatar = ""; /** * Creates a new PlayerDownsync instance using the specified properties. @@ -1996,26 +2181,34 @@ $root.protos = (function() { PlayerDownsync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && message.hasOwnProperty("id")) + if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.virtualGridX != null && message.hasOwnProperty("virtualGridX")) + if (message.virtualGridX != null && Object.hasOwnProperty.call(message, "virtualGridX")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.virtualGridX); - if (message.virtualGridY != null && message.hasOwnProperty("virtualGridY")) + if (message.virtualGridY != null && Object.hasOwnProperty.call(message, "virtualGridY")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.virtualGridY); - if (message.dir != null && message.hasOwnProperty("dir")) + if (message.dir != null && Object.hasOwnProperty.call(message, "dir")) $root.sharedprotos.Direction.encode(message.dir, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.speed != null && message.hasOwnProperty("speed")) + if (message.speed != null && Object.hasOwnProperty.call(message, "speed")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speed); - if (message.battleState != null && message.hasOwnProperty("battleState")) + if (message.battleState != null && Object.hasOwnProperty.call(message, "battleState")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.battleState); - if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.lastMoveGmtMillis); - if (message.score != null && message.hasOwnProperty("score")) + if (message.joinIndex != null && Object.hasOwnProperty.call(message, "joinIndex")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.joinIndex); + if (message.colliderRadius != null && Object.hasOwnProperty.call(message, "colliderRadius")) + writer.uint32(/* id 8, wireType 1 =*/65).double(message.colliderRadius); + if (message.removed != null && Object.hasOwnProperty.call(message, "removed")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.removed); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.score); - if (message.removed != null && message.hasOwnProperty("removed")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.removed); - if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.joinIndex); + if (message.lastMoveGmtMillis != null && Object.hasOwnProperty.call(message, "lastMoveGmtMillis")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.lastMoveGmtMillis); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); + if (message.avatar != null && Object.hasOwnProperty.call(message, "avatar")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.avatar); return writer; }; @@ -2050,36 +2243,62 @@ $root.protos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.id = reader.int32(); - break; - case 2: - message.virtualGridX = reader.int32(); - break; - case 3: - message.virtualGridY = reader.int32(); - break; - case 4: - message.dir = $root.sharedprotos.Direction.decode(reader, reader.uint32()); - break; - case 5: - message.speed = reader.int32(); - break; - case 6: - message.battleState = reader.int32(); - break; - case 7: - message.lastMoveGmtMillis = reader.int32(); - break; - case 10: - message.score = reader.int32(); - break; - case 11: - message.removed = reader.bool(); - break; - case 12: - message.joinIndex = reader.int32(); - break; + case 1: { + message.id = reader.int32(); + break; + } + case 2: { + message.virtualGridX = reader.int32(); + break; + } + case 3: { + message.virtualGridY = reader.int32(); + break; + } + case 4: { + message.dir = $root.sharedprotos.Direction.decode(reader, reader.uint32()); + break; + } + case 5: { + message.speed = reader.int32(); + break; + } + case 6: { + message.battleState = reader.int32(); + break; + } + case 7: { + message.joinIndex = reader.int32(); + break; + } + case 8: { + message.colliderRadius = reader.double(); + break; + } + case 9: { + message.removed = reader.bool(); + break; + } + case 10: { + message.score = reader.int32(); + break; + } + case 11: { + message.lastMoveGmtMillis = reader.int32(); + break; + } + case 12: { + message.name = reader.string(); + break; + } + case 13: { + message.displayName = reader.string(); + break; + } + case 14: { + message.avatar = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2135,18 +2354,30 @@ $root.protos = (function() { if (message.battleState != null && message.hasOwnProperty("battleState")) if (!$util.isInteger(message.battleState)) return "battleState: integer expected"; - if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis")) - if (!$util.isInteger(message.lastMoveGmtMillis)) - return "lastMoveGmtMillis: integer expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (!$util.isInteger(message.score)) - return "score: integer expected"; - if (message.removed != null && message.hasOwnProperty("removed")) - if (typeof message.removed !== "boolean") - return "removed: boolean expected"; if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) if (!$util.isInteger(message.joinIndex)) return "joinIndex: integer expected"; + if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius")) + if (typeof message.colliderRadius !== "number") + return "colliderRadius: number expected"; + if (message.removed != null && message.hasOwnProperty("removed")) + if (typeof message.removed !== "boolean") + return "removed: boolean expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (!$util.isInteger(message.score)) + return "score: integer expected"; + if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis")) + if (!$util.isInteger(message.lastMoveGmtMillis)) + return "lastMoveGmtMillis: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.avatar != null && message.hasOwnProperty("avatar")) + if (!$util.isString(message.avatar)) + return "avatar: string expected"; return null; }; @@ -2177,14 +2408,22 @@ $root.protos = (function() { message.speed = object.speed | 0; if (object.battleState != null) message.battleState = object.battleState | 0; - if (object.lastMoveGmtMillis != null) - message.lastMoveGmtMillis = object.lastMoveGmtMillis | 0; - if (object.score != null) - message.score = object.score | 0; - if (object.removed != null) - message.removed = Boolean(object.removed); if (object.joinIndex != null) message.joinIndex = object.joinIndex | 0; + if (object.colliderRadius != null) + message.colliderRadius = Number(object.colliderRadius); + if (object.removed != null) + message.removed = Boolean(object.removed); + if (object.score != null) + message.score = object.score | 0; + if (object.lastMoveGmtMillis != null) + message.lastMoveGmtMillis = object.lastMoveGmtMillis | 0; + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.avatar != null) + message.avatar = String(object.avatar); return message; }; @@ -2208,10 +2447,14 @@ $root.protos = (function() { object.dir = null; object.speed = 0; object.battleState = 0; - object.lastMoveGmtMillis = 0; - object.score = 0; - object.removed = false; object.joinIndex = 0; + object.colliderRadius = 0; + object.removed = false; + object.score = 0; + object.lastMoveGmtMillis = 0; + object.name = ""; + object.displayName = ""; + object.avatar = ""; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -2225,14 +2468,22 @@ $root.protos = (function() { object.speed = message.speed; if (message.battleState != null && message.hasOwnProperty("battleState")) object.battleState = message.battleState; - if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis")) - object.lastMoveGmtMillis = message.lastMoveGmtMillis; - if (message.score != null && message.hasOwnProperty("score")) - object.score = message.score; - if (message.removed != null && message.hasOwnProperty("removed")) - object.removed = message.removed; if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) object.joinIndex = message.joinIndex; + if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius")) + object.colliderRadius = options.json && !isFinite(message.colliderRadius) ? String(message.colliderRadius) : message.colliderRadius; + if (message.removed != null && message.hasOwnProperty("removed")) + object.removed = message.removed; + if (message.score != null && message.hasOwnProperty("score")) + object.score = message.score; + if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis")) + object.lastMoveGmtMillis = message.lastMoveGmtMillis; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.avatar != null && message.hasOwnProperty("avatar")) + object.avatar = message.avatar; return object; }; @@ -2247,307 +2498,24 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PlayerDownsync + * @function getTypeUrl + * @memberof protos.PlayerDownsync + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlayerDownsync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.PlayerDownsync"; + }; + return PlayerDownsync; })(); - protos.PlayerDownsyncMeta = (function() { - - /** - * Properties of a PlayerDownsyncMeta. - * @memberof protos - * @interface IPlayerDownsyncMeta - * @property {number|null} [id] PlayerDownsyncMeta id - * @property {string|null} [name] PlayerDownsyncMeta name - * @property {string|null} [displayName] PlayerDownsyncMeta displayName - * @property {string|null} [avatar] PlayerDownsyncMeta avatar - * @property {number|null} [joinIndex] PlayerDownsyncMeta joinIndex - * @property {number|null} [colliderRadius] PlayerDownsyncMeta colliderRadius - */ - - /** - * Constructs a new PlayerDownsyncMeta. - * @memberof protos - * @classdesc Represents a PlayerDownsyncMeta. - * @implements IPlayerDownsyncMeta - * @constructor - * @param {protos.IPlayerDownsyncMeta=} [properties] Properties to set - */ - function PlayerDownsyncMeta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PlayerDownsyncMeta id. - * @member {number} id - * @memberof protos.PlayerDownsyncMeta - * @instance - */ - PlayerDownsyncMeta.prototype.id = 0; - - /** - * PlayerDownsyncMeta name. - * @member {string} name - * @memberof protos.PlayerDownsyncMeta - * @instance - */ - PlayerDownsyncMeta.prototype.name = ""; - - /** - * PlayerDownsyncMeta displayName. - * @member {string} displayName - * @memberof protos.PlayerDownsyncMeta - * @instance - */ - PlayerDownsyncMeta.prototype.displayName = ""; - - /** - * PlayerDownsyncMeta avatar. - * @member {string} avatar - * @memberof protos.PlayerDownsyncMeta - * @instance - */ - PlayerDownsyncMeta.prototype.avatar = ""; - - /** - * PlayerDownsyncMeta joinIndex. - * @member {number} joinIndex - * @memberof protos.PlayerDownsyncMeta - * @instance - */ - PlayerDownsyncMeta.prototype.joinIndex = 0; - - /** - * PlayerDownsyncMeta colliderRadius. - * @member {number} colliderRadius - * @memberof protos.PlayerDownsyncMeta - * @instance - */ - PlayerDownsyncMeta.prototype.colliderRadius = 0; - - /** - * Creates a new PlayerDownsyncMeta instance using the specified properties. - * @function create - * @memberof protos.PlayerDownsyncMeta - * @static - * @param {protos.IPlayerDownsyncMeta=} [properties] Properties to set - * @returns {protos.PlayerDownsyncMeta} PlayerDownsyncMeta instance - */ - PlayerDownsyncMeta.create = function create(properties) { - return new PlayerDownsyncMeta(properties); - }; - - /** - * Encodes the specified PlayerDownsyncMeta message. Does not implicitly {@link protos.PlayerDownsyncMeta.verify|verify} messages. - * @function encode - * @memberof protos.PlayerDownsyncMeta - * @static - * @param {protos.PlayerDownsyncMeta} message PlayerDownsyncMeta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlayerDownsyncMeta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && message.hasOwnProperty("id")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.avatar != null && message.hasOwnProperty("avatar")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.avatar); - if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.joinIndex); - if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.colliderRadius); - return writer; - }; - - /** - * Encodes the specified PlayerDownsyncMeta message, length delimited. Does not implicitly {@link protos.PlayerDownsyncMeta.verify|verify} messages. - * @function encodeDelimited - * @memberof protos.PlayerDownsyncMeta - * @static - * @param {protos.PlayerDownsyncMeta} message PlayerDownsyncMeta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlayerDownsyncMeta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PlayerDownsyncMeta message from the specified reader or buffer. - * @function decode - * @memberof protos.PlayerDownsyncMeta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {protos.PlayerDownsyncMeta} PlayerDownsyncMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlayerDownsyncMeta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.PlayerDownsyncMeta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.int32(); - break; - case 2: - message.name = reader.string(); - break; - case 3: - message.displayName = reader.string(); - break; - case 4: - message.avatar = reader.string(); - break; - case 5: - message.joinIndex = reader.int32(); - break; - case 6: - message.colliderRadius = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PlayerDownsyncMeta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof protos.PlayerDownsyncMeta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {protos.PlayerDownsyncMeta} PlayerDownsyncMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlayerDownsyncMeta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PlayerDownsyncMeta message. - * @function verify - * @memberof protos.PlayerDownsyncMeta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PlayerDownsyncMeta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id)) - return "id: integer expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.avatar != null && message.hasOwnProperty("avatar")) - if (!$util.isString(message.avatar)) - return "avatar: string expected"; - if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) - if (!$util.isInteger(message.joinIndex)) - return "joinIndex: integer expected"; - if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius")) - if (typeof message.colliderRadius !== "number") - return "colliderRadius: number expected"; - return null; - }; - - /** - * Creates a PlayerDownsyncMeta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof protos.PlayerDownsyncMeta - * @static - * @param {Object.} object Plain object - * @returns {protos.PlayerDownsyncMeta} PlayerDownsyncMeta - */ - PlayerDownsyncMeta.fromObject = function fromObject(object) { - if (object instanceof $root.protos.PlayerDownsyncMeta) - return object; - var message = new $root.protos.PlayerDownsyncMeta(); - if (object.id != null) - message.id = object.id | 0; - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.avatar != null) - message.avatar = String(object.avatar); - if (object.joinIndex != null) - message.joinIndex = object.joinIndex | 0; - if (object.colliderRadius != null) - message.colliderRadius = Number(object.colliderRadius); - return message; - }; - - /** - * Creates a plain object from a PlayerDownsyncMeta message. Also converts values to other types if specified. - * @function toObject - * @memberof protos.PlayerDownsyncMeta - * @static - * @param {protos.PlayerDownsyncMeta} message PlayerDownsyncMeta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PlayerDownsyncMeta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = 0; - object.name = ""; - object.displayName = ""; - object.avatar = ""; - object.joinIndex = 0; - object.colliderRadius = 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.avatar != null && message.hasOwnProperty("avatar")) - object.avatar = message.avatar; - if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) - object.joinIndex = message.joinIndex; - if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius")) - object.colliderRadius = options.json && !isFinite(message.colliderRadius) ? String(message.colliderRadius) : message.colliderRadius; - return object; - }; - - /** - * Converts this PlayerDownsyncMeta to JSON. - * @function toJSON - * @memberof protos.PlayerDownsyncMeta - * @instance - * @returns {Object.} JSON object - */ - PlayerDownsyncMeta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PlayerDownsyncMeta; - })(); - protos.InputFrameDecoded = (function() { /** @@ -2622,11 +2590,11 @@ $root.protos = (function() { InputFrameDecoded.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dx != null && message.hasOwnProperty("dx")) + if (message.dx != null && Object.hasOwnProperty.call(message, "dx")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dx); - if (message.dy != null && message.hasOwnProperty("dy")) + if (message.dy != null && Object.hasOwnProperty.call(message, "dy")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dy); - if (message.btnALevel != null && message.hasOwnProperty("btnALevel")) + if (message.btnALevel != null && Object.hasOwnProperty.call(message, "btnALevel")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.btnALevel); return writer; }; @@ -2662,15 +2630,18 @@ $root.protos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.dx = reader.int32(); - break; - case 2: - message.dy = reader.int32(); - break; - case 3: - message.btnALevel = reader.int32(); - break; + case 1: { + message.dx = reader.int32(); + break; + } + case 2: { + message.dy = reader.int32(); + break; + } + case 3: { + message.btnALevel = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2777,6 +2748,21 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InputFrameDecoded + * @function getTypeUrl + * @memberof protos.InputFrameDecoded + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputFrameDecoded.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.InputFrameDecoded"; + }; + return InputFrameDecoded; })(); @@ -2845,9 +2831,9 @@ $root.protos = (function() { InputFrameUpsync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputFrameId != null && message.hasOwnProperty("inputFrameId")) + if (message.inputFrameId != null && Object.hasOwnProperty.call(message, "inputFrameId")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputFrameId); - if (message.encoded != null && message.hasOwnProperty("encoded")) + if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded")) writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.encoded); return writer; }; @@ -2883,12 +2869,14 @@ $root.protos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.inputFrameId = reader.int32(); - break; - case 2: - message.encoded = reader.uint64(); - break; + case 1: { + message.inputFrameId = reader.int32(); + break; + } + case 2: { + message.encoded = reader.uint64(); + break; + } default: reader.skipType(tag & 7); break; @@ -3001,6 +2989,21 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InputFrameUpsync + * @function getTypeUrl + * @memberof protos.InputFrameUpsync + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputFrameUpsync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.InputFrameUpsync"; + }; + return InputFrameUpsync; })(); @@ -3079,7 +3082,7 @@ $root.protos = (function() { InputFrameDownsync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputFrameId != null && message.hasOwnProperty("inputFrameId")) + if (message.inputFrameId != null && Object.hasOwnProperty.call(message, "inputFrameId")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputFrameId); if (message.inputList != null && message.inputList.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); @@ -3087,7 +3090,7 @@ $root.protos = (function() { writer.uint64(message.inputList[i]); writer.ldelim(); } - if (message.confirmedList != null && message.hasOwnProperty("confirmedList")) + if (message.confirmedList != null && Object.hasOwnProperty.call(message, "confirmedList")) writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.confirmedList); return writer; }; @@ -3123,22 +3126,25 @@ $root.protos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.inputFrameId = reader.int32(); - break; - case 2: - if (!(message.inputList && message.inputList.length)) - message.inputList = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.inputFrameId = reader.int32(); + break; + } + case 2: { + if (!(message.inputList && message.inputList.length)) + message.inputList = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.inputList.push(reader.uint64()); + } else message.inputList.push(reader.uint64()); - } else - message.inputList.push(reader.uint64()); - break; - case 3: - message.confirmedList = reader.uint64(); - break; + break; + } + case 3: { + message.confirmedList = reader.uint64(); + break; + } default: reader.skipType(tag & 7); break; @@ -3282,6 +3288,21 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for InputFrameDownsync + * @function getTypeUrl + * @memberof protos.InputFrameDownsync + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputFrameDownsync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.InputFrameDownsync"; + }; + return InputFrameDownsync; })(); @@ -3341,7 +3362,7 @@ $root.protos = (function() { HeartbeatUpsync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.clientTimestamp != null && message.hasOwnProperty("clientTimestamp")) + if (message.clientTimestamp != null && Object.hasOwnProperty.call(message, "clientTimestamp")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.clientTimestamp); return writer; }; @@ -3377,9 +3398,10 @@ $root.protos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.clientTimestamp = reader.int64(); - break; + case 1: { + message.clientTimestamp = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -3483,6 +3505,21 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for HeartbeatUpsync + * @function getTypeUrl + * @memberof protos.HeartbeatUpsync + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeartbeatUpsync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.HeartbeatUpsync"; + }; + return HeartbeatUpsync; })(); @@ -3495,7 +3532,6 @@ $root.protos = (function() { * @property {number|null} [id] RoomDownsyncFrame id * @property {Object.|null} [players] RoomDownsyncFrame players * @property {number|Long|null} [countdownNanos] RoomDownsyncFrame countdownNanos - * @property {Object.|null} [playerMetas] RoomDownsyncFrame playerMetas */ /** @@ -3508,7 +3544,6 @@ $root.protos = (function() { */ function RoomDownsyncFrame(properties) { this.players = {}; - this.playerMetas = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3539,14 +3574,6 @@ $root.protos = (function() { */ RoomDownsyncFrame.prototype.countdownNanos = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * RoomDownsyncFrame playerMetas. - * @member {Object.} playerMetas - * @memberof protos.RoomDownsyncFrame - * @instance - */ - RoomDownsyncFrame.prototype.playerMetas = $util.emptyObject; - /** * Creates a new RoomDownsyncFrame instance using the specified properties. * @function create @@ -3571,20 +3598,15 @@ $root.protos = (function() { RoomDownsyncFrame.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && message.hasOwnProperty("id")) + if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.players != null && message.hasOwnProperty("players")) + if (message.players != null && Object.hasOwnProperty.call(message, "players")) for (var keys = Object.keys(message.players), i = 0; i < keys.length; ++i) { writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); $root.protos.PlayerDownsync.encode(message.players[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.countdownNanos != null && message.hasOwnProperty("countdownNanos")) + if (message.countdownNanos != null && Object.hasOwnProperty.call(message, "countdownNanos")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.countdownNanos); - if (message.playerMetas != null && message.hasOwnProperty("playerMetas")) - for (var keys = Object.keys(message.playerMetas), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.protos.PlayerDownsyncMeta.encode(message.playerMetas[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } return writer; }; @@ -3615,32 +3637,41 @@ $root.protos = (function() { RoomDownsyncFrame.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.RoomDownsyncFrame(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.RoomDownsyncFrame(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.id = reader.int32(); - break; - case 2: - reader.skip().pos++; - if (message.players === $util.emptyObject) - message.players = {}; - key = reader.int32(); - reader.pos++; - message.players[key] = $root.protos.PlayerDownsync.decode(reader, reader.uint32()); - break; - case 3: - message.countdownNanos = reader.int64(); - break; - case 4: - reader.skip().pos++; - if (message.playerMetas === $util.emptyObject) - message.playerMetas = {}; - key = reader.int32(); - reader.pos++; - message.playerMetas[key] = $root.protos.PlayerDownsyncMeta.decode(reader, reader.uint32()); - break; + case 1: { + message.id = reader.int32(); + break; + } + case 2: { + if (message.players === $util.emptyObject) + message.players = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.int32(); + break; + case 2: + value = $root.protos.PlayerDownsync.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.players[key] = value; + break; + } + case 3: { + message.countdownNanos = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -3696,20 +3727,6 @@ $root.protos = (function() { if (message.countdownNanos != null && message.hasOwnProperty("countdownNanos")) if (!$util.isInteger(message.countdownNanos) && !(message.countdownNanos && $util.isInteger(message.countdownNanos.low) && $util.isInteger(message.countdownNanos.high))) return "countdownNanos: integer|Long expected"; - if (message.playerMetas != null && message.hasOwnProperty("playerMetas")) { - if (!$util.isObject(message.playerMetas)) - return "playerMetas: object expected"; - var key = Object.keys(message.playerMetas); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "playerMetas: integer key{k:int32} expected"; - { - var error = $root.protos.PlayerDownsyncMeta.verify(message.playerMetas[key[i]]); - if (error) - return "playerMetas." + error; - } - } - } return null; }; @@ -3746,16 +3763,6 @@ $root.protos = (function() { message.countdownNanos = object.countdownNanos; else if (typeof object.countdownNanos === "object") message.countdownNanos = new $util.LongBits(object.countdownNanos.low >>> 0, object.countdownNanos.high >>> 0).toNumber(); - if (object.playerMetas) { - if (typeof object.playerMetas !== "object") - throw TypeError(".protos.RoomDownsyncFrame.playerMetas: object expected"); - message.playerMetas = {}; - for (var keys = Object.keys(object.playerMetas), i = 0; i < keys.length; ++i) { - if (typeof object.playerMetas[keys[i]] !== "object") - throw TypeError(".protos.RoomDownsyncFrame.playerMetas: object expected"); - message.playerMetas[keys[i]] = $root.protos.PlayerDownsyncMeta.fromObject(object.playerMetas[keys[i]]); - } - } return message; }; @@ -3772,10 +3779,8 @@ $root.protos = (function() { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { + if (options.objects || options.defaults) object.players = {}; - object.playerMetas = {}; - } if (options.defaults) { object.id = 0; if ($util.Long) { @@ -3797,11 +3802,6 @@ $root.protos = (function() { object.countdownNanos = options.longs === String ? String(message.countdownNanos) : message.countdownNanos; else object.countdownNanos = options.longs === String ? $util.Long.prototype.toString.call(message.countdownNanos) : options.longs === Number ? new $util.LongBits(message.countdownNanos.low >>> 0, message.countdownNanos.high >>> 0).toNumber() : message.countdownNanos; - if (message.playerMetas && (keys2 = Object.keys(message.playerMetas)).length) { - object.playerMetas = {}; - for (var j = 0; j < keys2.length; ++j) - object.playerMetas[keys2[j]] = $root.protos.PlayerDownsyncMeta.toObject(message.playerMetas[keys2[j]], options); - } return object; }; @@ -3816,6 +3816,21 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RoomDownsyncFrame + * @function getTypeUrl + * @memberof protos.RoomDownsyncFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoomDownsyncFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.RoomDownsyncFrame"; + }; + return RoomDownsyncFrame; })(); @@ -3939,22 +3954,22 @@ $root.protos = (function() { WsReq.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.msgId != null && message.hasOwnProperty("msgId")) + if (message.msgId != null && Object.hasOwnProperty.call(message, "msgId")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.msgId); - if (message.playerId != null && message.hasOwnProperty("playerId")) + if (message.playerId != null && Object.hasOwnProperty.call(message, "playerId")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.playerId); - if (message.act != null && message.hasOwnProperty("act")) + if (message.act != null && Object.hasOwnProperty.call(message, "act")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.act); - if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) + if (message.joinIndex != null && Object.hasOwnProperty.call(message, "joinIndex")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.joinIndex); - if (message.ackingFrameId != null && message.hasOwnProperty("ackingFrameId")) + if (message.ackingFrameId != null && Object.hasOwnProperty.call(message, "ackingFrameId")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ackingFrameId); - if (message.ackingInputFrameId != null && message.hasOwnProperty("ackingInputFrameId")) + if (message.ackingInputFrameId != null && Object.hasOwnProperty.call(message, "ackingInputFrameId")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.ackingInputFrameId); if (message.inputFrameUpsyncBatch != null && message.inputFrameUpsyncBatch.length) for (var i = 0; i < message.inputFrameUpsyncBatch.length; ++i) $root.protos.InputFrameUpsync.encode(message.inputFrameUpsyncBatch[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.hb != null && message.hasOwnProperty("hb")) + if (message.hb != null && Object.hasOwnProperty.call(message, "hb")) $root.protos.HeartbeatUpsync.encode(message.hb, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -3990,32 +4005,40 @@ $root.protos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.msgId = reader.int32(); - break; - case 2: - message.playerId = reader.int32(); - break; - case 3: - message.act = reader.int32(); - break; - case 4: - message.joinIndex = reader.int32(); - break; - case 5: - message.ackingFrameId = reader.int32(); - break; - case 6: - message.ackingInputFrameId = reader.int32(); - break; - case 7: - if (!(message.inputFrameUpsyncBatch && message.inputFrameUpsyncBatch.length)) - message.inputFrameUpsyncBatch = []; - message.inputFrameUpsyncBatch.push($root.protos.InputFrameUpsync.decode(reader, reader.uint32())); - break; - case 8: - message.hb = $root.protos.HeartbeatUpsync.decode(reader, reader.uint32()); - break; + case 1: { + message.msgId = reader.int32(); + break; + } + case 2: { + message.playerId = reader.int32(); + break; + } + case 3: { + message.act = reader.int32(); + break; + } + case 4: { + message.joinIndex = reader.int32(); + break; + } + case 5: { + message.ackingFrameId = reader.int32(); + break; + } + case 6: { + message.ackingInputFrameId = reader.int32(); + break; + } + case 7: { + if (!(message.inputFrameUpsyncBatch && message.inputFrameUpsyncBatch.length)) + message.inputFrameUpsyncBatch = []; + message.inputFrameUpsyncBatch.push($root.protos.InputFrameUpsync.decode(reader, reader.uint32())); + break; + } + case 8: { + message.hb = $root.protos.HeartbeatUpsync.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4185,6 +4208,21 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WsReq + * @function getTypeUrl + * @memberof protos.WsReq + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WsReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.WsReq"; + }; + return WsReq; })(); @@ -4290,18 +4328,18 @@ $root.protos = (function() { WsResp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ret != null && message.hasOwnProperty("ret")) + if (message.ret != null && Object.hasOwnProperty.call(message, "ret")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ret); - if (message.echoedMsgId != null && message.hasOwnProperty("echoedMsgId")) + if (message.echoedMsgId != null && Object.hasOwnProperty.call(message, "echoedMsgId")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.echoedMsgId); - if (message.act != null && message.hasOwnProperty("act")) + if (message.act != null && Object.hasOwnProperty.call(message, "act")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.act); - if (message.rdf != null && message.hasOwnProperty("rdf")) + if (message.rdf != null && Object.hasOwnProperty.call(message, "rdf")) $root.protos.RoomDownsyncFrame.encode(message.rdf, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.inputFrameDownsyncBatch != null && message.inputFrameDownsyncBatch.length) for (var i = 0; i < message.inputFrameDownsyncBatch.length; ++i) $root.protos.InputFrameDownsync.encode(message.inputFrameDownsyncBatch[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.bciFrame != null && message.hasOwnProperty("bciFrame")) + if (message.bciFrame != null && Object.hasOwnProperty.call(message, "bciFrame")) $root.protos.BattleColliderInfo.encode(message.bciFrame, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -4337,26 +4375,32 @@ $root.protos = (function() { while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.ret = reader.int32(); - break; - case 2: - message.echoedMsgId = reader.int32(); - break; - case 3: - message.act = reader.int32(); - break; - case 4: - message.rdf = $root.protos.RoomDownsyncFrame.decode(reader, reader.uint32()); - break; - case 5: - if (!(message.inputFrameDownsyncBatch && message.inputFrameDownsyncBatch.length)) - message.inputFrameDownsyncBatch = []; - message.inputFrameDownsyncBatch.push($root.protos.InputFrameDownsync.decode(reader, reader.uint32())); - break; - case 6: - message.bciFrame = $root.protos.BattleColliderInfo.decode(reader, reader.uint32()); - break; + case 1: { + message.ret = reader.int32(); + break; + } + case 2: { + message.echoedMsgId = reader.int32(); + break; + } + case 3: { + message.act = reader.int32(); + break; + } + case 4: { + message.rdf = $root.protos.RoomDownsyncFrame.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.inputFrameDownsyncBatch && message.inputFrameDownsyncBatch.length)) + message.inputFrameDownsyncBatch = []; + message.inputFrameDownsyncBatch.push($root.protos.InputFrameDownsync.decode(reader, reader.uint32())); + break; + } + case 6: { + message.bciFrame = $root.protos.BattleColliderInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4515,6 +4559,21 @@ $root.protos = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WsResp + * @function getTypeUrl + * @memberof protos.WsResp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WsResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/protos.WsResp"; + }; + return WsResp; })();