Simplified backend config loading.

This commit is contained in:
genxium 2022-11-21 17:27:32 +08:00
parent 2dbc529978
commit 360f2fc22b
14 changed files with 1070 additions and 1086 deletions

View File

@ -5,6 +5,7 @@ import (
. "battle_srv/common" . "battle_srv/common"
"battle_srv/common/utils" "battle_srv/common/utils"
"battle_srv/models" "battle_srv/models"
. "battle_srv/protos"
"battle_srv/storage" "battle_srv/storage"
"bytes" "bytes"
"crypto/sha256" "crypto/sha256"
@ -526,8 +527,10 @@ func (p *playerController) maybeCreatePlayerWechatAuthBinding(userInfo utils.Use
} }
if player != nil { if player != nil {
updateInfo := models.Player{ updateInfo := models.Player{
PlayerDownsync: PlayerDownsync{
Avatar: userInfo.HeadImgURL, Avatar: userInfo.HeadImgURL,
DisplayName: userInfo.Nickname, DisplayName: userInfo.Nickname,
},
} }
tx := storage.MySQLManagerIns.MustBegin() tx := storage.MySQLManagerIns.MustBegin()
defer tx.Rollback() defer tx.Rollback()
@ -542,10 +545,12 @@ func (p *playerController) maybeCreatePlayerWechatAuthBinding(userInfo utils.Use
} }
now := utils.UnixtimeMilli() now := utils.UnixtimeMilli()
player := models.Player{ player := models.Player{
CreatedAt: now, PlayerDownsync: PlayerDownsync{
UpdatedAt: now,
DisplayName: userInfo.Nickname, DisplayName: userInfo.Nickname,
Avatar: userInfo.HeadImgURL, Avatar: userInfo.HeadImgURL,
},
CreatedAt: now,
UpdatedAt: now,
} }
return p.createNewPlayer(player, userInfo.OpenID, int(Constants.AuthChannel.Wechat)) return p.createNewPlayer(player, userInfo.OpenID, int(Constants.AuthChannel.Wechat))
} }
@ -562,8 +567,10 @@ func (p *playerController) maybeCreatePlayerWechatGameAuthBinding(userInfo utils
} }
if player != nil { if player != nil {
updateInfo := models.Player{ updateInfo := models.Player{
PlayerDownsync: PlayerDownsync{
Avatar: userInfo.HeadImgURL, Avatar: userInfo.HeadImgURL,
DisplayName: userInfo.Nickname, DisplayName: userInfo.Nickname,
},
} }
tx := storage.MySQLManagerIns.MustBegin() tx := storage.MySQLManagerIns.MustBegin()
defer tx.Rollback() defer tx.Rollback()
@ -578,10 +585,12 @@ func (p *playerController) maybeCreatePlayerWechatGameAuthBinding(userInfo utils
} }
now := utils.UnixtimeMilli() now := utils.UnixtimeMilli()
player := models.Player{ player := models.Player{
CreatedAt: now, PlayerDownsync: PlayerDownsync{
UpdatedAt: now,
DisplayName: userInfo.Nickname, DisplayName: userInfo.Nickname,
Avatar: userInfo.HeadImgURL, Avatar: userInfo.HeadImgURL,
},
CreatedAt: now,
UpdatedAt: now,
} }
return p.createNewPlayer(player, userInfo.OpenID, int(Constants.AuthChannel.WechatGame)) return p.createNewPlayer(player, userInfo.OpenID, int(Constants.AuthChannel.WechatGame))
} }

View File

@ -4,6 +4,7 @@ import (
. "battle_srv/common" . "battle_srv/common"
"battle_srv/common/utils" "battle_srv/common/utils"
"battle_srv/models" "battle_srv/models"
. "battle_srv/protos"
"battle_srv/storage" "battle_srv/storage"
. "dnmshared" . "dnmshared"
sq "github.com/Masterminds/squirrel" 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) { func maybeCreateNewPlayerFromBotTable(db *sqlx.DB, tableName string) {
var ls []*dbBotPlayer var ls []*dbBotPlayer
err := db.Select(&ls, "SELECT name, magic_phone_country_code, magic_phone_num, display_name FROM "+tableName) 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) panic(err)
} }
query = storage.MySQLManagerIns.Rebind(query) query = storage.MySQLManagerIns.Rebind(query)
// existNames := make([]string, len(ls), len(ls))
var existPlayers []*models.Player var existPlayers []*models.Player
err = storage.MySQLManagerIns.Select(&existPlayers, query, args...) err = storage.MySQLManagerIns.Select(&existPlayers, query, args...)
if nil != err { if nil != err {
@ -99,13 +98,11 @@ func maybeCreateNewPlayerFromBotTable(db *sqlx.DB, tableName string) {
var flag bool var flag bool
for _, v := range existPlayers { for _, v := range existPlayers {
if botPlayer.Name == v.Name { if botPlayer.Name == v.Name {
// 已有数据,合并处理
flag = true flag = true
break break
} }
} }
if !flag { if !flag {
// 找不到,新增
Logger.Debug("create", zap.Any(tableName, botPlayer)) Logger.Debug("create", zap.Any(tableName, botPlayer))
err := createNewBotPlayer(botPlayer) err := createNewBotPlayer(botPlayer)
if err != nil { if err != nil {
@ -122,9 +119,12 @@ func createNewBotPlayer(p *dbBotPlayer) error {
player := models.Player{ player := models.Player{
CreatedAt: now, CreatedAt: now,
UpdatedAt: now, UpdatedAt: now,
PlayerDownsync: PlayerDownsync{
Name: p.Name, Name: p.Name,
DisplayName: p.DisplayName, DisplayName: p.DisplayName,
},
} }
err := player.Insert(tx) err := player.Insert(tx)
if err != nil { if err != nil {
return err return err

View File

@ -4,6 +4,7 @@ import (
. "battle_srv/common" . "battle_srv/common"
"battle_srv/common/utils" "battle_srv/common/utils"
"battle_srv/models" "battle_srv/models"
. "battle_srv/protos"
"battle_srv/storage" "battle_srv/storage"
. "dnmshared" . "dnmshared"
@ -75,9 +76,11 @@ func createNewPlayer(p *dbTestPlayer) error {
defer tx.Rollback() defer tx.Rollback()
now := utils.UnixtimeMilli() now := utils.UnixtimeMilli()
player := models.Player{ player := models.Player{
PlayerDownsync: PlayerDownsync{
Name: p.Name,
},
CreatedAt: now, CreatedAt: now,
UpdatedAt: now, UpdatedAt: now,
Name: p.Name,
} }
err := player.Insert(tx) err := player.Insert(tx)
if err != nil { if err != nil {

View File

@ -5,7 +5,7 @@ import (
. "dnmshared/sharedprotos" . "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) toRet := make(map[int32]*PlayerDownsync, 0)
if nil == modelInstances { if nil == modelInstances {
return toRet return toRet
@ -20,12 +20,18 @@ func toPbPlayers(modelInstances map[int32]*Player) map[int32]*PlayerDownsync {
Dx: last.Dir.Dx, Dx: last.Dir.Dx,
Dy: last.Dir.Dy, Dy: last.Dir.Dy,
}, },
ColliderRadius: last.ColliderRadius,
Speed: last.Speed, Speed: last.Speed,
BattleState: last.BattleState, BattleState: last.BattleState,
Score: last.Score, Score: last.Score,
Removed: last.Removed, Removed: last.Removed,
JoinIndex: last.JoinIndex, JoinIndex: last.JoinIndex,
} }
if withMetaInfo {
toRet[k].Name = last.Name
toRet[k].DisplayName = last.DisplayName
toRet[k].Avatar = last.Avatar
}
} }
return toRet return toRet

View File

@ -1,11 +1,14 @@
package models package models
import ( import (
"database/sql" . "battle_srv/protos"
"battle_srv/storage"
. "dnmshared"
. "dnmshared/sharedprotos" . "dnmshared/sharedprotos"
"fmt" "fmt"
sq "github.com/Masterminds/squirrel" sq "github.com/Masterminds/squirrel"
"github.com/jmoiron/sqlx" "github.com/jmoiron/sqlx"
"go.uber.org/zap"
) )
type PlayerBattleState struct { type PlayerBattleState struct {
@ -33,12 +36,7 @@ func InitPlayerBattleStateIns() {
} }
type Player struct { type Player struct {
// Meta info fields PlayerDownsync
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:"-"`
// DB only fields // DB only fields
CreatedAt int64 `db:"created_at"` CreatedAt int64 `db:"created_at"`
@ -46,19 +44,10 @@ type Player struct {
DeletedAt NullInt64 `db:"deleted_at"` DeletedAt NullInt64 `db:"deleted_at"`
TutorialStage int `db:"tutorial_stage"` TutorialStage int `db:"tutorial_stage"`
// in-battle info fields // other in-battle info fields
VirtualGridX int32 LastSentInputFrameId int32
VirtualGridY int32
Dir *Direction
Speed int32
BattleState int32
LastMoveGmtMillis int32
Score int32
Removed bool
JoinIndex int32
AckingFrameId int32 AckingFrameId int32
AckingInputFrameId int32 AckingInputFrameId int32
LastSentInputFrameId int32
} }
func ExistPlayerByName(name string) (bool, error) { func ExistPlayerByName(name string) (bool, error) {
@ -74,15 +63,48 @@ func GetPlayerById(id int) (*Player, error) {
} }
func getPlayer(cond sq.Eq) (*Player, error) { func getPlayer(cond sq.Eq) (*Player, error) {
var p Player p := Player{}
err := getObj("player", cond, &p) pd := PlayerDownsync{
if err == sql.ErrNoRows { Dir: &Direction{
return nil, nil
}
p.Dir = &Direction{
Dx: 0, Dx: 0,
Dy: 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 return &p, nil
} }
@ -113,8 +135,6 @@ func Update(tx *sqlx.Tx, id int32, p *Player) (bool, error) {
} }
result, err := tx.Exec(query, args...) result, err := tx.Exec(query, args...)
if err != nil { if err != nil {
fmt.Println("ERRRRRRR: ")
fmt.Println(err)
return false, err return false, err
} }
rowsAffected, err := result.RowsAffected() rowsAffected, err := result.RowsAffected()

View File

@ -10,6 +10,17 @@ import (
"go.uber.org/zap" "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) { func exist(t string, cond sq.Eq) (bool, error) {
c, err := getCount(t, cond) c, err := getCount(t, cond)
if err != nil { if err != nil {

View File

@ -375,7 +375,7 @@ func (pR *Room) StartBattle() {
pR.CurDynamicsRenderFrameId = 0 pR.CurDynamicsRenderFrameId = 0
kickoffFrame := &RoomDownsyncFrame{ kickoffFrame := &RoomDownsyncFrame{
Id: pR.RenderFrameId, Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players), Players: toPbPlayers(pR.Players, false),
CountdownNanos: pR.BattleDurationNanos, CountdownNanos: pR.BattleDurationNanos,
} }
pR.RenderFrameBuffer.Put(kickoffFrame) pR.RenderFrameBuffer.Put(kickoffFrame)
@ -669,7 +669,7 @@ func (pR *Room) StopBattleForSettlement() {
for playerId, _ := range pR.Players { for playerId, _ := range pR.Players {
assembledFrame := RoomDownsyncFrame{ assembledFrame := RoomDownsyncFrame{
Id: pR.RenderFrameId, Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players), Players: toPbPlayers(pR.Players, false),
CountdownNanos: -1, // TODO: Replace this magic constant! CountdownNanos: -1, // TODO: Replace this magic constant!
} }
pR.sendSafely(&assembledFrame, nil, DOWNSYNC_MSG_ACT_BATTLE_STOPPED, playerId) pR.sendSafely(&assembledFrame, nil, DOWNSYNC_MSG_ACT_BATTLE_STOPPED, playerId)
@ -693,22 +693,9 @@ func (pR *Room) onBattlePrepare(cb BattleStartCbType) {
pR.State = RoomBattleStateIns.PREPARE pR.State = RoomBattleStateIns.PREPARE
Logger.Info("Battle state transitted to RoomBattleStateIns.PREPARE for:", zap.Any("roomId", pR.Id)) 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{ battleReadyToStartFrame := &RoomDownsyncFrame{
Id: DOWNSYNC_MSG_ACT_BATTLE_READY_TO_START, Id: DOWNSYNC_MSG_ACT_BATTLE_READY_TO_START,
Players: toPbPlayers(pR.Players), Players: toPbPlayers(pR.Players, true),
PlayerMetas: playerMetas,
CountdownNanos: pR.BattleDurationNanos, CountdownNanos: pR.BattleDurationNanos,
} }
@ -954,18 +941,6 @@ func (pR *Room) OnPlayerBattleColliderAcked(playerId int32) bool {
return false 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 // Broadcast added or readded player info to all players in the same room
for _, eachPlayer := range pR.Players { for _, eachPlayer := range pR.Players {
/* /*
@ -980,15 +955,13 @@ func (pR *Room) OnPlayerBattleColliderAcked(playerId int32) bool {
case PlayerBattleStateIns.ADDED_PENDING_BATTLE_COLLIDER_ACK: case PlayerBattleStateIns.ADDED_PENDING_BATTLE_COLLIDER_ACK:
playerAckedFrame := &RoomDownsyncFrame{ playerAckedFrame := &RoomDownsyncFrame{
Id: pR.RenderFrameId, Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players), Players: toPbPlayers(pR.Players, true),
PlayerMetas: playerMetas,
} }
pR.sendSafely(playerAckedFrame, nil, DOWNSYNC_MSG_ACT_PLAYER_ADDED_AND_ACKED, eachPlayer.Id) pR.sendSafely(playerAckedFrame, nil, DOWNSYNC_MSG_ACT_PLAYER_ADDED_AND_ACKED, eachPlayer.Id)
case PlayerBattleStateIns.READDED_PENDING_BATTLE_COLLIDER_ACK: case PlayerBattleStateIns.READDED_PENDING_BATTLE_COLLIDER_ACK:
playerAckedFrame := &RoomDownsyncFrame{ playerAckedFrame := &RoomDownsyncFrame{
Id: pR.RenderFrameId, Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players), Players: toPbPlayers(pR.Players, true),
PlayerMetas: playerMetas,
} }
pR.sendSafely(playerAckedFrame, nil, DOWNSYNC_MSG_ACT_PLAYER_READDED_AND_ACKED, eachPlayer.Id) pR.sendSafely(playerAckedFrame, nil, DOWNSYNC_MSG_ACT_PLAYER_READDED_AND_ACKED, eachPlayer.Id)
default: default:
@ -1229,10 +1202,11 @@ func (pR *Room) applyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputF
// Update in the collision system // Update in the collision system
playerCollider.Update() playerCollider.Update()
if 0 != decodedInput.Dx || 0 != decodedInput.Dy {
nextRenderFramePlayers[playerId].Dir.Dx = decodedInput.Dx nextRenderFramePlayers[playerId].Dir.Dx = decodedInput.Dx
nextRenderFramePlayers[playerId].Dir.Dy = decodedInput.Dy nextRenderFramePlayers[playerId].Dir.Dy = decodedInput.Dy
} }
}
// handle pushbacks upon collision after all movements treated as simultaneous // handle pushbacks upon collision after all movements treated as simultaneous
for _, player := range pR.Players { for _, player := range pR.Players {

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.28.1 // protoc-gen-go v1.28.1
// protoc v3.7.1 // protoc v3.21.4
// source: room_downsync_frame.proto // source: room_downsync_frame.proto
package protos package protos
@ -255,10 +255,14 @@ type PlayerDownsync struct {
Dir *sharedprotos.Direction `protobuf:"bytes,4,opt,name=dir,proto3" json:"dir,omitempty"` 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 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"` 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"` Score int32 `protobuf:"varint,10,opt,name=score,proto3" json:"score,omitempty"`
Removed bool `protobuf:"varint,11,opt,name=removed,proto3" json:"removed,omitempty"` LastMoveGmtMillis int32 `protobuf:"varint,11,opt,name=lastMoveGmtMillis,proto3" json:"lastMoveGmtMillis,omitempty"`
JoinIndex int32 `protobuf:"varint,12,opt,name=joinIndex,proto3" json:"joinIndex,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() { func (x *PlayerDownsync) Reset() {
@ -335,16 +339,16 @@ func (x *PlayerDownsync) GetBattleState() int32 {
return 0 return 0
} }
func (x *PlayerDownsync) GetLastMoveGmtMillis() int32 { func (x *PlayerDownsync) GetJoinIndex() int32 {
if x != nil { if x != nil {
return x.LastMoveGmtMillis return x.JoinIndex
} }
return 0 return 0
} }
func (x *PlayerDownsync) GetScore() int32 { func (x *PlayerDownsync) GetColliderRadius() float64 {
if x != nil { if x != nil {
return x.Score return x.ColliderRadius
} }
return 0 return 0
} }
@ -356,100 +360,41 @@ func (x *PlayerDownsync) GetRemoved() bool {
return false return false
} }
func (x *PlayerDownsync) GetJoinIndex() int32 { func (x *PlayerDownsync) GetScore() int32 {
if x != nil { if x != nil {
return x.JoinIndex return x.Score
} }
return 0 return 0
} }
type PlayerDownsyncMeta struct { func (x *PlayerDownsync) GetLastMoveGmtMillis() int32 {
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 {
if x != nil { if x != nil {
return x.Id return x.LastMoveGmtMillis
} }
return 0 return 0
} }
func (x *PlayerDownsyncMeta) GetName() string { func (x *PlayerDownsync) GetName() string {
if x != nil { if x != nil {
return x.Name return x.Name
} }
return "" return ""
} }
func (x *PlayerDownsyncMeta) GetDisplayName() string { func (x *PlayerDownsync) GetDisplayName() string {
if x != nil { if x != nil {
return x.DisplayName return x.DisplayName
} }
return "" return ""
} }
func (x *PlayerDownsyncMeta) GetAvatar() string { func (x *PlayerDownsync) GetAvatar() string {
if x != nil { if x != nil {
return x.Avatar return x.Avatar
} }
return "" 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 { type InputFrameDecoded struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -463,7 +408,7 @@ type InputFrameDecoded struct {
func (x *InputFrameDecoded) Reset() { func (x *InputFrameDecoded) Reset() {
*x = InputFrameDecoded{} *x = InputFrameDecoded{}
if protoimpl.UnsafeEnabled { 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 := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -476,7 +421,7 @@ func (x *InputFrameDecoded) String() string {
func (*InputFrameDecoded) ProtoMessage() {} func (*InputFrameDecoded) ProtoMessage() {}
func (x *InputFrameDecoded) ProtoReflect() protoreflect.Message { 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 { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -489,7 +434,7 @@ func (x *InputFrameDecoded) ProtoReflect() protoreflect.Message {
// Deprecated: Use InputFrameDecoded.ProtoReflect.Descriptor instead. // Deprecated: Use InputFrameDecoded.ProtoReflect.Descriptor instead.
func (*InputFrameDecoded) Descriptor() ([]byte, []int) { 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 { func (x *InputFrameDecoded) GetDx() int32 {
@ -525,7 +470,7 @@ type InputFrameUpsync struct {
func (x *InputFrameUpsync) Reset() { func (x *InputFrameUpsync) Reset() {
*x = InputFrameUpsync{} *x = InputFrameUpsync{}
if protoimpl.UnsafeEnabled { 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 := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -538,7 +483,7 @@ func (x *InputFrameUpsync) String() string {
func (*InputFrameUpsync) ProtoMessage() {} func (*InputFrameUpsync) ProtoMessage() {}
func (x *InputFrameUpsync) ProtoReflect() protoreflect.Message { 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 { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -551,7 +496,7 @@ func (x *InputFrameUpsync) ProtoReflect() protoreflect.Message {
// Deprecated: Use InputFrameUpsync.ProtoReflect.Descriptor instead. // Deprecated: Use InputFrameUpsync.ProtoReflect.Descriptor instead.
func (*InputFrameUpsync) Descriptor() ([]byte, []int) { 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 { func (x *InputFrameUpsync) GetInputFrameId() int32 {
@ -581,7 +526,7 @@ type InputFrameDownsync struct {
func (x *InputFrameDownsync) Reset() { func (x *InputFrameDownsync) Reset() {
*x = InputFrameDownsync{} *x = InputFrameDownsync{}
if protoimpl.UnsafeEnabled { 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 := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -594,7 +539,7 @@ func (x *InputFrameDownsync) String() string {
func (*InputFrameDownsync) ProtoMessage() {} func (*InputFrameDownsync) ProtoMessage() {}
func (x *InputFrameDownsync) ProtoReflect() protoreflect.Message { 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 { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -607,7 +552,7 @@ func (x *InputFrameDownsync) ProtoReflect() protoreflect.Message {
// Deprecated: Use InputFrameDownsync.ProtoReflect.Descriptor instead. // Deprecated: Use InputFrameDownsync.ProtoReflect.Descriptor instead.
func (*InputFrameDownsync) Descriptor() ([]byte, []int) { 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 { func (x *InputFrameDownsync) GetInputFrameId() int32 {
@ -642,7 +587,7 @@ type HeartbeatUpsync struct {
func (x *HeartbeatUpsync) Reset() { func (x *HeartbeatUpsync) Reset() {
*x = HeartbeatUpsync{} *x = HeartbeatUpsync{}
if protoimpl.UnsafeEnabled { 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 := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -655,7 +600,7 @@ func (x *HeartbeatUpsync) String() string {
func (*HeartbeatUpsync) ProtoMessage() {} func (*HeartbeatUpsync) ProtoMessage() {}
func (x *HeartbeatUpsync) ProtoReflect() protoreflect.Message { 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 { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -668,7 +613,7 @@ func (x *HeartbeatUpsync) ProtoReflect() protoreflect.Message {
// Deprecated: Use HeartbeatUpsync.ProtoReflect.Descriptor instead. // Deprecated: Use HeartbeatUpsync.ProtoReflect.Descriptor instead.
func (*HeartbeatUpsync) Descriptor() ([]byte, []int) { 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 { func (x *HeartbeatUpsync) GetClientTimestamp() int64 {
@ -686,13 +631,12 @@ type RoomDownsyncFrame struct {
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` 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"` 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"` 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"`
} }
func (x *RoomDownsyncFrame) Reset() { func (x *RoomDownsyncFrame) Reset() {
*x = RoomDownsyncFrame{} *x = RoomDownsyncFrame{}
if protoimpl.UnsafeEnabled { 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 := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -705,7 +649,7 @@ func (x *RoomDownsyncFrame) String() string {
func (*RoomDownsyncFrame) ProtoMessage() {} func (*RoomDownsyncFrame) ProtoMessage() {}
func (x *RoomDownsyncFrame) ProtoReflect() protoreflect.Message { 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 { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -718,7 +662,7 @@ func (x *RoomDownsyncFrame) ProtoReflect() protoreflect.Message {
// Deprecated: Use RoomDownsyncFrame.ProtoReflect.Descriptor instead. // Deprecated: Use RoomDownsyncFrame.ProtoReflect.Descriptor instead.
func (*RoomDownsyncFrame) Descriptor() ([]byte, []int) { 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 { func (x *RoomDownsyncFrame) GetId() int32 {
@ -742,13 +686,6 @@ func (x *RoomDownsyncFrame) GetCountdownNanos() int64 {
return 0 return 0
} }
func (x *RoomDownsyncFrame) GetPlayerMetas() map[int32]*PlayerDownsyncMeta {
if x != nil {
return x.PlayerMetas
}
return nil
}
type WsReq struct { type WsReq struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -767,7 +704,7 @@ type WsReq struct {
func (x *WsReq) Reset() { func (x *WsReq) Reset() {
*x = WsReq{} *x = WsReq{}
if protoimpl.UnsafeEnabled { 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 := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -780,7 +717,7 @@ func (x *WsReq) String() string {
func (*WsReq) ProtoMessage() {} func (*WsReq) ProtoMessage() {}
func (x *WsReq) ProtoReflect() protoreflect.Message { 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 { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -793,7 +730,7 @@ func (x *WsReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use WsReq.ProtoReflect.Descriptor instead. // Deprecated: Use WsReq.ProtoReflect.Descriptor instead.
func (*WsReq) Descriptor() ([]byte, []int) { 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 { func (x *WsReq) GetMsgId() int32 {
@ -868,7 +805,7 @@ type WsResp struct {
func (x *WsResp) Reset() { func (x *WsResp) Reset() {
*x = WsResp{} *x = WsResp{}
if protoimpl.UnsafeEnabled { 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 := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -881,7 +818,7 @@ func (x *WsResp) String() string {
func (*WsResp) ProtoMessage() {} func (*WsResp) ProtoMessage() {}
func (x *WsResp) ProtoReflect() protoreflect.Message { 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 { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -894,7 +831,7 @@ func (x *WsResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use WsResp.ProtoReflect.Descriptor instead. // Deprecated: Use WsResp.ProtoReflect.Descriptor instead.
func (*WsResp) Descriptor() ([]byte, []int) { 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 { 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e,
0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49,
0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72,
0x6c, 0x6c, 0x69, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x63, 0x6f,
0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07,
0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72,
0x6f, 0x76, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18,
0x78, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x11,
0x65, 0x78, 0x22, 0xb8, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69,
0x6e, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20,
0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20,
0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65,
0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09,
0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x51, 0x0a, 0x11, 0x49, 0x6e, 0x70, 0x75,
0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x0e, 0x0a,
0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x02, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x78, 0x12, 0x0e, 0x0a,
0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x63, 0x02, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x79, 0x12, 0x1c, 0x0a,
0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x22, 0x51, 0x0a, 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x11, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x52, 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x50, 0x0a, 0x10, 0x49,
0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x12,
0x64, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18,
0x64, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x02,
0x22, 0x50, 0x0a, 0x10, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x22, 0x7c, 0x0a,
0x73, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x12, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73,
0x6d, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d,
0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74,
0x64, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74,
0x65, 0x64, 0x22, 0x7c, 0x0a, 0x12, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75,
0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d,
0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x63, 0x6f,
0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x0f, 0x48,
0x69, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x28,
0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54,
0x04, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x52, 0x6f, 0x6f,
0x22, 0x3b, 0x0a, 0x0f, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x0e,
0x79, 0x6e, 0x63, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x40,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x8b, 0x03, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77,
0x0a, 0x11, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65,
0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73,
0x02, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64,
0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x1a, 0x52, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x79,
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x6c, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61,
0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x4c, 0x0a, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e,
0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x18, 0x04, 0x20, 0x03, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb8, 0x02, 0x0a,
0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x05, 0x57, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18,
0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08,
0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x1a, 0x52, 0x0a, 0x0c, 0x50, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x69,
0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
0x73, 0x79, 0x6e, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x2e,
0x5a, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x45, 0x6e, 0x0a, 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61,
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x63, 0x6b, 0x69,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x4e,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x0a, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79,
0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb8, 0x02, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d,
0x57, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x01, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x27,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x0a, 0x02, 0x68, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73,
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x79, 0x6e, 0x63, 0x52, 0x02, 0x68, 0x62, 0x22, 0x89, 0x02, 0x0a, 0x06, 0x57, 0x73, 0x52, 0x65,
0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x03, 0x72, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73,
0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x67, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65,
0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x64, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20,
0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x03, 0x72, 0x64, 0x66, 0x18,
0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52,
0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65,
0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x52, 0x03, 0x72, 0x64, 0x66, 0x12, 0x54, 0x0a, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72,
0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68,
0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e,
0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79,
0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x27, 0x0a, 0x6e, 0x63, 0x52, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f,
0x02, 0x68, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x36, 0x0a, 0x08, 0x62,
0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, 0x63, 0x69, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
0x6e, 0x63, 0x52, 0x02, 0x68, 0x62, 0x22, 0x89, 0x02, 0x0a, 0x06, 0x57, 0x73, 0x52, 0x65, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c,
0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72,
0x72, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x61, 0x6d, 0x65, 0x42, 0x13, 0x5a, 0x11, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x73, 0x72,
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
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 ( var (
@ -1165,46 +1087,42 @@ func file_room_downsync_frame_proto_rawDescGZIP() []byte {
return file_room_downsync_frame_proto_rawDescData 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{}{ var file_room_downsync_frame_proto_goTypes = []interface{}{
(*BattleColliderInfo)(nil), // 0: protos.BattleColliderInfo (*BattleColliderInfo)(nil), // 0: protos.BattleColliderInfo
(*PlayerDownsync)(nil), // 1: protos.PlayerDownsync (*PlayerDownsync)(nil), // 1: protos.PlayerDownsync
(*PlayerDownsyncMeta)(nil), // 2: protos.PlayerDownsyncMeta (*InputFrameDecoded)(nil), // 2: protos.InputFrameDecoded
(*InputFrameDecoded)(nil), // 3: protos.InputFrameDecoded (*InputFrameUpsync)(nil), // 3: protos.InputFrameUpsync
(*InputFrameUpsync)(nil), // 4: protos.InputFrameUpsync (*InputFrameDownsync)(nil), // 4: protos.InputFrameDownsync
(*InputFrameDownsync)(nil), // 5: protos.InputFrameDownsync (*HeartbeatUpsync)(nil), // 5: protos.HeartbeatUpsync
(*HeartbeatUpsync)(nil), // 6: protos.HeartbeatUpsync (*RoomDownsyncFrame)(nil), // 6: protos.RoomDownsyncFrame
(*RoomDownsyncFrame)(nil), // 7: protos.RoomDownsyncFrame (*WsReq)(nil), // 7: protos.WsReq
(*WsReq)(nil), // 8: protos.WsReq (*WsResp)(nil), // 8: protos.WsResp
(*WsResp)(nil), // 9: protos.WsResp nil, // 9: protos.BattleColliderInfo.StrToVec2DListMapEntry
nil, // 10: protos.BattleColliderInfo.StrToVec2DListMapEntry nil, // 10: protos.BattleColliderInfo.StrToPolygon2DListMapEntry
nil, // 11: protos.BattleColliderInfo.StrToPolygon2DListMapEntry nil, // 11: protos.RoomDownsyncFrame.PlayersEntry
nil, // 12: protos.RoomDownsyncFrame.PlayersEntry (*sharedprotos.Direction)(nil), // 12: sharedprotos.Direction
nil, // 13: protos.RoomDownsyncFrame.PlayerMetasEntry (*sharedprotos.Vec2DList)(nil), // 13: sharedprotos.Vec2DList
(*sharedprotos.Direction)(nil), // 14: sharedprotos.Direction (*sharedprotos.Polygon2DList)(nil), // 14: sharedprotos.Polygon2DList
(*sharedprotos.Vec2DList)(nil), // 15: sharedprotos.Vec2DList
(*sharedprotos.Polygon2DList)(nil), // 16: sharedprotos.Polygon2DList
} }
var file_room_downsync_frame_proto_depIdxs = []int32{ var file_room_downsync_frame_proto_depIdxs = []int32{
10, // 0: protos.BattleColliderInfo.strToVec2DListMap:type_name -> protos.BattleColliderInfo.StrToVec2DListMapEntry 9, // 0: protos.BattleColliderInfo.strToVec2DListMap:type_name -> protos.BattleColliderInfo.StrToVec2DListMapEntry
11, // 1: protos.BattleColliderInfo.strToPolygon2DListMap:type_name -> protos.BattleColliderInfo.StrToPolygon2DListMapEntry 10, // 1: protos.BattleColliderInfo.strToPolygon2DListMap:type_name -> protos.BattleColliderInfo.StrToPolygon2DListMapEntry
14, // 2: protos.PlayerDownsync.dir:type_name -> sharedprotos.Direction 12, // 2: protos.PlayerDownsync.dir:type_name -> sharedprotos.Direction
12, // 3: protos.RoomDownsyncFrame.players:type_name -> protos.RoomDownsyncFrame.PlayersEntry 11, // 3: protos.RoomDownsyncFrame.players:type_name -> protos.RoomDownsyncFrame.PlayersEntry
13, // 4: protos.RoomDownsyncFrame.playerMetas:type_name -> protos.RoomDownsyncFrame.PlayerMetasEntry 3, // 4: protos.WsReq.inputFrameUpsyncBatch:type_name -> protos.InputFrameUpsync
4, // 5: protos.WsReq.inputFrameUpsyncBatch:type_name -> protos.InputFrameUpsync 5, // 5: protos.WsReq.hb:type_name -> protos.HeartbeatUpsync
6, // 6: protos.WsReq.hb:type_name -> protos.HeartbeatUpsync 6, // 6: protos.WsResp.rdf:type_name -> protos.RoomDownsyncFrame
7, // 7: protos.WsResp.rdf:type_name -> protos.RoomDownsyncFrame 4, // 7: protos.WsResp.inputFrameDownsyncBatch:type_name -> protos.InputFrameDownsync
5, // 8: protos.WsResp.inputFrameDownsyncBatch:type_name -> protos.InputFrameDownsync 0, // 8: protos.WsResp.bciFrame:type_name -> protos.BattleColliderInfo
0, // 9: protos.WsResp.bciFrame:type_name -> protos.BattleColliderInfo 13, // 9: protos.BattleColliderInfo.StrToVec2DListMapEntry.value:type_name -> sharedprotos.Vec2DList
15, // 10: protos.BattleColliderInfo.StrToVec2DListMapEntry.value:type_name -> sharedprotos.Vec2DList 14, // 10: protos.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> sharedprotos.Polygon2DList
16, // 11: protos.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> sharedprotos.Polygon2DList 1, // 11: protos.RoomDownsyncFrame.PlayersEntry.value:type_name -> protos.PlayerDownsync
1, // 12: protos.RoomDownsyncFrame.PlayersEntry.value:type_name -> protos.PlayerDownsync 12, // [12:12] is the sub-list for method output_type
2, // 13: protos.RoomDownsyncFrame.PlayerMetasEntry.value:type_name -> protos.PlayerDownsyncMeta 12, // [12:12] is the sub-list for method input_type
14, // [14:14] is the sub-list for method output_type 12, // [12:12] is the sub-list for extension type_name
14, // [14:14] is the sub-list for method input_type 12, // [12:12] is the sub-list for extension extendee
14, // [14:14] is the sub-list for extension type_name 0, // [0:12] is the sub-list for field type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
} }
func init() { file_room_downsync_frame_proto_init() } 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{} { 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 { switch v := v.(*InputFrameDecoded); i {
case 0: case 0:
return &v.state return &v.state
@ -1261,7 +1167,7 @@ func file_room_downsync_frame_proto_init() {
return nil 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 { switch v := v.(*InputFrameUpsync); i {
case 0: case 0:
return &v.state return &v.state
@ -1273,7 +1179,7 @@ func file_room_downsync_frame_proto_init() {
return nil 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 { switch v := v.(*InputFrameDownsync); i {
case 0: case 0:
return &v.state return &v.state
@ -1285,7 +1191,7 @@ func file_room_downsync_frame_proto_init() {
return nil 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 { switch v := v.(*HeartbeatUpsync); i {
case 0: case 0:
return &v.state return &v.state
@ -1297,7 +1203,7 @@ func file_room_downsync_frame_proto_init() {
return nil 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 { switch v := v.(*RoomDownsyncFrame); i {
case 0: case 0:
return &v.state return &v.state
@ -1309,7 +1215,7 @@ func file_room_downsync_frame_proto_init() {
return nil 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 { switch v := v.(*WsReq); i {
case 0: case 0:
return &v.state return &v.state
@ -1321,7 +1227,7 @@ func file_room_downsync_frame_proto_init() {
return nil 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 { switch v := v.(*WsResp); i {
case 0: case 0:
return &v.state return &v.state
@ -1340,7 +1246,7 @@ func file_room_downsync_frame_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_room_downsync_frame_proto_rawDesc, RawDescriptor: file_room_downsync_frame_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 14, NumMessages: 12,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.28.1 // protoc-gen-go v1.28.1
// protoc v3.7.1 // protoc v3.21.4
// source: geometry.proto // source: geometry.proto
package sharedprotos package sharedprotos

View File

@ -40,19 +40,15 @@ message PlayerDownsync {
sharedprotos.Direction dir = 4; sharedprotos.Direction dir = 4;
int32 speed = 5; // in terms of virtual grid units int32 speed = 5; // in terms of virtual grid units
int32 battleState = 6; int32 battleState = 6;
int32 lastMoveGmtMillis = 7; int32 joinIndex = 7;
double colliderRadius = 8;
bool removed = 9;
int32 score = 10; int32 score = 10;
bool removed = 11; int32 lastMoveGmtMillis = 11;
int32 joinIndex = 12;
}
message PlayerDownsyncMeta { string name = 12;
int32 id = 1; string displayName = 13;
string name = 2; string avatar = 14;
string displayName = 3;
string avatar = 4;
int32 joinIndex = 5;
double colliderRadius = 6;
} }
message InputFrameDecoded { message InputFrameDecoded {
@ -80,7 +76,6 @@ message RoomDownsyncFrame {
int32 id = 1; int32 id = 1;
map<int32, PlayerDownsync> players = 2; map<int32, PlayerDownsync> players = 2;
int64 countdownNanos = 3; int64 countdownNanos = 3;
map<int32, PlayerDownsyncMeta> playerMetas = 4;
} }
message WsReq { message WsReq {

View File

@ -440,7 +440,7 @@
"array": [ "array": [
0, 0,
0, 0,
344.6705889248102, 210.4441731196186,
0, 0,
0, 0,
0, 0,

View File

@ -376,8 +376,7 @@ cc.Class({
window.clearBoundRoomIdInBothVolatileAndPersistentStorage(); window.clearBoundRoomIdInBothVolatileAndPersistentStorage();
window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ ); window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ );
}; };
resultPanelScriptIns.onCloseDelegate = () => { resultPanelScriptIns.onCloseDelegate = () => {};
};
self.gameRuleNode = cc.instantiate(self.gameRulePrefab); self.gameRuleNode = cc.instantiate(self.gameRulePrefab);
self.gameRuleNode.width = self.canvasNode.width; self.gameRuleNode.width = self.canvasNode.width;
@ -608,15 +607,13 @@ cc.Class({
} }
const players = rdf.players; const players = rdf.players;
const playerMetas = rdf.playerMetas; self._initPlayerRichInfoDict(players);
self._initPlayerRichInfoDict(players, playerMetas);
// Show the top status indicators for IN_BATTLE // Show the top status indicators for IN_BATTLE
if (self.playersInfoNode) { if (self.playersInfoNode) {
const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo"); const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo");
for (let i in playerMetas) { for (let i in players) {
const playerMeta = playerMetas[i]; playersInfoScriptIns.updateData(players[i]);
playersInfoScriptIns.updateData(playerMeta);
} }
} }
@ -716,7 +713,7 @@ cc.Class({
self.showPopupInCanvas(self.findingPlayerNode); self.showPopupInCanvas(self.findingPlayerNode);
} }
let findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer"); let findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.updatePlayersInfo(rdf.playerMetas); findingPlayerScriptIns.updatePlayersInfo(rdf.players);
}, },
logBattleStats() { logBattleStats() {
@ -764,8 +761,10 @@ cc.Class({
playerScriptIns.setSpecies("SoldierElf"); playerScriptIns.setSpecies("SoldierElf");
} else if (2 == joinIndex) { } else if (2 == joinIndex) {
playerScriptIns.setSpecies("SoldierFireGhost"); playerScriptIns.setSpecies("SoldierFireGhost");
if (0 == playerRichInfo.dir.dx && 0 == playerRichInfo.dir.dy) {
playerScriptIns.animComp.node.scaleX = (-1.0); playerScriptIns.animComp.node.scaleX = (-1.0);
} }
}
const wpos = self.virtualGridToWorldPos(vx, vy); const wpos = self.virtualGridToWorldPos(vx, vy);
@ -937,29 +936,27 @@ cc.Class({
if (null == self.findingPlayerNode.parent) return; if (null == self.findingPlayerNode.parent) return;
self.findingPlayerNode.parent.removeChild(self.findingPlayerNode); self.findingPlayerNode.parent.removeChild(self.findingPlayerNode);
if (null != rdf) { if (null != rdf) {
self._initPlayerRichInfoDict(rdf.players, rdf.playerMetas); self._initPlayerRichInfoDict(rdf.players);
} }
}, },
onBattleReadyToStart(rdf) { onBattleReadyToStart(rdf) {
const self = this; const self = this;
const players = rdf.players; const players = rdf.players;
const playerMetas = rdf.playerMetas; self._initPlayerRichInfoDict(players);
self._initPlayerRichInfoDict(players, playerMetas);
// Show the top status indicators for IN_BATTLE // Show the top status indicators for IN_BATTLE
if (self.playersInfoNode) { if (self.playersInfoNode) {
const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo"); const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo");
for (let i in playerMetas) { for (let i in players) {
const playerMeta = playerMetas[i]; playersInfoScriptIns.updateData(players[i]);
playersInfoScriptIns.updateData(playerMeta);
} }
} }
console.log("Calling `onBattleReadyToStart` with:", playerMetas); console.log("Calling `onBattleReadyToStart` with:", players);
if (self.findingPlayerNode) { if (self.findingPlayerNode) {
const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer"); const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.hideExitButton(); findingPlayerScriptIns.hideExitButton();
findingPlayerScriptIns.updatePlayersInfo(playerMetas); findingPlayerScriptIns.updatePlayersInfo(players);
} }
// Delay to hide the "finding player" GUI, then show a countdown clock // Delay to hide the "finding player" GUI, then show a countdown clock
@ -975,6 +972,7 @@ cc.Class({
applyRoomDownsyncFrameDynamics(rdf) { applyRoomDownsyncFrameDynamics(rdf) {
const self = this; const self = this;
const delayedInputFrameForPrevRenderFrame = self.getCachedInputFrameDownsyncWithPrediction(self._convertToInputFrameId(rdf.id - 1, self.inputDelayFrames));
self.playerRichInfoDict.forEach((playerRichInfo, playerId) => { self.playerRichInfoDict.forEach((playerRichInfo, playerId) => {
const immediatePlayerInfo = rdf.players[playerId]; const immediatePlayerInfo = rdf.players[playerId];
@ -985,7 +983,10 @@ cc.Class({
playerRichInfo.node.setPosition(wpos[0], wpos[1]); playerRichInfo.node.setPosition(wpos[0], wpos[1]);
playerRichInfo.virtualGridX = immediatePlayerInfo.virtualGridX; playerRichInfo.virtualGridX = immediatePlayerInfo.virtualGridX;
playerRichInfo.virtualGridY = immediatePlayerInfo.virtualGridY; 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); playerRichInfo.scriptIns.updateSpeed(immediatePlayerInfo.speed);
}); });
}, },
@ -1053,10 +1054,12 @@ cc.Class({
const newCpos = self.virtualGridToPlayerColliderPos(newVx, newVy, self.playerRichInfoArr[joinIndex - 1]); const newCpos = self.virtualGridToPlayerColliderPos(newVx, newVy, self.playerRichInfoArr[joinIndex - 1]);
playerCollider.x = newCpos[0]; playerCollider.x = newCpos[0];
playerCollider.y = newCpos[1]; playerCollider.y = newCpos[1];
if (0 != decodedInput.dx || 0 != decodedInput.dy) {
// Update directions and thus would eventually update moving animation accordingly // Update directions and thus would eventually update moving animation accordingly
nextRenderFramePlayers[playerId].dir.dx = decodedInput.dx; nextRenderFramePlayers[playerId].dir.dx = decodedInput.dx;
nextRenderFramePlayers[playerId].dir.dy = decodedInput.dy; nextRenderFramePlayers[playerId].dir.dy = decodedInput.dy;
} }
}
collisionSys.update(); collisionSys.update();
const result = collisionSys.createResult(); // Can I reuse a "self.collisionSysResult" object throughout the whole battle? const result = collisionSys.createResult(); // Can I reuse a "self.collisionSysResult" object throughout the whole battle?
@ -1142,15 +1145,13 @@ cc.Class({
return latestRdf; return latestRdf;
}, },
_initPlayerRichInfoDict(players, playerMetas) { _initPlayerRichInfoDict(players) {
const self = this; const self = this;
for (let k in players) { for (let k in players) {
const playerId = parseInt(k); const playerId = parseInt(k);
if (self.playerRichInfoDict.has(playerId)) continue; // Skip already put keys if (self.playerRichInfoDict.has(playerId)) continue; // Skip already put keys
const immediatePlayerInfo = players[playerId]; const immediatePlayerInfo = players[playerId];
const immediatePlayerMeta = playerMetas[playerId];
self.playerRichInfoDict.set(playerId, immediatePlayerInfo); 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)); const nodeAndScriptIns = self.spawnPlayerNode(immediatePlayerInfo.joinIndex, immediatePlayerInfo.virtualGridX, immediatePlayerInfo.virtualGridY, self.playerRichInfoDict.get(playerId));

View File

@ -410,10 +410,10 @@ cc.Class({
console.error("Unexpected encodedDirection = ", encodedDirection); console.error("Unexpected encodedDirection = ", encodedDirection);
} }
const btnALevel = ((encodedInput >> 4) & 1); const btnALevel = ((encodedInput >> 4) & 1);
return { return window.pb.protos.InputFrameDecoded.create({
dx: mappedDirection[0], dx: mappedDirection[0],
dy: mappedDirection[1], dy: mappedDirection[1],
a: btnALevel, btnALevel: btnALevel,
}; });
}, },
}); });