diff --git a/battle_srv/models/barrier.go b/battle_srv/models/barrier.go index 9b3a73c..81b78d5 100644 --- a/battle_srv/models/barrier.go +++ b/battle_srv/models/barrier.go @@ -7,7 +7,6 @@ import ( type Barrier struct { X float64 Y float64 - Type uint32 Boundary *Polygon2D CollidableBody *box2d.B2Body } diff --git a/battle_srv/models/bullet.go b/battle_srv/models/bullet.go deleted file mode 100644 index 6936d5c..0000000 --- a/battle_srv/models/bullet.go +++ /dev/null @@ -1,19 +0,0 @@ -package models - -import ( - "github.com/ByteArena/box2d" -) - -type Bullet struct { - LocalIdInBattle int32 `json:"-"` - LinearSpeed float64 `json:"-"` - X float64 `json:"-"` - Y float64 `json:"-"` - Removed bool `json:"-"` - Dir *Direction `json:"-"` - StartAtPoint *Vec2D `json:"-"` - EndAtPoint *Vec2D `json:"-"` - DamageBoundary *Polygon2D `json:"-"` - CollidableBody *box2d.B2Body `json:"-"` - RemovedAtFrameId int32 `json:"-"` -} diff --git a/battle_srv/models/pb_type_convert.go b/battle_srv/models/pb_type_convert.go index 73360cb..2b64bfd 100644 --- a/battle_srv/models/pb_type_convert.go +++ b/battle_srv/models/pb_type_convert.go @@ -90,114 +90,3 @@ func toPbPlayers(modelInstances map[int32]*Player) map[int32]*pb.Player { return toRet } - -func toPbTreasures(modelInstances map[int32]*Treasure) map[int32]*pb.Treasure { - toRet := make(map[int32]*pb.Treasure, 0) - if nil == modelInstances { - return toRet - } - - for k, last := range modelInstances { - toRet[k] = &pb.Treasure{ - Id: last.Id, - LocalIdInBattle: last.LocalIdInBattle, - Score: last.Score, - X: last.X, - Y: last.Y, - Removed: last.Removed, - Type: last.Type, - } - } - - return toRet -} - -func toPbTraps(modelInstances map[int32]*Trap) map[int32]*pb.Trap { - toRet := make(map[int32]*pb.Trap, 0) - if nil == modelInstances { - return toRet - } - - for k, last := range modelInstances { - toRet[k] = &pb.Trap{ - Id: last.Id, - LocalIdInBattle: last.LocalIdInBattle, - X: last.X, - Y: last.Y, - Removed: last.Removed, - Type: last.Type, - } - } - - return toRet -} - -func toPbBullets(modelInstances map[int32]*Bullet) map[int32]*pb.Bullet { - toRet := make(map[int32]*pb.Bullet, 0) - if nil == modelInstances { - return toRet - } - - for k, last := range modelInstances { - if nil == last.StartAtPoint || nil == last.EndAtPoint { - continue - } - toRet[k] = &pb.Bullet{ - LocalIdInBattle: last.LocalIdInBattle, - LinearSpeed: last.LinearSpeed, - X: last.X, - Y: last.Y, - Removed: last.Removed, - StartAtPoint: &pb.Vec2D{ - X: last.StartAtPoint.X, - Y: last.StartAtPoint.Y, - }, - EndAtPoint: &pb.Vec2D{ - X: last.EndAtPoint.X, - Y: last.EndAtPoint.Y, - }, - } - } - - return toRet -} - -func toPbSpeedShoes(modelInstances map[int32]*SpeedShoe) map[int32]*pb.SpeedShoe { - toRet := make(map[int32]*pb.SpeedShoe, 0) - if nil == modelInstances { - return toRet - } - - for k, last := range modelInstances { - toRet[k] = &pb.SpeedShoe{ - Id: last.Id, - LocalIdInBattle: last.LocalIdInBattle, - X: last.X, - Y: last.Y, - Removed: last.Removed, - Type: last.Type, - } - } - - return toRet -} - -func toPbGuardTowers(modelInstances map[int32]*GuardTower) map[int32]*pb.GuardTower { - toRet := make(map[int32]*pb.GuardTower, 0) - if nil == modelInstances { - return toRet - } - - for k, last := range modelInstances { - toRet[k] = &pb.GuardTower{ - Id: last.Id, - LocalIdInBattle: last.LocalIdInBattle, - X: last.X, - Y: last.Y, - Removed: last.Removed, - Type: last.Type, - } - } - - return toRet -} diff --git a/battle_srv/models/pumpkin.go b/battle_srv/models/pumpkin.go deleted file mode 100644 index 7868387..0000000 --- a/battle_srv/models/pumpkin.go +++ /dev/null @@ -1,14 +0,0 @@ -package models - -import "github.com/ByteArena/box2d" - -type Pumpkin struct { - LocalIdInBattle int32 `json:"localIdInBattle,omitempty"` - LinearSpeed float64 `json:"linearSpeed,omitempty"` - X float64 `json:"x,omitempty"` - Y float64 `json:"y,omitempty"` - Removed bool `json:"removed,omitempty"` - Dir *Direction `json:"-"` - CollidableBody *box2d.B2Body `json:"-"` - RemovedAtFrameId int32 `json:"-"` -} diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index cb74cc6..2a100e1 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -43,20 +43,10 @@ const ( const ( // You can equivalently use the `GroupIndex` approach, but the more complicated and general purpose approach is used deliberately here. Reference http://www.aurelienribon.com/post/2011-07-box2d-tutorial-collision-filtering. COLLISION_CATEGORY_CONTROLLED_PLAYER = (1 << 1) - COLLISION_CATEGORY_TREASURE = (1 << 2) - COLLISION_CATEGORY_TRAP = (1 << 3) - COLLISION_CATEGORY_TRAP_BULLET = (1 << 4) - COLLISION_CATEGORY_BARRIER = (1 << 5) - COLLISION_CATEGORY_PUMPKIN = (1 << 6) - COLLISION_CATEGORY_SPEED_SHOES = (1 << 7) + COLLISION_CATEGORY_BARRIER = (1 << 2) - COLLISION_MASK_FOR_CONTROLLED_PLAYER = (COLLISION_CATEGORY_TREASURE | COLLISION_CATEGORY_TRAP | COLLISION_CATEGORY_TRAP_BULLET | COLLISION_CATEGORY_SPEED_SHOES) - COLLISION_MASK_FOR_TREASURE = (COLLISION_CATEGORY_CONTROLLED_PLAYER) - COLLISION_MASK_FOR_TRAP = (COLLISION_CATEGORY_CONTROLLED_PLAYER) - COLLISION_MASK_FOR_TRAP_BULLET = (COLLISION_CATEGORY_CONTROLLED_PLAYER) - COLLISION_MASK_FOR_BARRIER = (COLLISION_CATEGORY_PUMPKIN) - COLLISION_MASK_FOR_PUMPKIN = (COLLISION_CATEGORY_BARRIER) - COLLISION_MASK_FOR_SPEED_SHOES = (COLLISION_CATEGORY_CONTROLLED_PLAYER) + COLLISION_MASK_FOR_CONTROLLED_PLAYER = (COLLISION_CATEGORY_BARRIER) + COLLISION_MASK_FOR_BARRIER = (COLLISION_CATEGORY_CONTROLLED_PLAYER) ) var DIRECTION_DECODER = [][]int32{ @@ -75,6 +65,22 @@ var DIRECTION_DECODER = [][]int32{ {0, -1}, } +var DIRECTION_DECODER_INVERSE_LENGTH = []float32{ + 0.0, + 1.0, + 1.0, + 0.5, + 0.5, + 0.4472, + 0.4472, + 0.4472, + 0.4472, + 0.5, + 0.5, + 1.0, + 1.0, +} + type RoomBattleState struct { IDLE int32 WAITING int32 @@ -142,16 +148,11 @@ type Room struct { BattleDurationNanos int64 EffectivePlayerCount int32 DismissalWaitGroup sync.WaitGroup - Treasures map[int32]*Treasure - Traps map[int32]*Trap - GuardTowers map[int32]*GuardTower - Bullets map[int32]*Bullet - SpeedShoes map[int32]*SpeedShoe Barriers map[int32]*Barrier - Pumpkins map[int32]*Pumpkin AccumulatedLocalIdForBullets int32 CollidableWorld *box2d.B2World AllPlayerInputsBuffer *RingBuffer + RenderFrameBuffer *RingBuffer LastAllConfirmedInputFrameId int32 LastAllConfirmedInputFrameIdWithChange int32 LastAllConfirmedInputList []uint64 @@ -168,58 +169,11 @@ type Room struct { RawBattleStrToPolygon2DListMap StrToPolygon2DListMap } -func (pR *Room) onTreasurePickedUp(contactingPlayer *Player, contactingTreasure *Treasure) { - if _, existent := pR.Treasures[contactingTreasure.LocalIdInBattle]; existent { - Logger.Info("Player has picked up treasure:", zap.Any("roomId", pR.Id), zap.Any("contactingPlayer.Id", contactingPlayer.Id), zap.Any("contactingTreasure.LocalIdInBattle", contactingTreasure.LocalIdInBattle)) - pR.CollidableWorld.DestroyBody(contactingTreasure.CollidableBody) - pR.Treasures[contactingTreasure.LocalIdInBattle] = &Treasure{Removed: true} - pR.Players[contactingPlayer.Id].Score += contactingTreasure.Score - } -} - const ( PLAYER_DEFAULT_SPEED = 200 // Hardcoded ADD_SPEED = 100 // Hardcoded ) -func (pR *Room) onSpeedShoePickedUp(contactingPlayer *Player, contactingSpeedShoe *SpeedShoe, nowMillis int64) { - if _, existent := pR.SpeedShoes[contactingSpeedShoe.LocalIdInBattle]; existent && contactingPlayer.AddSpeedAtGmtMillis == -1 { - Logger.Info("Player has picked up a SpeedShoe:", zap.Any("roomId", pR.Id), zap.Any("contactingPlayer.Id", contactingPlayer.Id), zap.Any("contactingSpeedShoe.LocalIdInBattle", contactingSpeedShoe.LocalIdInBattle)) - pR.CollidableWorld.DestroyBody(contactingSpeedShoe.CollidableBody) - pR.SpeedShoes[contactingSpeedShoe.LocalIdInBattle] = &SpeedShoe{ - Removed: true, - RemovedAtFrameId: pR.Tick, - } - pR.Players[contactingPlayer.Id].Speed += ADD_SPEED - pR.Players[contactingPlayer.Id].AddSpeedAtGmtMillis = nowMillis - } -} - -func (pR *Room) onBulletCrashed(contactingPlayer *Player, contactingBullet *Bullet, nowMillis int64, maxMillisToFreezePerPlayer int64) { - if _, existent := pR.Bullets[contactingBullet.LocalIdInBattle]; existent { - pR.CollidableWorld.DestroyBody(contactingBullet.CollidableBody) - pR.Bullets[contactingBullet.LocalIdInBattle] = &Bullet{ - Removed: true, - RemovedAtFrameId: pR.Tick, - } - - if contactingPlayer != nil { - if maxMillisToFreezePerPlayer > (nowMillis - pR.Players[contactingPlayer.Id].FrozenAtGmtMillis) { - // Deliberately doing nothing. -- YFLu, 2019-09-04. - } else { - pR.Players[contactingPlayer.Id].Speed = 0 - pR.Players[contactingPlayer.Id].FrozenAtGmtMillis = nowMillis - pR.Players[contactingPlayer.Id].AddSpeedAtGmtMillis = -1 - //Logger.Info("Player has picked up bullet:", zap.Any("roomId", pR.Id), zap.Any("contactingPlayer.Id", contactingPlayer.Id), zap.Any("contactingBullet.LocalIdInBattle", contactingBullet.LocalIdInBattle), zap.Any("pR.Players[contactingPlayer.Id].Speed", pR.Players[contactingPlayer.Id].Speed)) - } - } - } -} - -func (pR *Room) onPumpkinEncounterPlayer(pumpkin *Pumpkin, player *Player) { - Logger.Info("pumpkin has caught the player: ", zap.Any("pumpkinId", pumpkin.LocalIdInBattle), zap.Any("playerId", player.Id)) -} - func (pR *Room) updateScore() { pR.Score = calRoomScore(pR.EffectivePlayerCount, pR.Capacity, pR.State) } @@ -280,251 +234,6 @@ func (pR *Room) ReAddPlayerIfPossible(pTmpPlayerInstance *Player, session *webso return true } -func (pR *Room) refreshColliders() { - /* - "BarrierCollider"s are NOT added to the "colliders in B2World of the current battle", thus NOT involved in server-side collision detection! - - -- YFLu, 2019-09-04 - */ - gravity := box2d.MakeB2Vec2(0.0, 0.0) - world := box2d.MakeB2World(gravity) - world.SetContactFilter(&box2d.B2ContactFilter{}) - pR.CollidableWorld = &world - - Logger.Info("Begins `refreshColliders` for players:", zap.Any("roomId", pR.Id)) - for _, player := range pR.Players { - var bdDef box2d.B2BodyDef - colliderOffset := box2d.MakeB2Vec2(0, 0) // Matching that of client-side setting. - bdDef = box2d.MakeB2BodyDef() - bdDef.Type = box2d.B2BodyType.B2_dynamicBody - bdDef.Position.Set(player.X+colliderOffset.X, player.Y+colliderOffset.Y) - - b2Body := pR.CollidableWorld.CreateBody(&bdDef) - - b2CircleShape := box2d.MakeB2CircleShape() - b2CircleShape.M_radius = 32 // Matching that of client-side setting. - - fd := box2d.MakeB2FixtureDef() - fd.Shape = &b2CircleShape - fd.Filter.CategoryBits = COLLISION_CATEGORY_CONTROLLED_PLAYER - fd.Filter.MaskBits = COLLISION_MASK_FOR_CONTROLLED_PLAYER - fd.Density = 0.0 - b2Body.CreateFixtureFromDef(&fd) - - player.CollidableBody = b2Body - b2Body.SetUserData(player) - } - Logger.Info("Ends `refreshColliders` for players:", zap.Any("roomId", pR.Id)) - - Logger.Info("Begins `refreshColliders` for treasures:", zap.Any("roomId", pR.Id)) - for _, treasure := range pR.Treasures { - var bdDef box2d.B2BodyDef - bdDef.Type = box2d.B2BodyType.B2_dynamicBody - bdDef = box2d.MakeB2BodyDef() - bdDef.Position.Set(treasure.PickupBoundary.Anchor.X, treasure.PickupBoundary.Anchor.Y) - - b2Body := pR.CollidableWorld.CreateBody(&bdDef) - - pointsCount := len(treasure.PickupBoundary.Points) - - b2Vertices := make([]box2d.B2Vec2, pointsCount) - for vIndex, v2 := range treasure.PickupBoundary.Points { - b2Vertices[vIndex] = v2.ToB2Vec2() - } - - b2PolygonShape := box2d.MakeB2PolygonShape() - b2PolygonShape.Set(b2Vertices, pointsCount) - - fd := box2d.MakeB2FixtureDef() - fd.Shape = &b2PolygonShape - fd.Filter.CategoryBits = COLLISION_CATEGORY_TREASURE - fd.Filter.MaskBits = COLLISION_MASK_FOR_TREASURE - fd.Density = 0.0 - b2Body.CreateFixtureFromDef(&fd) - - treasure.CollidableBody = b2Body - b2Body.SetUserData(treasure) - } - Logger.Info("Ends `refreshColliders` for treasures:", zap.Any("roomId", pR.Id)) - - Logger.Info("Begins `refreshColliders` for towers:", zap.Any("roomId", pR.Id)) - for _, tower := range pR.GuardTowers { - // Logger.Info("Begins `refreshColliders` for single tower:", zap.Any("k-th", k), zap.Any("tower.LocalIdInBattle", tower.LocalIdInBattle), zap.Any("tower.X", tower.X), zap.Any("tower.Y", tower.Y), zap.Any("tower.PickupBoundary", tower.PickupBoundary), zap.Any("tower.PickupBoundary.Points", tower.PickupBoundary.Points), zap.Any("tower.WidthInB2World", tower.WidthInB2World), zap.Any("tower.HeightInB2World", tower.HeightInB2World), zap.Any("roomId", pR.Id)) - var bdDef box2d.B2BodyDef - bdDef.Type = box2d.B2BodyType.B2_dynamicBody - bdDef = box2d.MakeB2BodyDef() - bdDef.Position.Set(tower.PickupBoundary.Anchor.X, tower.PickupBoundary.Anchor.Y) - - b2Body := pR.CollidableWorld.CreateBody(&bdDef) - // Logger.Info("Checks#1 `refreshColliders` for single tower:", zap.Any("k-th", k), zap.Any("tower", tower), zap.Any("roomId", pR.Id)) - - pointsCount := len(tower.PickupBoundary.Points) - - b2Vertices := make([]box2d.B2Vec2, pointsCount) - for vIndex, v2 := range tower.PickupBoundary.Points { - b2Vertices[vIndex] = v2.ToB2Vec2() - } - // Logger.Info("Checks#2 `refreshColliders` for single tower:", zap.Any("k-th", k), zap.Any("tower", tower), zap.Any("roomId", pR.Id)) - - b2PolygonShape := box2d.MakeB2PolygonShape() - // Logger.Info("Checks#3 `refreshColliders` for single tower:", zap.Any("k-th", k), zap.Any("tower", tower), zap.Any("roomId", pR.Id)) - b2PolygonShape.Set(b2Vertices, pointsCount) - // Logger.Info("Checks#4 `refreshColliders` for single tower:", zap.Any("k-th", k), zap.Any("tower", tower), zap.Any("roomId", pR.Id)) - - fd := box2d.MakeB2FixtureDef() - fd.Shape = &b2PolygonShape - fd.Filter.CategoryBits = COLLISION_CATEGORY_TRAP - fd.Filter.MaskBits = COLLISION_MASK_FOR_TRAP - fd.Density = 0.0 - b2Body.CreateFixtureFromDef(&fd) - // Logger.Info("Checks#5 `refreshColliders` for single tower:", zap.Any("k-th", k), zap.Any("tower", tower), zap.Any("roomId", pR.Id)) - - tower.CollidableBody = b2Body - b2Body.SetUserData(tower) - // Logger.Info("Ends `refreshColliders` for single tower:", zap.Any("k-th", k), zap.Any("tower", tower), zap.Any("roomId", pR.Id)) - } - Logger.Info("Ends `refreshColliders` for towers:", zap.Any("roomId", pR.Id)) - - listener := RoomBattleContactListener{ - name: "TreasureHunterX", - room: pR, - } - /* - * Setting a "ContactListener" for "pR.CollidableWorld" - * will only trigger corresponding callbacks in the - * SAME GOROUTINE of "pR.CollidableWorld.Step(...)" according - * to "https://github.com/ByteArena/box2d/blob/master/DynamicsB2World.go" and - * "https://github.com/ByteArena/box2d/blob/master/DynamicsB2Contact.go". - * - * The invocation-chain involves "Step -> SolveTOI -> B2ContactUpdate -> [BeginContact, EndContact, PreSolve]". - */ - pR.CollidableWorld.SetContactListener(listener) -} - -func calculateDiffFrame(currentFrame *pb.RoomDownsyncFrame, lastFrame *pb.RoomDownsyncFrame) *pb.RoomDownsyncFrame { - if lastFrame == nil { - return currentFrame - } - diffFrame := &pb.RoomDownsyncFrame{ - Id: currentFrame.Id, - RefFrameId: lastFrame.Id, - Players: currentFrame.Players, - SentAt: currentFrame.SentAt, - CountdownNanos: currentFrame.CountdownNanos, - Bullets: currentFrame.Bullets, - Treasures: make(map[int32]*pb.Treasure, 0), - Traps: make(map[int32]*pb.Trap, 0), - SpeedShoes: make(map[int32]*pb.SpeedShoe, 0), - GuardTowers: make(map[int32]*pb.GuardTower, 0), - } - - for k, last := range lastFrame.Treasures { - if last.Removed { - diffFrame.Treasures[k] = last - continue - } - curr, ok := currentFrame.Treasures[k] - if !ok { - diffFrame.Treasures[k] = &pb.Treasure{Removed: true} - Logger.Info("A treasure is removed.", zap.Any("diffFrame.id", diffFrame.Id), zap.Any("treasure.LocalIdInBattle", curr.LocalIdInBattle)) - continue - } - if ok, v := diffTreasure(last, curr); ok { - diffFrame.Treasures[k] = v - } - } - - for k, last := range lastFrame.Bullets { - curr, ok := currentFrame.Bullets[k] - /* - * The use of 'bullet.RemovedAtFrameId' implies that you SHOULDN'T create a record '&Bullet{Removed: true}' here after it's already deleted from 'room.Bullets'. Same applies for `Traps` and `SpeedShoes`. - * - * -- YFLu - */ - if false == ok { - diffFrame.Bullets[k] = &pb.Bullet{Removed: true} - // Logger.Info("A bullet is removed.", zap.Any("diffFrame.id", diffFrame.Id), zap.Any("bullet.LocalIdInBattle", lastFrame.Bullets[k].LocalIdInBattle)) - continue - } - if ok, v := diffBullet(last, curr); ok { - diffFrame.Bullets[k] = v - } - } - - for k, last := range lastFrame.Traps { - curr, ok := currentFrame.Traps[k] - if false == ok { - continue - } - if ok, v := diffTrap(last, curr); ok { - diffFrame.Traps[k] = v - } - } - - for k, last := range lastFrame.SpeedShoes { - curr, ok := currentFrame.SpeedShoes[k] - if false == ok { - continue - } - if ok, v := diffSpeedShoe(last, curr); ok { - diffFrame.SpeedShoes[k] = v - } - } - - return diffFrame -} - -func diffTreasure(last *pb.Treasure, curr *pb.Treasure) (bool, *pb.Treasure) { - treature := &pb.Treasure{} - t := false - if last.Score != curr.Score { - treature.Score = curr.Score - t = true - } - if last.X != curr.X { - treature.X = curr.X - t = true - } - if last.Y != curr.Y { - treature.Y = curr.Y - t = true - } - return t, treature -} - -func diffTrap(last *pb.Trap, curr *pb.Trap) (bool, *pb.Trap) { - trap := &pb.Trap{} - t := false - if last.X != curr.X { - trap.X = curr.X - t = true - } - if last.Y != curr.Y { - trap.Y = curr.Y - t = true - } - return t, trap -} - -func diffSpeedShoe(last *pb.SpeedShoe, curr *pb.SpeedShoe) (bool, *pb.SpeedShoe) { - speedShoe := &pb.SpeedShoe{} - t := false - if last.X != curr.X { - speedShoe.X = curr.X - t = true - } - if last.Y != curr.Y { - speedShoe.Y = curr.Y - t = true - } - return t, speedShoe -} - -func diffBullet(last *pb.Bullet, curr *pb.Bullet) (bool, *pb.Bullet) { - t := true - return t, curr -} - func (pR *Room) ChooseStage() error { /* * We use the verb "refresh" here to imply that upon invocation of this function, all colliders will be recovered if they were destroyed in the previous battle. @@ -592,81 +301,21 @@ func (pR *Room) ChooseStage() error { pR.RawBattleStrToVec2DListMap = toRetStrToVec2DListMap pR.RawBattleStrToPolygon2DListMap = toRetStrToPolygon2DListMap - // Refresh "Treasure" data for RoomDownsyncFrame. - lowScoreTreasurePolygon2DList := *(toRetStrToPolygon2DListMap["LowScoreTreasure"]) - highScoreTreasurePolygon2DList := *(toRetStrToPolygon2DListMap["HighScoreTreasure"]) + barrierPolygon2DList := *(toRetStrToPolygon2DListMap["Barrier"]) - var treasureLocalIdInBattle int32 = 0 - for _, polygon2D := range lowScoreTreasurePolygon2DList { + var barrierLocalIdInBattle int32 = 0 + for _, polygon2D := range barrierPolygon2DList { /* // For debug-printing only. - - Logger.Info("ChooseStage printing polygon2D for lowScoreTreasurePolygon2DList", zap.Any("treasureLocalIdInBattle", treasureLocalIdInBattle), zap.Any("polygon2D.Anchor", polygon2D.Anchor), zap.Any("polygon2D.Points", polygon2D.Points)) + Logger.Info("ChooseStage printing polygon2D for barrierPolygon2DList", zap.Any("barrierLocalIdInBattle", barrierLocalIdInBattle), zap.Any("polygon2D.Anchor", polygon2D.Anchor), zap.Any("polygon2D.Points", polygon2D.Points)) */ - - theTreasure := &Treasure{ - Id: 0, - LocalIdInBattle: treasureLocalIdInBattle, - Score: LOW_SCORE_TREASURE_SCORE, - Type: LOW_SCORE_TREASURE_TYPE, + pR.Barriers[barrierLocalIdInBattle] = &Barrier{ X: polygon2D.Anchor.X, Y: polygon2D.Anchor.Y, - PickupBoundary: polygon2D, + Boundary: polygon2D, } - pR.Treasures[theTreasure.LocalIdInBattle] = theTreasure - treasureLocalIdInBattle++ - } - - for _, polygon2D := range highScoreTreasurePolygon2DList { - /* - // For debug-printing only. - - Logger.Info("ChooseStage printing polygon2D for highScoreTreasurePolygon2DList", zap.Any("treasureLocalIdInBattle", treasureLocalIdInBattle), zap.Any("polygon2D.Anchor", polygon2D.Anchor), zap.Any("polygon2D.Points", polygon2D.Points)) - */ - theTreasure := &Treasure{ - Id: 0, - LocalIdInBattle: treasureLocalIdInBattle, - Score: HIGH_SCORE_TREASURE_SCORE, - Type: HIGH_SCORE_TREASURE_TYPE, - X: polygon2D.Anchor.X, - Y: polygon2D.Anchor.Y, - PickupBoundary: polygon2D, - } - - pR.Treasures[theTreasure.LocalIdInBattle] = theTreasure - - treasureLocalIdInBattle++ - } - - // Refresh "GuardTower" data for RoomDownsyncFrame. - guardTowerPolygon2DList := *(toRetStrToPolygon2DListMap["GuardTower"]) - var guardTowerLocalIdInBattle int32 = 0 - for _, polygon2D := range guardTowerPolygon2DList { - /* - // For debug-printing only. - - Logger.Info("ChooseStage printing polygon2D for guardTowerPolygon2DList", zap.Any("guardTowerLocalIdInBattle", guardTowerLocalIdInBattle), zap.Any("polygon2D.Anchor", polygon2D.Anchor), zap.Any("polygon2D.Points", polygon2D.Points), zap.Any("pR.GuardTowers", pR.GuardTowers)) - */ - - var inRangePlayers InRangePlayerCollection - pInRangePlayers := &inRangePlayers - pInRangePlayers = pInRangePlayers.Init(10) - theGuardTower := &GuardTower{ - Id: 0, - LocalIdInBattle: guardTowerLocalIdInBattle, - X: polygon2D.Anchor.X, - Y: polygon2D.Anchor.Y, - PickupBoundary: polygon2D, - InRangePlayers: pInRangePlayers, - LastAttackTick: utils.UnixtimeNano(), - WidthInB2World: float64(polygon2D.TmxObjectWidth), - HeightInB2World: float64(polygon2D.TmxObjectHeight), - } - - pR.GuardTowers[theGuardTower.LocalIdInBattle] = theGuardTower - - guardTowerLocalIdInBattle++ + barrierLocalIdInBattle++ } return nil @@ -754,11 +403,6 @@ func (pR *Room) StartBattle() { Id: pR.Tick, RefFrameId: MAGIC_ROOM_DOWNSYNC_FRAME_ID_BATTLE_START, Players: toPbPlayers(pR.Players), - Treasures: toPbTreasures(pR.Treasures), - Traps: toPbTraps(pR.Traps), - Bullets: toPbBullets(pR.Bullets), - SpeedShoes: toPbSpeedShoes(pR.SpeedShoes), - GuardTowers: toPbGuardTowers(pR.GuardTowers), SentAt: utils.UnixtimeMilli(), CountdownNanos: (pR.BattleDurationNanos - totalElapsedNanos), } @@ -783,6 +427,8 @@ func (pR *Room) StartBattle() { } stCalculation := utils.UnixtimeNano() + // TODO: Force confirm some non-all-confirmed but outdated input frames, derive server-sider RenderFrameBuffer elements from them, and send to respective players with "RoomDownsyncFrame.refFrameId=MAGIC_ROOM_DOWNSYNC_FRAME_ID_PLAYER_READDED_AND_ACKED" + refInputFrameId := int32(999999999) // Hardcoded as a max reference. for playerId, _ := range pR.Players { thatId := atomic.LoadInt32(&(pR.Players[playerId].AckingInputFrameId)) @@ -981,8 +627,6 @@ func (pR *Room) StopBattleForSettlement() { Players: toPbPlayers(pR.Players), SentAt: utils.UnixtimeMilli(), CountdownNanos: -1, // TODO: Replace this magic constant! - Treasures: toPbTreasures(pR.Treasures), - Traps: toPbTraps(pR.Traps), } pR.sendSafely(assembledFrame, playerId) } @@ -1089,11 +733,6 @@ func (pR *Room) onDismissed() { // Always instantiates new HeapRAM blocks and let the old blocks die out due to not being retained by any root reference. pR.Players = make(map[int32]*Player) - pR.Treasures = make(map[int32]*Treasure) - pR.Traps = make(map[int32]*Trap) - pR.GuardTowers = make(map[int32]*GuardTower) - pR.Bullets = make(map[int32]*Bullet) - pR.SpeedShoes = make(map[int32]*SpeedShoe) pR.PlayerDownsyncSessionDict = make(map[int32]*websocket.Conn) pR.PlayerSignalToCloseDict = make(map[int32]SignalToCloseConnCbType) @@ -1105,6 +744,7 @@ func (pR *Room) onDismissed() { pR.JoinIndexBooleanArr[indice] = false } pR.AllPlayerInputsBuffer = NewRingBuffer(1024) + pR.RenderFrameBuffer = NewRingBuffer(1024) pR.ChooseStage() pR.EffectivePlayerCount = 0 @@ -1116,14 +756,6 @@ func (pR *Room) onDismissed() { Logger.Info("The room is completely dismissed:", zap.Any("roomId", pR.Id)) } -func (pR *Room) Unicast(toPlayerId int32, msg interface{}) { - // TODO -} - -func (pR *Room) Broadcast(msg interface{}) { - // TODO -} - func (pR *Room) expelPlayerDuringGame(playerId int32) { defer pR.onPlayerExpelledDuringGame(playerId) } @@ -1368,6 +1000,84 @@ func (pR *Room) inputFrameIdDebuggable(inputFrameId int32) bool { return 0 == (inputFrameId % 10) } +func (pR *Room) refreshColliders() { + gravity := box2d.MakeB2Vec2(0.0, 0.0) + world := box2d.MakeB2World(gravity) + world.SetContactFilter(&box2d.B2ContactFilter{}) + pR.CollidableWorld = &world + + Logger.Info("Begins players collider processing:", zap.Any("roomId", pR.Id)) + for _, player := range pR.Players { + var bdDef box2d.B2BodyDef + colliderOffset := box2d.MakeB2Vec2(0, 0) // Matching that of client-side setting. + bdDef = box2d.MakeB2BodyDef() + bdDef.Type = box2d.B2BodyType.B2_dynamicBody + bdDef.Position.Set(player.X+colliderOffset.X, player.Y+colliderOffset.Y) + + b2Body := pR.CollidableWorld.CreateBody(&bdDef) + + b2CircleShape := box2d.MakeB2CircleShape() + b2CircleShape.M_radius = 32 // Matching that of client-side setting. + + fd := box2d.MakeB2FixtureDef() + fd.Shape = &b2CircleShape + fd.Filter.CategoryBits = COLLISION_CATEGORY_CONTROLLED_PLAYER + fd.Filter.MaskBits = COLLISION_MASK_FOR_CONTROLLED_PLAYER + fd.Density = 0.0 + b2Body.CreateFixtureFromDef(&fd) + + player.CollidableBody = b2Body + b2Body.SetUserData(player) + } + Logger.Info("Ends players collider processing:", zap.Any("roomId", pR.Id)) + + Logger.Info("Begins barriers collider processing:", zap.Any("roomId", pR.Id)) + for _, barrier := range pR.Barriers { + var bdDef box2d.B2BodyDef + bdDef.Type = box2d.B2BodyType.B2_dynamicBody + bdDef = box2d.MakeB2BodyDef() + bdDef.Position.Set(barrier.Boundary.Anchor.X, barrier.Boundary.Anchor.Y) + + b2Body := pR.CollidableWorld.CreateBody(&bdDef) + + pointsCount := len(barrier.Boundary.Points) + + b2Vertices := make([]box2d.B2Vec2, pointsCount) + for vIndex, v2 := range barrier.Boundary.Points { + b2Vertices[vIndex] = v2.ToB2Vec2() + } + + b2PolygonShape := box2d.MakeB2PolygonShape() + b2PolygonShape.Set(b2Vertices, pointsCount) + + fd := box2d.MakeB2FixtureDef() + fd.Shape = &b2PolygonShape + fd.Filter.CategoryBits = COLLISION_CATEGORY_BARRIER + fd.Filter.MaskBits = COLLISION_MASK_FOR_BARRIER + fd.Density = 0.0 + b2Body.CreateFixtureFromDef(&fd) + + barrier.CollidableBody = b2Body + b2Body.SetUserData(barrier) + } + Logger.Info("Ends barriers collider processing:", zap.Any("roomId", pR.Id)) + + listener := RoomBattleContactListener{ + name: "DelayNoMore", + room: pR, + } + /* + * Setting a "ContactListener" for "pR.CollidableWorld" + * will only trigger corresponding callbacks in the + * SAME GOROUTINE of "pR.CollidableWorld.Step(...)" according + * to "https://github.com/ByteArena/box2d/blob/master/DynamicsB2World.go" and + * "https://github.com/ByteArena/box2d/blob/master/DynamicsB2Contact.go". + * + * The invocation-chain involves "Step -> SolveTOI -> B2ContactUpdate -> [BeginContact, EndContact, PreSolve]". + */ + pR.CollidableWorld.SetContactListener(listener) +} + type RoomBattleContactListener struct { name string room *Room @@ -1376,15 +1086,15 @@ type RoomBattleContactListener struct { // Implementing the GolangBox2d contact listeners [begins]. /** * Note that the execution of these listeners is within the SAME GOROUTINE as that of "`battleMainLoop` in the same room". - * See the comments in `Room.refreshContactListener()` for details. + * See the comments in `Room.refreshColliders()` for details. */ func (l RoomBattleContactListener) BeginContact(contact box2d.B2ContactInterface) { - var pTower *GuardTower + var pBarrier *Barrier var pPlayer *Player switch v := contact.GetNodeA().Other.GetUserData().(type) { - case *GuardTower: - pTower = v + case *Barrier: + pBarrier = v case *Player: pPlayer = v default: @@ -1392,40 +1102,41 @@ func (l RoomBattleContactListener) BeginContact(contact box2d.B2ContactInterface } switch v := contact.GetNodeB().Other.GetUserData().(type) { - case *GuardTower: - pTower = v + case *Barrier: + pBarrier = v case *Player: pPlayer = v default: } - if pTower != nil && pPlayer != nil { - pTower.InRangePlayers.AppendPlayer(pPlayer) + if pBarrier != nil && pPlayer != nil { + Logger.Info("player begins collision with barrier:", zap.Any("barrier", pBarrier), zap.Any("player", pPlayer)) + // TODO: Push back player } } func (l RoomBattleContactListener) EndContact(contact box2d.B2ContactInterface) { - var pTower *GuardTower + var pBarrier *Barrier var pPlayer *Player switch v := contact.GetNodeA().Other.GetUserData().(type) { - case *GuardTower: - pTower = v + case *Barrier: + pBarrier = v case *Player: pPlayer = v default: } switch v := contact.GetNodeB().Other.GetUserData().(type) { - case *GuardTower: - pTower = v + case *Barrier: + pBarrier = v case *Player: pPlayer = v default: } - if pTower != nil && pPlayer != nil { - pTower.InRangePlayers.RemovePlayerById(pPlayer.Id) + if pBarrier != nil && pPlayer != nil { + Logger.Info("player ends collision with barrier:", zap.Any("barrier", pBarrier), zap.Any("player", pPlayer)) } } diff --git a/battle_srv/models/room_heap_manager.go b/battle_srv/models/room_heap_manager.go index 70b58b7..fc207b5 100644 --- a/battle_srv/models/room_heap_manager.go +++ b/battle_srv/models/room_heap_manager.go @@ -111,15 +111,10 @@ func InitRoomHeapManager() { //BattleDurationNanos: int64(5 * 1000 * 1000 * 1000), BattleDurationNanos: int64(30 * 1000 * 1000 * 1000), ServerFPS: 60, - Treasures: make(map[int32]*Treasure), - Traps: make(map[int32]*Trap), - GuardTowers: make(map[int32]*GuardTower), - Bullets: make(map[int32]*Bullet), - SpeedShoes: make(map[int32]*SpeedShoe), Barriers: make(map[int32]*Barrier), - Pumpkins: make(map[int32]*Pumpkin), AccumulatedLocalIdForBullets: 0, AllPlayerInputsBuffer: NewRingBuffer(1024), + RenderFrameBuffer: NewRingBuffer(1024), LastAllConfirmedInputFrameId: -1, LastAllConfirmedInputFrameIdWithChange: -1, LastAllConfirmedInputList: make([]uint64, roomCapacity), diff --git a/battle_srv/models/speed_shoe.go b/battle_srv/models/speed_shoe.go deleted file mode 100644 index a2db919..0000000 --- a/battle_srv/models/speed_shoe.go +++ /dev/null @@ -1,17 +0,0 @@ -package models - -import ( - "github.com/ByteArena/box2d" -) - -type SpeedShoe struct { - Id int32 `json:"id,omitempty"` - LocalIdInBattle int32 `json:"localIdInBattle,omitempty"` - X float64 `json:"x,omitempty"` - Y float64 `json:"y,omitempty"` - Removed bool `json:"removed,omitempty"` - Type int32 `json:"type,omitempty"` - PickupBoundary *Polygon2D `json:"-"` - CollidableBody *box2d.B2Body `json:"-"` - RemovedAtFrameId int32 `json:"-"` -} diff --git a/battle_srv/models/tiled_map.go b/battle_srv/models/tiled_map.go index da46afe..c6943c4 100644 --- a/battle_srv/models/tiled_map.go +++ b/battle_srv/models/tiled_map.go @@ -19,7 +19,6 @@ import ( const ( LOW_SCORE_TREASURE_TYPE = 1 HIGH_SCORE_TREASURE_TYPE = 2 - SPEED_SHOES_TYPE = 3 LOW_SCORE_TREASURE_SCORE = 100 @@ -297,7 +296,7 @@ func DeserializeTsxToColliderDict(pTmxMapIns *TmxMap, byteArrOfTsxFile []byte, f for _, tile := range pTsxIns.Tiles { globalGid := (firstGid + int(tile.Id)) /** - Per tile xml str could be + A tile xml string could be ``` @@ -367,8 +366,6 @@ func ParseTmxLayersAndGroups(pTmxMapIns *TmxMap, gidBoundariesMapInB2World map[i - "Polygon2D"s of "toRetStrToPolygon2DListMap" are already transformed into the "coordinate of B2World". - - -- YFLu */ for _, objGroup := range pTmxMapIns.ObjectGroups { @@ -391,13 +388,8 @@ func ParseTmxLayersAndGroups(pTmxMapIns *TmxMap, gidBoundariesMapInB2World map[i thePosInWorld := pTmxMapIns.continuousObjLayerOffsetToContinuousMapNodePos(theUntransformedPos) *pTheVec2DListToCache = append(*pTheVec2DListToCache, &thePosInWorld) } - case "Pumpkin", "SpeedShoe": case "Barrier": - /* - Note that in this case, the "Polygon2D.Anchor" of each "TmxOrTsxObject" is located exactly in an overlapping with "Polygon2D.Points[0]" w.r.t. B2World. - - -- YFLu - */ + // Note that in this case, the "Polygon2D.Anchor" of each "TmxOrTsxObject" is exactly overlapping with "Polygon2D.Points[0]" w.r.t. B2World. var pThePolygon2DListToCache *Polygon2DList _, ok := toRetStrToPolygon2DListMap[objGroup.Name] if false == ok { @@ -422,65 +414,6 @@ func ParseTmxLayersAndGroups(pTmxMapIns *TmxMap, gidBoundariesMapInB2World map[i } *pThePolygon2DListToCache = append(*pThePolygon2DListToCache, thePolygon2DInWorld) } - case "LowScoreTreasure", "GuardTower", "HighScoreTreasure": - /* - Note that in this case, the "Polygon2D.Anchor" of each "TmxOrTsxObject" ISN'T located exactly in an overlapping with "Polygon2D.Points[0]" w.r.t. B2World, refer to "https://shimo.im/docs/SmLJJhXm2C8XMzZT" for details. - - -- YFLu - */ - for _, singleObjInTmxFile := range objGroup.Objects { - if nil == singleObjInTmxFile.Gid { - continue - } - theGlobalGid := singleObjInTmxFile.Gid - theStrToPolygon2DListMap, ok := gidBoundariesMapInB2World[*theGlobalGid] - if false == ok { - continue - } - - pThePolygon2DList, ok := theStrToPolygon2DListMap[objGroup.Name] - if false == ok { - continue - } - - var pThePolygon2DListToCache *Polygon2DList - _, ok = toRetStrToPolygon2DListMap[objGroup.Name] - if false == ok { - thePolygon2DListToCache := make(Polygon2DList, 0) - toRetStrToPolygon2DListMap[objGroup.Name] = &thePolygon2DListToCache - pThePolygon2DListToCache = toRetStrToPolygon2DListMap[objGroup.Name] - } else { - pThePolygon2DListToCache = toRetStrToPolygon2DListMap[objGroup.Name] - } - - for _, thePolygon2D := range *pThePolygon2DList { - theUntransformedBottomCenterAsAnchor := &Vec2D{ - X: singleObjInTmxFile.X, - Y: singleObjInTmxFile.Y, - } - - theTransformedBottomCenterAsAnchor := pTmxMapIns.continuousObjLayerOffsetToContinuousMapNodePos(theUntransformedBottomCenterAsAnchor) - - thePolygon2DInWorld := &Polygon2D{ - Anchor: &theTransformedBottomCenterAsAnchor, - Points: make([]*Vec2D, len(thePolygon2D.Points)), - TileWidth: thePolygon2D.TileWidth, - TileHeight: thePolygon2D.TileHeight, - } - if nil != singleObjInTmxFile.Width && nil != singleObjInTmxFile.Height { - thePolygon2DInWorld.TmxObjectWidth = *singleObjInTmxFile.Width - thePolygon2DInWorld.TmxObjectHeight = *singleObjInTmxFile.Height - } - for kk, p := range thePolygon2D.Points { - // [WARNING] It's intentionally recreating a copy of "Vec2D" here. - thePolygon2DInWorld.Points[kk] = &Vec2D{ - X: p.X, - Y: p.Y, - } - } - *pThePolygon2DListToCache = append(*pThePolygon2DListToCache, thePolygon2DInWorld) - } - } default: } } diff --git a/battle_srv/models/trap.go b/battle_srv/models/trap.go deleted file mode 100644 index 0474a02..0000000 --- a/battle_srv/models/trap.go +++ /dev/null @@ -1,39 +0,0 @@ -package models - -import ( - "github.com/ByteArena/box2d" -) - -type Trap struct { - Id int32 `json:"id,omitempty"` - LocalIdInBattle int32 `json:"localIdInBattle,omitempty"` - Type int32 `json:"type,omitempty"` - X float64 `json:"x,omitempty"` - Y float64 `json:"y,omitempty"` - Removed bool `json:"removed,omitempty"` - PickupBoundary *Polygon2D `json:"-"` - TrapBullets []*Bullet `json:"-"` - CollidableBody *box2d.B2Body `json:"-"` - RemovedAtFrameId int32 `json:"-"` -} - -type GuardTower struct { - Id int32 `json:"id,omitempty"` - LocalIdInBattle int32 `json:"localIdInBattle,omitempty"` - Type int32 `json:"type,omitempty"` - X float64 `json:"x,omitempty"` - Y float64 `json:"y,omitempty"` - Removed bool `json:"removed,omitempty"` - PickupBoundary *Polygon2D `json:"-"` - TrapBullets []*Bullet `json:"-"` - CollidableBody *box2d.B2Body `json:"-"` - RemovedAtFrameId int32 `json:"-"` - - InRangePlayers *InRangePlayerCollection `json:"-"` - LastAttackTick int64 `json:"-"` - - TileWidth float64 `json:"-"` - TileHeight float64 `json:"-"` - WidthInB2World float64 `json:"-"` - HeightInB2World float64 `json:"-"` -} diff --git a/battle_srv/models/treasure.go b/battle_srv/models/treasure.go deleted file mode 100644 index 95f3704..0000000 --- a/battle_srv/models/treasure.go +++ /dev/null @@ -1,18 +0,0 @@ -package models - -import ( - "github.com/ByteArena/box2d" -) - -type Treasure struct { - Id int32 `json:"id,omitempty"` - LocalIdInBattle int32 `json:"localIdInBattle,omitempty"` - Score int32 `json:"score,omitempty"` - X float64 `json:"x,omitempty"` - Y float64 `json:"y,omitempty"` - Removed bool `json:"removed,omitempty"` - Type int32 `json:"type,omitempty"` - - PickupBoundary *Polygon2D `json:"-"` - CollidableBody *box2d.B2Body `json:"-"` -} diff --git a/battle_srv/pb_output/room_downsync_frame.pb.go b/battle_srv/pb_output/room_downsync_frame.pb.go index 7f19732..5693445 100644 --- a/battle_srv/pb_output/room_downsync_frame.pb.go +++ b/battle_srv/pb_output/room_downsync_frame.pb.go @@ -596,536 +596,6 @@ func (x *PlayerMeta) GetJoinIndex() int32 { return 0 } -type Treasure struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - LocalIdInBattle int32 `protobuf:"varint,2,opt,name=localIdInBattle,proto3" json:"localIdInBattle,omitempty"` - Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` - X float64 `protobuf:"fixed64,4,opt,name=x,proto3" json:"x,omitempty"` - Y float64 `protobuf:"fixed64,5,opt,name=y,proto3" json:"y,omitempty"` - Removed bool `protobuf:"varint,6,opt,name=removed,proto3" json:"removed,omitempty"` - Type int32 `protobuf:"varint,7,opt,name=type,proto3" json:"type,omitempty"` -} - -func (x *Treasure) Reset() { - *x = Treasure{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Treasure) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Treasure) ProtoMessage() {} - -func (x *Treasure) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[8] - 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 Treasure.ProtoReflect.Descriptor instead. -func (*Treasure) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{8} -} - -func (x *Treasure) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Treasure) GetLocalIdInBattle() int32 { - if x != nil { - return x.LocalIdInBattle - } - return 0 -} - -func (x *Treasure) GetScore() int32 { - if x != nil { - return x.Score - } - return 0 -} - -func (x *Treasure) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *Treasure) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -func (x *Treasure) GetRemoved() bool { - if x != nil { - return x.Removed - } - return false -} - -func (x *Treasure) GetType() int32 { - if x != nil { - return x.Type - } - return 0 -} - -type Bullet struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LocalIdInBattle int32 `protobuf:"varint,1,opt,name=localIdInBattle,proto3" json:"localIdInBattle,omitempty"` - LinearSpeed float64 `protobuf:"fixed64,2,opt,name=linearSpeed,proto3" json:"linearSpeed,omitempty"` - X float64 `protobuf:"fixed64,3,opt,name=x,proto3" json:"x,omitempty"` - Y float64 `protobuf:"fixed64,4,opt,name=y,proto3" json:"y,omitempty"` - Removed bool `protobuf:"varint,5,opt,name=removed,proto3" json:"removed,omitempty"` - StartAtPoint *Vec2D `protobuf:"bytes,6,opt,name=startAtPoint,proto3" json:"startAtPoint,omitempty"` - EndAtPoint *Vec2D `protobuf:"bytes,7,opt,name=endAtPoint,proto3" json:"endAtPoint,omitempty"` -} - -func (x *Bullet) Reset() { - *x = Bullet{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Bullet) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Bullet) ProtoMessage() {} - -func (x *Bullet) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[9] - 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 Bullet.ProtoReflect.Descriptor instead. -func (*Bullet) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{9} -} - -func (x *Bullet) GetLocalIdInBattle() int32 { - if x != nil { - return x.LocalIdInBattle - } - return 0 -} - -func (x *Bullet) GetLinearSpeed() float64 { - if x != nil { - return x.LinearSpeed - } - return 0 -} - -func (x *Bullet) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *Bullet) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -func (x *Bullet) GetRemoved() bool { - if x != nil { - return x.Removed - } - return false -} - -func (x *Bullet) GetStartAtPoint() *Vec2D { - if x != nil { - return x.StartAtPoint - } - return nil -} - -func (x *Bullet) GetEndAtPoint() *Vec2D { - if x != nil { - return x.EndAtPoint - } - return nil -} - -type Trap struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - LocalIdInBattle int32 `protobuf:"varint,2,opt,name=localIdInBattle,proto3" json:"localIdInBattle,omitempty"` - Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` - X float64 `protobuf:"fixed64,4,opt,name=x,proto3" json:"x,omitempty"` - Y float64 `protobuf:"fixed64,5,opt,name=y,proto3" json:"y,omitempty"` - Removed bool `protobuf:"varint,6,opt,name=removed,proto3" json:"removed,omitempty"` -} - -func (x *Trap) Reset() { - *x = Trap{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Trap) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Trap) ProtoMessage() {} - -func (x *Trap) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[10] - 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 Trap.ProtoReflect.Descriptor instead. -func (*Trap) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{10} -} - -func (x *Trap) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Trap) GetLocalIdInBattle() int32 { - if x != nil { - return x.LocalIdInBattle - } - return 0 -} - -func (x *Trap) GetType() int32 { - if x != nil { - return x.Type - } - return 0 -} - -func (x *Trap) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *Trap) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -func (x *Trap) GetRemoved() bool { - if x != nil { - return x.Removed - } - return false -} - -type SpeedShoe struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - LocalIdInBattle int32 `protobuf:"varint,2,opt,name=localIdInBattle,proto3" json:"localIdInBattle,omitempty"` - X float64 `protobuf:"fixed64,3,opt,name=x,proto3" json:"x,omitempty"` - Y float64 `protobuf:"fixed64,4,opt,name=y,proto3" json:"y,omitempty"` - Removed bool `protobuf:"varint,5,opt,name=removed,proto3" json:"removed,omitempty"` - Type int32 `protobuf:"varint,6,opt,name=type,proto3" json:"type,omitempty"` -} - -func (x *SpeedShoe) Reset() { - *x = SpeedShoe{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SpeedShoe) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SpeedShoe) ProtoMessage() {} - -func (x *SpeedShoe) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[11] - 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 SpeedShoe.ProtoReflect.Descriptor instead. -func (*SpeedShoe) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{11} -} - -func (x *SpeedShoe) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *SpeedShoe) GetLocalIdInBattle() int32 { - if x != nil { - return x.LocalIdInBattle - } - return 0 -} - -func (x *SpeedShoe) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *SpeedShoe) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -func (x *SpeedShoe) GetRemoved() bool { - if x != nil { - return x.Removed - } - return false -} - -func (x *SpeedShoe) GetType() int32 { - if x != nil { - return x.Type - } - return 0 -} - -type Pumpkin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LocalIdInBattle int32 `protobuf:"varint,1,opt,name=localIdInBattle,proto3" json:"localIdInBattle,omitempty"` - LinearSpeed float64 `protobuf:"fixed64,2,opt,name=linearSpeed,proto3" json:"linearSpeed,omitempty"` - X float64 `protobuf:"fixed64,3,opt,name=x,proto3" json:"x,omitempty"` - Y float64 `protobuf:"fixed64,4,opt,name=y,proto3" json:"y,omitempty"` - Removed bool `protobuf:"varint,5,opt,name=removed,proto3" json:"removed,omitempty"` -} - -func (x *Pumpkin) Reset() { - *x = Pumpkin{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Pumpkin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Pumpkin) ProtoMessage() {} - -func (x *Pumpkin) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[12] - 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 Pumpkin.ProtoReflect.Descriptor instead. -func (*Pumpkin) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{12} -} - -func (x *Pumpkin) GetLocalIdInBattle() int32 { - if x != nil { - return x.LocalIdInBattle - } - return 0 -} - -func (x *Pumpkin) GetLinearSpeed() float64 { - if x != nil { - return x.LinearSpeed - } - return 0 -} - -func (x *Pumpkin) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *Pumpkin) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -func (x *Pumpkin) GetRemoved() bool { - if x != nil { - return x.Removed - } - return false -} - -type GuardTower struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - LocalIdInBattle int32 `protobuf:"varint,2,opt,name=localIdInBattle,proto3" json:"localIdInBattle,omitempty"` - Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` - X float64 `protobuf:"fixed64,4,opt,name=x,proto3" json:"x,omitempty"` - Y float64 `protobuf:"fixed64,5,opt,name=y,proto3" json:"y,omitempty"` - Removed bool `protobuf:"varint,6,opt,name=removed,proto3" json:"removed,omitempty"` -} - -func (x *GuardTower) Reset() { - *x = GuardTower{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GuardTower) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GuardTower) ProtoMessage() {} - -func (x *GuardTower) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[13] - 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 GuardTower.ProtoReflect.Descriptor instead. -func (*GuardTower) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{13} -} - -func (x *GuardTower) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *GuardTower) GetLocalIdInBattle() int32 { - if x != nil { - return x.LocalIdInBattle - } - return 0 -} - -func (x *GuardTower) GetType() int32 { - if x != nil { - return x.Type - } - return 0 -} - -func (x *GuardTower) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *GuardTower) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -func (x *GuardTower) GetRemoved() bool { - if x != nil { - return x.Removed - } - return false -} - type RoomDownsyncFrame struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1136,18 +606,13 @@ type RoomDownsyncFrame struct { Players map[int32]*Player `protobuf:"bytes,3,rep,name=players,proto3" json:"players,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` SentAt int64 `protobuf:"varint,4,opt,name=sentAt,proto3" json:"sentAt,omitempty"` CountdownNanos int64 `protobuf:"varint,5,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"` - Treasures map[int32]*Treasure `protobuf:"bytes,6,rep,name=treasures,proto3" json:"treasures,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Traps map[int32]*Trap `protobuf:"bytes,7,rep,name=traps,proto3" json:"traps,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Bullets map[int32]*Bullet `protobuf:"bytes,8,rep,name=bullets,proto3" json:"bullets,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SpeedShoes map[int32]*SpeedShoe `protobuf:"bytes,9,rep,name=speedShoes,proto3" json:"speedShoes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - GuardTowers map[int32]*GuardTower `protobuf:"bytes,10,rep,name=guardTowers,proto3" json:"guardTowers,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - PlayerMetas map[int32]*PlayerMeta `protobuf:"bytes,11,rep,name=playerMetas,proto3" json:"playerMetas,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + PlayerMetas map[int32]*PlayerMeta `protobuf:"bytes,6,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() { *x = RoomDownsyncFrame{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[14] + mi := &file_room_downsync_frame_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1160,7 +625,7 @@ func (x *RoomDownsyncFrame) String() string { func (*RoomDownsyncFrame) ProtoMessage() {} func (x *RoomDownsyncFrame) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[14] + mi := &file_room_downsync_frame_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1173,7 +638,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{14} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{8} } func (x *RoomDownsyncFrame) GetId() int32 { @@ -1211,41 +676,6 @@ func (x *RoomDownsyncFrame) GetCountdownNanos() int64 { return 0 } -func (x *RoomDownsyncFrame) GetTreasures() map[int32]*Treasure { - if x != nil { - return x.Treasures - } - return nil -} - -func (x *RoomDownsyncFrame) GetTraps() map[int32]*Trap { - if x != nil { - return x.Traps - } - return nil -} - -func (x *RoomDownsyncFrame) GetBullets() map[int32]*Bullet { - if x != nil { - return x.Bullets - } - return nil -} - -func (x *RoomDownsyncFrame) GetSpeedShoes() map[int32]*SpeedShoe { - if x != nil { - return x.SpeedShoes - } - return nil -} - -func (x *RoomDownsyncFrame) GetGuardTowers() map[int32]*GuardTower { - if x != nil { - return x.GuardTowers - } - return nil -} - func (x *RoomDownsyncFrame) GetPlayerMetas() map[int32]*PlayerMeta { if x != nil { return x.PlayerMetas @@ -1265,7 +695,7 @@ type InputFrameUpsync struct { func (x *InputFrameUpsync) Reset() { *x = InputFrameUpsync{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[15] + mi := &file_room_downsync_frame_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1278,7 +708,7 @@ func (x *InputFrameUpsync) String() string { func (*InputFrameUpsync) ProtoMessage() {} func (x *InputFrameUpsync) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[15] + mi := &file_room_downsync_frame_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1291,7 +721,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{15} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{9} } func (x *InputFrameUpsync) GetInputFrameId() int32 { @@ -1321,7 +751,7 @@ type InputFrameDownsync struct { func (x *InputFrameDownsync) Reset() { *x = InputFrameDownsync{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[16] + mi := &file_room_downsync_frame_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1334,7 +764,7 @@ func (x *InputFrameDownsync) String() string { func (*InputFrameDownsync) ProtoMessage() {} func (x *InputFrameDownsync) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[16] + mi := &file_room_downsync_frame_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1347,7 +777,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{16} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{10} } func (x *InputFrameDownsync) GetInputFrameId() int32 { @@ -1382,7 +812,7 @@ type HeartbeatUpsync struct { func (x *HeartbeatUpsync) Reset() { *x = HeartbeatUpsync{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[17] + mi := &file_room_downsync_frame_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1395,7 +825,7 @@ func (x *HeartbeatUpsync) String() string { func (*HeartbeatUpsync) ProtoMessage() {} func (x *HeartbeatUpsync) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[17] + mi := &file_room_downsync_frame_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1408,7 +838,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{17} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{11} } func (x *HeartbeatUpsync) GetClientTimestamp() int64 { @@ -1436,7 +866,7 @@ type WsReq struct { func (x *WsReq) Reset() { *x = WsReq{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[18] + mi := &file_room_downsync_frame_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1449,7 +879,7 @@ func (x *WsReq) String() string { func (*WsReq) ProtoMessage() {} func (x *WsReq) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[18] + mi := &file_room_downsync_frame_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1462,7 +892,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{18} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{12} } func (x *WsReq) GetMsgId() int32 { @@ -1537,7 +967,7 @@ type WsResp struct { func (x *WsResp) Reset() { *x = WsResp{} if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[19] + mi := &file_room_downsync_frame_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1550,7 +980,7 @@ func (x *WsResp) String() string { func (*WsResp) ProtoMessage() {} func (x *WsResp) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[19] + mi := &file_room_downsync_frame_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1563,7 +993,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{19} + return file_room_downsync_frame_proto_rawDescGZIP(), []int{13} } func (x *WsResp) GetRet() int32 { @@ -1708,208 +1138,94 @@ var file_room_downsync_frame_proto_rawDesc = []byte{ 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, 0x22, 0xa4, 0x01, 0x0a, 0x08, 0x54, 0x72, 0x65, 0x61, 0x73, - 0x75, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, - 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, - 0x6f, 0x72, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, - 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x79, 0x12, - 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xfe, 0x01, - 0x0a, 0x06, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x53, 0x70, 0x65, 0x65, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x53, - 0x70, 0x65, 0x65, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x79, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x41, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, - 0x72, 0x78, 0x2e, 0x56, 0x65, 0x63, 0x32, 0x44, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, - 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x50, - 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x72, 0x65, - 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x56, 0x65, 0x63, - 0x32, 0x44, 0x52, 0x0a, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x8a, - 0x01, 0x0a, 0x04, 0x54, 0x72, 0x61, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, - 0x79, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x8f, 0x01, 0x0a, 0x09, - 0x53, 0x70, 0x65, 0x65, 0x64, 0x53, 0x68, 0x6f, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, - 0x74, 0x6c, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, - 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x79, 0x12, - 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x8b, 0x01, - 0x0a, 0x07, 0x50, 0x75, 0x6d, 0x70, 0x6b, 0x69, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, - 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x53, 0x70, 0x65, - 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, - 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, - 0x79, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x90, 0x01, 0x0a, 0x0a, - 0x47, 0x75, 0x61, 0x72, 0x64, 0x54, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x49, 0x6e, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x01, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x9a, - 0x0a, 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, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x46, 0x72, 0x61, 0x6d, 0x65, - 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x46, 0x72, 0x61, - 0x6d, 0x65, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, - 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 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, - 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x73, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, - 0x4f, 0x0a, 0x09, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, - 0x74, 0x65, 0x72, 0x78, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, - 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x54, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x73, - 0x12, 0x43, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x70, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, - 0x78, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, - 0x61, 0x6d, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, - 0x74, 0x72, 0x61, 0x70, 0x73, 0x12, 0x49, 0x0a, 0x07, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, - 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, - 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x42, 0x75, 0x6c, 0x6c, 0x65, - 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, - 0x12, 0x52, 0x0a, 0x0a, 0x73, 0x70, 0x65, 0x65, 0x64, 0x53, 0x68, 0x6f, 0x65, 0x73, 0x18, 0x09, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, - 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, - 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x53, 0x70, 0x65, 0x65, 0x64, 0x53, 0x68, - 0x6f, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x73, 0x70, 0x65, 0x65, 0x64, 0x53, - 0x68, 0x6f, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x0b, 0x67, 0x75, 0x61, 0x72, 0x64, 0x54, 0x6f, 0x77, - 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, 0x72, 0x65, 0x61, - 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, - 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x47, 0x75, - 0x61, 0x72, 0x64, 0x54, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, - 0x67, 0x75, 0x61, 0x72, 0x64, 0x54, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x12, 0x55, 0x0a, 0x0b, 0x70, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x33, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, - 0x72, 0x78, 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, 0x53, 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, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, - 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x57, 0x0a, 0x0e, 0x54, 0x72, 0x65, 0x61, 0x73, - 0x75, 0x72, 0x65, 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, 0x2f, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x72, 0x65, - 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x54, 0x72, 0x65, - 0x61, 0x73, 0x75, 0x72, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x4f, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xd7, 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, 0x1e, 0x0a, 0x0a, + 0x72, 0x65, 0x66, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x72, 0x65, 0x66, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x07, + 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, + 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 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, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x74, 0x41, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x12, + 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, + 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x55, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, + 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 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, 0x53, + 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, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, - 0x78, 0x2e, 0x54, 0x72, 0x61, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x53, 0x0a, 0x0c, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 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, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, - 0x74, 0x65, 0x72, 0x78, 0x2e, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x0f, 0x53, 0x70, 0x65, 0x65, 0x64, 0x53, - 0x68, 0x6f, 0x65, 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, 0x74, 0x72, 0x65, - 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x53, 0x70, 0x65, - 0x65, 0x64, 0x53, 0x68, 0x6f, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x5b, 0x0a, 0x10, 0x47, 0x75, 0x61, 0x72, 0x64, 0x54, 0x6f, 0x77, 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, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, - 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x47, 0x75, 0x61, 0x72, 0x64, 0x54, 0x6f, - 0x77, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5b, - 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, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, - 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x56, 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, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x44, 0x69, - 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, - 0x44, 0x69, 0x72, 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, 0xca, - 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, 0x57, 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, - 0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, - 0x78, 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, 0x30, 0x0a, 0x02, 0x68, 0x62, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, - 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, - 0x74, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x02, 0x68, 0x62, 0x22, 0xa4, 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, 0x34, 0x0a, 0x03, - 0x72, 0x64, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x72, 0x65, 0x61, - 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, - 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x03, 0x72, - 0x64, 0x66, 0x12, 0x5d, 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, 0x23, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, - 0x6e, 0x74, 0x65, 0x72, 0x78, 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, 0x3f, 0x0a, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, - 0x6e, 0x74, 0x65, 0x72, 0x78, 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, 0x03, 0x5a, 0x01, 0x2e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x78, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x5b, 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, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, + 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x56, 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, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x64, 0x44, 0x69, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x64, 0x44, 0x69, 0x72, 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, 0xca, 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, 0x57, 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, 0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 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, 0x30, + 0x0a, 0x02, 0x68, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x72, 0x65, + 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x48, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x02, 0x68, 0x62, + 0x22, 0xa4, 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, 0x34, 0x0a, 0x03, 0x72, 0x64, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, + 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x52, 0x03, 0x72, 0x64, 0x66, 0x12, 0x5d, 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, 0x23, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, + 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 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, 0x3f, 0x0a, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, + 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 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, 0x03, 0x5a, 0x01, 0x2e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1924,7 +1240,7 @@ 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, 29) +var file_room_downsync_frame_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_room_downsync_frame_proto_goTypes = []interface{}{ (*Direction)(nil), // 0: treasurehunterx.Direction (*Vec2D)(nil), // 1: treasurehunterx.Vec2D @@ -1934,64 +1250,41 @@ var file_room_downsync_frame_proto_goTypes = []interface{}{ (*BattleColliderInfo)(nil), // 5: treasurehunterx.BattleColliderInfo (*Player)(nil), // 6: treasurehunterx.Player (*PlayerMeta)(nil), // 7: treasurehunterx.PlayerMeta - (*Treasure)(nil), // 8: treasurehunterx.Treasure - (*Bullet)(nil), // 9: treasurehunterx.Bullet - (*Trap)(nil), // 10: treasurehunterx.Trap - (*SpeedShoe)(nil), // 11: treasurehunterx.SpeedShoe - (*Pumpkin)(nil), // 12: treasurehunterx.Pumpkin - (*GuardTower)(nil), // 13: treasurehunterx.GuardTower - (*RoomDownsyncFrame)(nil), // 14: treasurehunterx.RoomDownsyncFrame - (*InputFrameUpsync)(nil), // 15: treasurehunterx.InputFrameUpsync - (*InputFrameDownsync)(nil), // 16: treasurehunterx.InputFrameDownsync - (*HeartbeatUpsync)(nil), // 17: treasurehunterx.HeartbeatUpsync - (*WsReq)(nil), // 18: treasurehunterx.WsReq - (*WsResp)(nil), // 19: treasurehunterx.WsResp - nil, // 20: treasurehunterx.BattleColliderInfo.StrToVec2DListMapEntry - nil, // 21: treasurehunterx.BattleColliderInfo.StrToPolygon2DListMapEntry - nil, // 22: treasurehunterx.RoomDownsyncFrame.PlayersEntry - nil, // 23: treasurehunterx.RoomDownsyncFrame.TreasuresEntry - nil, // 24: treasurehunterx.RoomDownsyncFrame.TrapsEntry - nil, // 25: treasurehunterx.RoomDownsyncFrame.BulletsEntry - nil, // 26: treasurehunterx.RoomDownsyncFrame.SpeedShoesEntry - nil, // 27: treasurehunterx.RoomDownsyncFrame.GuardTowersEntry - nil, // 28: treasurehunterx.RoomDownsyncFrame.PlayerMetasEntry + (*RoomDownsyncFrame)(nil), // 8: treasurehunterx.RoomDownsyncFrame + (*InputFrameUpsync)(nil), // 9: treasurehunterx.InputFrameUpsync + (*InputFrameDownsync)(nil), // 10: treasurehunterx.InputFrameDownsync + (*HeartbeatUpsync)(nil), // 11: treasurehunterx.HeartbeatUpsync + (*WsReq)(nil), // 12: treasurehunterx.WsReq + (*WsResp)(nil), // 13: treasurehunterx.WsResp + nil, // 14: treasurehunterx.BattleColliderInfo.StrToVec2DListMapEntry + nil, // 15: treasurehunterx.BattleColliderInfo.StrToPolygon2DListMapEntry + nil, // 16: treasurehunterx.RoomDownsyncFrame.PlayersEntry + nil, // 17: treasurehunterx.RoomDownsyncFrame.PlayerMetasEntry } var file_room_downsync_frame_proto_depIdxs = []int32{ 1, // 0: treasurehunterx.Polygon2D.Anchor:type_name -> treasurehunterx.Vec2D 1, // 1: treasurehunterx.Polygon2D.Points:type_name -> treasurehunterx.Vec2D 1, // 2: treasurehunterx.Vec2DList.vec2DList:type_name -> treasurehunterx.Vec2D 2, // 3: treasurehunterx.Polygon2DList.polygon2DList:type_name -> treasurehunterx.Polygon2D - 20, // 4: treasurehunterx.BattleColliderInfo.strToVec2DListMap:type_name -> treasurehunterx.BattleColliderInfo.StrToVec2DListMapEntry - 21, // 5: treasurehunterx.BattleColliderInfo.strToPolygon2DListMap:type_name -> treasurehunterx.BattleColliderInfo.StrToPolygon2DListMapEntry + 14, // 4: treasurehunterx.BattleColliderInfo.strToVec2DListMap:type_name -> treasurehunterx.BattleColliderInfo.StrToVec2DListMapEntry + 15, // 5: treasurehunterx.BattleColliderInfo.strToPolygon2DListMap:type_name -> treasurehunterx.BattleColliderInfo.StrToPolygon2DListMapEntry 0, // 6: treasurehunterx.Player.dir:type_name -> treasurehunterx.Direction - 1, // 7: treasurehunterx.Bullet.startAtPoint:type_name -> treasurehunterx.Vec2D - 1, // 8: treasurehunterx.Bullet.endAtPoint:type_name -> treasurehunterx.Vec2D - 22, // 9: treasurehunterx.RoomDownsyncFrame.players:type_name -> treasurehunterx.RoomDownsyncFrame.PlayersEntry - 23, // 10: treasurehunterx.RoomDownsyncFrame.treasures:type_name -> treasurehunterx.RoomDownsyncFrame.TreasuresEntry - 24, // 11: treasurehunterx.RoomDownsyncFrame.traps:type_name -> treasurehunterx.RoomDownsyncFrame.TrapsEntry - 25, // 12: treasurehunterx.RoomDownsyncFrame.bullets:type_name -> treasurehunterx.RoomDownsyncFrame.BulletsEntry - 26, // 13: treasurehunterx.RoomDownsyncFrame.speedShoes:type_name -> treasurehunterx.RoomDownsyncFrame.SpeedShoesEntry - 27, // 14: treasurehunterx.RoomDownsyncFrame.guardTowers:type_name -> treasurehunterx.RoomDownsyncFrame.GuardTowersEntry - 28, // 15: treasurehunterx.RoomDownsyncFrame.playerMetas:type_name -> treasurehunterx.RoomDownsyncFrame.PlayerMetasEntry - 15, // 16: treasurehunterx.WsReq.inputFrameUpsyncBatch:type_name -> treasurehunterx.InputFrameUpsync - 17, // 17: treasurehunterx.WsReq.hb:type_name -> treasurehunterx.HeartbeatUpsync - 14, // 18: treasurehunterx.WsResp.rdf:type_name -> treasurehunterx.RoomDownsyncFrame - 16, // 19: treasurehunterx.WsResp.inputFrameDownsyncBatch:type_name -> treasurehunterx.InputFrameDownsync - 5, // 20: treasurehunterx.WsResp.bciFrame:type_name -> treasurehunterx.BattleColliderInfo - 3, // 21: treasurehunterx.BattleColliderInfo.StrToVec2DListMapEntry.value:type_name -> treasurehunterx.Vec2DList - 4, // 22: treasurehunterx.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> treasurehunterx.Polygon2DList - 6, // 23: treasurehunterx.RoomDownsyncFrame.PlayersEntry.value:type_name -> treasurehunterx.Player - 8, // 24: treasurehunterx.RoomDownsyncFrame.TreasuresEntry.value:type_name -> treasurehunterx.Treasure - 10, // 25: treasurehunterx.RoomDownsyncFrame.TrapsEntry.value:type_name -> treasurehunterx.Trap - 9, // 26: treasurehunterx.RoomDownsyncFrame.BulletsEntry.value:type_name -> treasurehunterx.Bullet - 11, // 27: treasurehunterx.RoomDownsyncFrame.SpeedShoesEntry.value:type_name -> treasurehunterx.SpeedShoe - 13, // 28: treasurehunterx.RoomDownsyncFrame.GuardTowersEntry.value:type_name -> treasurehunterx.GuardTower - 7, // 29: treasurehunterx.RoomDownsyncFrame.PlayerMetasEntry.value:type_name -> treasurehunterx.PlayerMeta - 30, // [30:30] is the sub-list for method output_type - 30, // [30:30] is the sub-list for method input_type - 30, // [30:30] is the sub-list for extension type_name - 30, // [30:30] is the sub-list for extension extendee - 0, // [0:30] is the sub-list for field type_name + 16, // 7: treasurehunterx.RoomDownsyncFrame.players:type_name -> treasurehunterx.RoomDownsyncFrame.PlayersEntry + 17, // 8: treasurehunterx.RoomDownsyncFrame.playerMetas:type_name -> treasurehunterx.RoomDownsyncFrame.PlayerMetasEntry + 9, // 9: treasurehunterx.WsReq.inputFrameUpsyncBatch:type_name -> treasurehunterx.InputFrameUpsync + 11, // 10: treasurehunterx.WsReq.hb:type_name -> treasurehunterx.HeartbeatUpsync + 8, // 11: treasurehunterx.WsResp.rdf:type_name -> treasurehunterx.RoomDownsyncFrame + 10, // 12: treasurehunterx.WsResp.inputFrameDownsyncBatch:type_name -> treasurehunterx.InputFrameDownsync + 5, // 13: treasurehunterx.WsResp.bciFrame:type_name -> treasurehunterx.BattleColliderInfo + 3, // 14: treasurehunterx.BattleColliderInfo.StrToVec2DListMapEntry.value:type_name -> treasurehunterx.Vec2DList + 4, // 15: treasurehunterx.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> treasurehunterx.Polygon2DList + 6, // 16: treasurehunterx.RoomDownsyncFrame.PlayersEntry.value:type_name -> treasurehunterx.Player + 7, // 17: treasurehunterx.RoomDownsyncFrame.PlayerMetasEntry.value:type_name -> treasurehunterx.PlayerMeta + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_room_downsync_frame_proto_init() } @@ -2097,78 +1390,6 @@ func file_room_downsync_frame_proto_init() { } } file_room_downsync_frame_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Treasure); 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[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Bullet); 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[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Trap); 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[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SpeedShoe); 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[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Pumpkin); 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[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GuardTower); 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[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RoomDownsyncFrame); i { case 0: return &v.state @@ -2180,7 +1401,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InputFrameUpsync); i { case 0: return &v.state @@ -2192,7 +1413,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InputFrameDownsync); i { case 0: return &v.state @@ -2204,7 +1425,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HeartbeatUpsync); i { case 0: return &v.state @@ -2216,7 +1437,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WsReq); i { case 0: return &v.state @@ -2228,7 +1449,7 @@ func file_room_downsync_frame_proto_init() { return nil } } - file_room_downsync_frame_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_room_downsync_frame_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WsResp); i { case 0: return &v.state @@ -2247,7 +1468,7 @@ func file_room_downsync_frame_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_room_downsync_frame_proto_rawDesc, NumEnums: 0, - NumMessages: 29, + NumMessages: 18, NumExtensions: 0, NumServices: 0, }, diff --git a/frontend/assets/resources/pbfiles/room_downsync_frame.proto b/frontend/assets/resources/pbfiles/room_downsync_frame.proto index 9f414cd..a48aa0f 100644 --- a/frontend/assets/resources/pbfiles/room_downsync_frame.proto +++ b/frontend/assets/resources/pbfiles/room_downsync_frame.proto @@ -61,73 +61,13 @@ message PlayerMeta { int32 joinIndex = 5; } -message Treasure { - int32 id = 1; - int32 localIdInBattle = 2; - int32 score = 3; - double x = 4; - double y = 5; - bool removed = 6; - int32 type = 7; -} - -message Bullet { - int32 localIdInBattle = 1; - double linearSpeed = 2; - double x = 3; - double y = 4; - bool removed = 5; - Vec2D startAtPoint = 6; - Vec2D endAtPoint = 7; -} - -message Trap { - int32 id = 1; - int32 localIdInBattle = 2; - int32 type = 3; - double x = 4; - double y = 5; - bool removed = 6; -} - -message SpeedShoe { - int32 id = 1; - int32 localIdInBattle = 2; - double x = 3; - double y = 4; - bool removed = 5; - int32 type = 6; -} - -message Pumpkin { - int32 localIdInBattle = 1; - double linearSpeed = 2; - double x = 3; - double y = 4; - bool removed = 5; -} - -message GuardTower { - int32 id = 1; - int32 localIdInBattle = 2; - int32 type = 3; - double x = 4; - double y = 5; - bool removed = 6; -} - message RoomDownsyncFrame { int32 id = 1; int32 refFrameId = 2; map players = 3; int64 sentAt = 4; int64 countdownNanos = 5; - map treasures = 6; - map traps = 7; - map bullets = 8; - map speedShoes = 9; - map guardTowers = 10; - map playerMetas = 11; + map playerMetas = 6; } message InputFrameUpsync { 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 bd97e12..3cb3729 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 @@ -2381,1953 +2381,6 @@ $root.treasurehunterx = (function() { return PlayerMeta; })(); - treasurehunterx.Treasure = (function() { - - /** - * Properties of a Treasure. - * @memberof treasurehunterx - * @interface ITreasure - * @property {number|null} [id] Treasure id - * @property {number|null} [localIdInBattle] Treasure localIdInBattle - * @property {number|null} [score] Treasure score - * @property {number|null} [x] Treasure x - * @property {number|null} [y] Treasure y - * @property {boolean|null} [removed] Treasure removed - * @property {number|null} [type] Treasure type - */ - - /** - * Constructs a new Treasure. - * @memberof treasurehunterx - * @classdesc Represents a Treasure. - * @implements ITreasure - * @constructor - * @param {treasurehunterx.ITreasure=} [properties] Properties to set - */ - function Treasure(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]]; - } - - /** - * Treasure id. - * @member {number} id - * @memberof treasurehunterx.Treasure - * @instance - */ - Treasure.prototype.id = 0; - - /** - * Treasure localIdInBattle. - * @member {number} localIdInBattle - * @memberof treasurehunterx.Treasure - * @instance - */ - Treasure.prototype.localIdInBattle = 0; - - /** - * Treasure score. - * @member {number} score - * @memberof treasurehunterx.Treasure - * @instance - */ - Treasure.prototype.score = 0; - - /** - * Treasure x. - * @member {number} x - * @memberof treasurehunterx.Treasure - * @instance - */ - Treasure.prototype.x = 0; - - /** - * Treasure y. - * @member {number} y - * @memberof treasurehunterx.Treasure - * @instance - */ - Treasure.prototype.y = 0; - - /** - * Treasure removed. - * @member {boolean} removed - * @memberof treasurehunterx.Treasure - * @instance - */ - Treasure.prototype.removed = false; - - /** - * Treasure type. - * @member {number} type - * @memberof treasurehunterx.Treasure - * @instance - */ - Treasure.prototype.type = 0; - - /** - * Creates a new Treasure instance using the specified properties. - * @function create - * @memberof treasurehunterx.Treasure - * @static - * @param {treasurehunterx.ITreasure=} [properties] Properties to set - * @returns {treasurehunterx.Treasure} Treasure instance - */ - Treasure.create = function create(properties) { - return new Treasure(properties); - }; - - /** - * Encodes the specified Treasure message. Does not implicitly {@link treasurehunterx.Treasure.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Treasure - * @static - * @param {treasurehunterx.Treasure} message Treasure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Treasure.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.localIdInBattle != null && Object.hasOwnProperty.call(message, "localIdInBattle")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.localIdInBattle); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.score); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.y); - if (message.removed != null && Object.hasOwnProperty.call(message, "removed")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.removed); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.type); - return writer; - }; - - /** - * Encodes the specified Treasure message, length delimited. Does not implicitly {@link treasurehunterx.Treasure.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Treasure - * @static - * @param {treasurehunterx.Treasure} message Treasure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Treasure.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Treasure message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Treasure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Treasure} Treasure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Treasure.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.treasurehunterx.Treasure(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.id = reader.int32(); - break; - } - case 2: { - message.localIdInBattle = reader.int32(); - break; - } - case 3: { - message.score = reader.int32(); - break; - } - case 4: { - message.x = reader.double(); - break; - } - case 5: { - message.y = reader.double(); - break; - } - case 6: { - message.removed = reader.bool(); - break; - } - case 7: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Treasure message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Treasure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Treasure} Treasure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Treasure.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Treasure message. - * @function verify - * @memberof treasurehunterx.Treasure - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Treasure.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.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - if (!$util.isInteger(message.localIdInBattle)) - return "localIdInBattle: integer expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (!$util.isInteger(message.score)) - return "score: integer expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; - if (message.removed != null && message.hasOwnProperty("removed")) - if (typeof message.removed !== "boolean") - return "removed: boolean expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isInteger(message.type)) - return "type: integer expected"; - return null; - }; - - /** - * Creates a Treasure message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Treasure - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Treasure} Treasure - */ - Treasure.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Treasure) - return object; - var message = new $root.treasurehunterx.Treasure(); - if (object.id != null) - message.id = object.id | 0; - if (object.localIdInBattle != null) - message.localIdInBattle = object.localIdInBattle | 0; - if (object.score != null) - message.score = object.score | 0; - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - if (object.removed != null) - message.removed = Boolean(object.removed); - if (object.type != null) - message.type = object.type | 0; - return message; - }; - - /** - * Creates a plain object from a Treasure message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Treasure - * @static - * @param {treasurehunterx.Treasure} message Treasure - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Treasure.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = 0; - object.localIdInBattle = 0; - object.score = 0; - object.x = 0; - object.y = 0; - object.removed = false; - object.type = 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - object.localIdInBattle = message.localIdInBattle; - if (message.score != null && message.hasOwnProperty("score")) - object.score = message.score; - if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; - if (message.removed != null && message.hasOwnProperty("removed")) - object.removed = message.removed; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this Treasure to JSON. - * @function toJSON - * @memberof treasurehunterx.Treasure - * @instance - * @returns {Object.} JSON object - */ - Treasure.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Treasure - * @function getTypeUrl - * @memberof treasurehunterx.Treasure - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Treasure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Treasure"; - }; - - return Treasure; - })(); - - treasurehunterx.Bullet = (function() { - - /** - * Properties of a Bullet. - * @memberof treasurehunterx - * @interface IBullet - * @property {number|null} [localIdInBattle] Bullet localIdInBattle - * @property {number|null} [linearSpeed] Bullet linearSpeed - * @property {number|null} [x] Bullet x - * @property {number|null} [y] Bullet y - * @property {boolean|null} [removed] Bullet removed - * @property {treasurehunterx.Vec2D|null} [startAtPoint] Bullet startAtPoint - * @property {treasurehunterx.Vec2D|null} [endAtPoint] Bullet endAtPoint - */ - - /** - * Constructs a new Bullet. - * @memberof treasurehunterx - * @classdesc Represents a Bullet. - * @implements IBullet - * @constructor - * @param {treasurehunterx.IBullet=} [properties] Properties to set - */ - function Bullet(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]]; - } - - /** - * Bullet localIdInBattle. - * @member {number} localIdInBattle - * @memberof treasurehunterx.Bullet - * @instance - */ - Bullet.prototype.localIdInBattle = 0; - - /** - * Bullet linearSpeed. - * @member {number} linearSpeed - * @memberof treasurehunterx.Bullet - * @instance - */ - Bullet.prototype.linearSpeed = 0; - - /** - * Bullet x. - * @member {number} x - * @memberof treasurehunterx.Bullet - * @instance - */ - Bullet.prototype.x = 0; - - /** - * Bullet y. - * @member {number} y - * @memberof treasurehunterx.Bullet - * @instance - */ - Bullet.prototype.y = 0; - - /** - * Bullet removed. - * @member {boolean} removed - * @memberof treasurehunterx.Bullet - * @instance - */ - Bullet.prototype.removed = false; - - /** - * Bullet startAtPoint. - * @member {treasurehunterx.Vec2D|null|undefined} startAtPoint - * @memberof treasurehunterx.Bullet - * @instance - */ - Bullet.prototype.startAtPoint = null; - - /** - * Bullet endAtPoint. - * @member {treasurehunterx.Vec2D|null|undefined} endAtPoint - * @memberof treasurehunterx.Bullet - * @instance - */ - Bullet.prototype.endAtPoint = null; - - /** - * Creates a new Bullet instance using the specified properties. - * @function create - * @memberof treasurehunterx.Bullet - * @static - * @param {treasurehunterx.IBullet=} [properties] Properties to set - * @returns {treasurehunterx.Bullet} Bullet instance - */ - Bullet.create = function create(properties) { - return new Bullet(properties); - }; - - /** - * Encodes the specified Bullet message. Does not implicitly {@link treasurehunterx.Bullet.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Bullet - * @static - * @param {treasurehunterx.Bullet} message Bullet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Bullet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.localIdInBattle != null && Object.hasOwnProperty.call(message, "localIdInBattle")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.localIdInBattle); - if (message.linearSpeed != null && Object.hasOwnProperty.call(message, "linearSpeed")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.linearSpeed); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.y); - if (message.removed != null && Object.hasOwnProperty.call(message, "removed")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.removed); - if (message.startAtPoint != null && Object.hasOwnProperty.call(message, "startAtPoint")) - $root.treasurehunterx.Vec2D.encode(message.startAtPoint, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.endAtPoint != null && Object.hasOwnProperty.call(message, "endAtPoint")) - $root.treasurehunterx.Vec2D.encode(message.endAtPoint, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Bullet message, length delimited. Does not implicitly {@link treasurehunterx.Bullet.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Bullet - * @static - * @param {treasurehunterx.Bullet} message Bullet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Bullet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Bullet message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Bullet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Bullet} Bullet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Bullet.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.treasurehunterx.Bullet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.localIdInBattle = reader.int32(); - break; - } - case 2: { - message.linearSpeed = reader.double(); - break; - } - case 3: { - message.x = reader.double(); - break; - } - case 4: { - message.y = reader.double(); - break; - } - case 5: { - message.removed = reader.bool(); - break; - } - case 6: { - message.startAtPoint = $root.treasurehunterx.Vec2D.decode(reader, reader.uint32()); - break; - } - case 7: { - message.endAtPoint = $root.treasurehunterx.Vec2D.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Bullet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Bullet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Bullet} Bullet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Bullet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Bullet message. - * @function verify - * @memberof treasurehunterx.Bullet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Bullet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - if (!$util.isInteger(message.localIdInBattle)) - return "localIdInBattle: integer expected"; - if (message.linearSpeed != null && message.hasOwnProperty("linearSpeed")) - if (typeof message.linearSpeed !== "number") - return "linearSpeed: number expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; - if (message.removed != null && message.hasOwnProperty("removed")) - if (typeof message.removed !== "boolean") - return "removed: boolean expected"; - if (message.startAtPoint != null && message.hasOwnProperty("startAtPoint")) { - var error = $root.treasurehunterx.Vec2D.verify(message.startAtPoint); - if (error) - return "startAtPoint." + error; - } - if (message.endAtPoint != null && message.hasOwnProperty("endAtPoint")) { - var error = $root.treasurehunterx.Vec2D.verify(message.endAtPoint); - if (error) - return "endAtPoint." + error; - } - return null; - }; - - /** - * Creates a Bullet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Bullet - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Bullet} Bullet - */ - Bullet.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Bullet) - return object; - var message = new $root.treasurehunterx.Bullet(); - if (object.localIdInBattle != null) - message.localIdInBattle = object.localIdInBattle | 0; - if (object.linearSpeed != null) - message.linearSpeed = Number(object.linearSpeed); - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - if (object.removed != null) - message.removed = Boolean(object.removed); - if (object.startAtPoint != null) { - if (typeof object.startAtPoint !== "object") - throw TypeError(".treasurehunterx.Bullet.startAtPoint: object expected"); - message.startAtPoint = $root.treasurehunterx.Vec2D.fromObject(object.startAtPoint); - } - if (object.endAtPoint != null) { - if (typeof object.endAtPoint !== "object") - throw TypeError(".treasurehunterx.Bullet.endAtPoint: object expected"); - message.endAtPoint = $root.treasurehunterx.Vec2D.fromObject(object.endAtPoint); - } - return message; - }; - - /** - * Creates a plain object from a Bullet message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Bullet - * @static - * @param {treasurehunterx.Bullet} message Bullet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Bullet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.localIdInBattle = 0; - object.linearSpeed = 0; - object.x = 0; - object.y = 0; - object.removed = false; - object.startAtPoint = null; - object.endAtPoint = null; - } - if (message.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - object.localIdInBattle = message.localIdInBattle; - if (message.linearSpeed != null && message.hasOwnProperty("linearSpeed")) - object.linearSpeed = options.json && !isFinite(message.linearSpeed) ? String(message.linearSpeed) : message.linearSpeed; - if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; - if (message.removed != null && message.hasOwnProperty("removed")) - object.removed = message.removed; - if (message.startAtPoint != null && message.hasOwnProperty("startAtPoint")) - object.startAtPoint = $root.treasurehunterx.Vec2D.toObject(message.startAtPoint, options); - if (message.endAtPoint != null && message.hasOwnProperty("endAtPoint")) - object.endAtPoint = $root.treasurehunterx.Vec2D.toObject(message.endAtPoint, options); - return object; - }; - - /** - * Converts this Bullet to JSON. - * @function toJSON - * @memberof treasurehunterx.Bullet - * @instance - * @returns {Object.} JSON object - */ - Bullet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Bullet - * @function getTypeUrl - * @memberof treasurehunterx.Bullet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Bullet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Bullet"; - }; - - return Bullet; - })(); - - treasurehunterx.Trap = (function() { - - /** - * Properties of a Trap. - * @memberof treasurehunterx - * @interface ITrap - * @property {number|null} [id] Trap id - * @property {number|null} [localIdInBattle] Trap localIdInBattle - * @property {number|null} [type] Trap type - * @property {number|null} [x] Trap x - * @property {number|null} [y] Trap y - * @property {boolean|null} [removed] Trap removed - */ - - /** - * Constructs a new Trap. - * @memberof treasurehunterx - * @classdesc Represents a Trap. - * @implements ITrap - * @constructor - * @param {treasurehunterx.ITrap=} [properties] Properties to set - */ - function Trap(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]]; - } - - /** - * Trap id. - * @member {number} id - * @memberof treasurehunterx.Trap - * @instance - */ - Trap.prototype.id = 0; - - /** - * Trap localIdInBattle. - * @member {number} localIdInBattle - * @memberof treasurehunterx.Trap - * @instance - */ - Trap.prototype.localIdInBattle = 0; - - /** - * Trap type. - * @member {number} type - * @memberof treasurehunterx.Trap - * @instance - */ - Trap.prototype.type = 0; - - /** - * Trap x. - * @member {number} x - * @memberof treasurehunterx.Trap - * @instance - */ - Trap.prototype.x = 0; - - /** - * Trap y. - * @member {number} y - * @memberof treasurehunterx.Trap - * @instance - */ - Trap.prototype.y = 0; - - /** - * Trap removed. - * @member {boolean} removed - * @memberof treasurehunterx.Trap - * @instance - */ - Trap.prototype.removed = false; - - /** - * Creates a new Trap instance using the specified properties. - * @function create - * @memberof treasurehunterx.Trap - * @static - * @param {treasurehunterx.ITrap=} [properties] Properties to set - * @returns {treasurehunterx.Trap} Trap instance - */ - Trap.create = function create(properties) { - return new Trap(properties); - }; - - /** - * Encodes the specified Trap message. Does not implicitly {@link treasurehunterx.Trap.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Trap - * @static - * @param {treasurehunterx.Trap} message Trap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Trap.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.localIdInBattle != null && Object.hasOwnProperty.call(message, "localIdInBattle")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.localIdInBattle); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.y); - if (message.removed != null && Object.hasOwnProperty.call(message, "removed")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.removed); - return writer; - }; - - /** - * Encodes the specified Trap message, length delimited. Does not implicitly {@link treasurehunterx.Trap.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Trap - * @static - * @param {treasurehunterx.Trap} message Trap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Trap.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Trap message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Trap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Trap} Trap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Trap.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.treasurehunterx.Trap(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.id = reader.int32(); - break; - } - case 2: { - message.localIdInBattle = reader.int32(); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - case 4: { - message.x = reader.double(); - break; - } - case 5: { - message.y = reader.double(); - break; - } - case 6: { - message.removed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Trap message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Trap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Trap} Trap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Trap.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Trap message. - * @function verify - * @memberof treasurehunterx.Trap - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Trap.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.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - if (!$util.isInteger(message.localIdInBattle)) - return "localIdInBattle: integer expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isInteger(message.type)) - return "type: integer expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; - if (message.removed != null && message.hasOwnProperty("removed")) - if (typeof message.removed !== "boolean") - return "removed: boolean expected"; - return null; - }; - - /** - * Creates a Trap message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Trap - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Trap} Trap - */ - Trap.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Trap) - return object; - var message = new $root.treasurehunterx.Trap(); - if (object.id != null) - message.id = object.id | 0; - if (object.localIdInBattle != null) - message.localIdInBattle = object.localIdInBattle | 0; - if (object.type != null) - message.type = object.type | 0; - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - if (object.removed != null) - message.removed = Boolean(object.removed); - return message; - }; - - /** - * Creates a plain object from a Trap message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Trap - * @static - * @param {treasurehunterx.Trap} message Trap - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Trap.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = 0; - object.localIdInBattle = 0; - object.type = 0; - object.x = 0; - object.y = 0; - object.removed = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - object.localIdInBattle = message.localIdInBattle; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; - if (message.removed != null && message.hasOwnProperty("removed")) - object.removed = message.removed; - return object; - }; - - /** - * Converts this Trap to JSON. - * @function toJSON - * @memberof treasurehunterx.Trap - * @instance - * @returns {Object.} JSON object - */ - Trap.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Trap - * @function getTypeUrl - * @memberof treasurehunterx.Trap - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Trap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Trap"; - }; - - return Trap; - })(); - - treasurehunterx.SpeedShoe = (function() { - - /** - * Properties of a SpeedShoe. - * @memberof treasurehunterx - * @interface ISpeedShoe - * @property {number|null} [id] SpeedShoe id - * @property {number|null} [localIdInBattle] SpeedShoe localIdInBattle - * @property {number|null} [x] SpeedShoe x - * @property {number|null} [y] SpeedShoe y - * @property {boolean|null} [removed] SpeedShoe removed - * @property {number|null} [type] SpeedShoe type - */ - - /** - * Constructs a new SpeedShoe. - * @memberof treasurehunterx - * @classdesc Represents a SpeedShoe. - * @implements ISpeedShoe - * @constructor - * @param {treasurehunterx.ISpeedShoe=} [properties] Properties to set - */ - function SpeedShoe(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]]; - } - - /** - * SpeedShoe id. - * @member {number} id - * @memberof treasurehunterx.SpeedShoe - * @instance - */ - SpeedShoe.prototype.id = 0; - - /** - * SpeedShoe localIdInBattle. - * @member {number} localIdInBattle - * @memberof treasurehunterx.SpeedShoe - * @instance - */ - SpeedShoe.prototype.localIdInBattle = 0; - - /** - * SpeedShoe x. - * @member {number} x - * @memberof treasurehunterx.SpeedShoe - * @instance - */ - SpeedShoe.prototype.x = 0; - - /** - * SpeedShoe y. - * @member {number} y - * @memberof treasurehunterx.SpeedShoe - * @instance - */ - SpeedShoe.prototype.y = 0; - - /** - * SpeedShoe removed. - * @member {boolean} removed - * @memberof treasurehunterx.SpeedShoe - * @instance - */ - SpeedShoe.prototype.removed = false; - - /** - * SpeedShoe type. - * @member {number} type - * @memberof treasurehunterx.SpeedShoe - * @instance - */ - SpeedShoe.prototype.type = 0; - - /** - * Creates a new SpeedShoe instance using the specified properties. - * @function create - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {treasurehunterx.ISpeedShoe=} [properties] Properties to set - * @returns {treasurehunterx.SpeedShoe} SpeedShoe instance - */ - SpeedShoe.create = function create(properties) { - return new SpeedShoe(properties); - }; - - /** - * Encodes the specified SpeedShoe message. Does not implicitly {@link treasurehunterx.SpeedShoe.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {treasurehunterx.SpeedShoe} message SpeedShoe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpeedShoe.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.localIdInBattle != null && Object.hasOwnProperty.call(message, "localIdInBattle")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.localIdInBattle); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.y); - if (message.removed != null && Object.hasOwnProperty.call(message, "removed")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.removed); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.type); - return writer; - }; - - /** - * Encodes the specified SpeedShoe message, length delimited. Does not implicitly {@link treasurehunterx.SpeedShoe.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {treasurehunterx.SpeedShoe} message SpeedShoe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpeedShoe.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpeedShoe message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.SpeedShoe} SpeedShoe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpeedShoe.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.treasurehunterx.SpeedShoe(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.id = reader.int32(); - break; - } - case 2: { - message.localIdInBattle = reader.int32(); - break; - } - case 3: { - message.x = reader.double(); - break; - } - case 4: { - message.y = reader.double(); - break; - } - case 5: { - message.removed = reader.bool(); - break; - } - case 6: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpeedShoe message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.SpeedShoe} SpeedShoe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpeedShoe.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpeedShoe message. - * @function verify - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpeedShoe.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.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - if (!$util.isInteger(message.localIdInBattle)) - return "localIdInBattle: integer expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; - if (message.removed != null && message.hasOwnProperty("removed")) - if (typeof message.removed !== "boolean") - return "removed: boolean expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isInteger(message.type)) - return "type: integer expected"; - return null; - }; - - /** - * Creates a SpeedShoe message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.SpeedShoe} SpeedShoe - */ - SpeedShoe.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.SpeedShoe) - return object; - var message = new $root.treasurehunterx.SpeedShoe(); - if (object.id != null) - message.id = object.id | 0; - if (object.localIdInBattle != null) - message.localIdInBattle = object.localIdInBattle | 0; - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - if (object.removed != null) - message.removed = Boolean(object.removed); - if (object.type != null) - message.type = object.type | 0; - return message; - }; - - /** - * Creates a plain object from a SpeedShoe message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {treasurehunterx.SpeedShoe} message SpeedShoe - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpeedShoe.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = 0; - object.localIdInBattle = 0; - object.x = 0; - object.y = 0; - object.removed = false; - object.type = 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - object.localIdInBattle = message.localIdInBattle; - if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; - if (message.removed != null && message.hasOwnProperty("removed")) - object.removed = message.removed; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this SpeedShoe to JSON. - * @function toJSON - * @memberof treasurehunterx.SpeedShoe - * @instance - * @returns {Object.} JSON object - */ - SpeedShoe.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpeedShoe - * @function getTypeUrl - * @memberof treasurehunterx.SpeedShoe - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpeedShoe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.SpeedShoe"; - }; - - return SpeedShoe; - })(); - - treasurehunterx.Pumpkin = (function() { - - /** - * Properties of a Pumpkin. - * @memberof treasurehunterx - * @interface IPumpkin - * @property {number|null} [localIdInBattle] Pumpkin localIdInBattle - * @property {number|null} [linearSpeed] Pumpkin linearSpeed - * @property {number|null} [x] Pumpkin x - * @property {number|null} [y] Pumpkin y - * @property {boolean|null} [removed] Pumpkin removed - */ - - /** - * Constructs a new Pumpkin. - * @memberof treasurehunterx - * @classdesc Represents a Pumpkin. - * @implements IPumpkin - * @constructor - * @param {treasurehunterx.IPumpkin=} [properties] Properties to set - */ - function Pumpkin(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]]; - } - - /** - * Pumpkin localIdInBattle. - * @member {number} localIdInBattle - * @memberof treasurehunterx.Pumpkin - * @instance - */ - Pumpkin.prototype.localIdInBattle = 0; - - /** - * Pumpkin linearSpeed. - * @member {number} linearSpeed - * @memberof treasurehunterx.Pumpkin - * @instance - */ - Pumpkin.prototype.linearSpeed = 0; - - /** - * Pumpkin x. - * @member {number} x - * @memberof treasurehunterx.Pumpkin - * @instance - */ - Pumpkin.prototype.x = 0; - - /** - * Pumpkin y. - * @member {number} y - * @memberof treasurehunterx.Pumpkin - * @instance - */ - Pumpkin.prototype.y = 0; - - /** - * Pumpkin removed. - * @member {boolean} removed - * @memberof treasurehunterx.Pumpkin - * @instance - */ - Pumpkin.prototype.removed = false; - - /** - * Creates a new Pumpkin instance using the specified properties. - * @function create - * @memberof treasurehunterx.Pumpkin - * @static - * @param {treasurehunterx.IPumpkin=} [properties] Properties to set - * @returns {treasurehunterx.Pumpkin} Pumpkin instance - */ - Pumpkin.create = function create(properties) { - return new Pumpkin(properties); - }; - - /** - * Encodes the specified Pumpkin message. Does not implicitly {@link treasurehunterx.Pumpkin.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Pumpkin - * @static - * @param {treasurehunterx.Pumpkin} message Pumpkin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Pumpkin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.localIdInBattle != null && Object.hasOwnProperty.call(message, "localIdInBattle")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.localIdInBattle); - if (message.linearSpeed != null && Object.hasOwnProperty.call(message, "linearSpeed")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.linearSpeed); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.y); - if (message.removed != null && Object.hasOwnProperty.call(message, "removed")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.removed); - return writer; - }; - - /** - * Encodes the specified Pumpkin message, length delimited. Does not implicitly {@link treasurehunterx.Pumpkin.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Pumpkin - * @static - * @param {treasurehunterx.Pumpkin} message Pumpkin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Pumpkin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Pumpkin message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Pumpkin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Pumpkin} Pumpkin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Pumpkin.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.treasurehunterx.Pumpkin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.localIdInBattle = reader.int32(); - break; - } - case 2: { - message.linearSpeed = reader.double(); - break; - } - case 3: { - message.x = reader.double(); - break; - } - case 4: { - message.y = reader.double(); - break; - } - case 5: { - message.removed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Pumpkin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Pumpkin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Pumpkin} Pumpkin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Pumpkin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Pumpkin message. - * @function verify - * @memberof treasurehunterx.Pumpkin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Pumpkin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - if (!$util.isInteger(message.localIdInBattle)) - return "localIdInBattle: integer expected"; - if (message.linearSpeed != null && message.hasOwnProperty("linearSpeed")) - if (typeof message.linearSpeed !== "number") - return "linearSpeed: number expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; - if (message.removed != null && message.hasOwnProperty("removed")) - if (typeof message.removed !== "boolean") - return "removed: boolean expected"; - return null; - }; - - /** - * Creates a Pumpkin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Pumpkin - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Pumpkin} Pumpkin - */ - Pumpkin.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Pumpkin) - return object; - var message = new $root.treasurehunterx.Pumpkin(); - if (object.localIdInBattle != null) - message.localIdInBattle = object.localIdInBattle | 0; - if (object.linearSpeed != null) - message.linearSpeed = Number(object.linearSpeed); - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - if (object.removed != null) - message.removed = Boolean(object.removed); - return message; - }; - - /** - * Creates a plain object from a Pumpkin message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Pumpkin - * @static - * @param {treasurehunterx.Pumpkin} message Pumpkin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Pumpkin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.localIdInBattle = 0; - object.linearSpeed = 0; - object.x = 0; - object.y = 0; - object.removed = false; - } - if (message.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - object.localIdInBattle = message.localIdInBattle; - if (message.linearSpeed != null && message.hasOwnProperty("linearSpeed")) - object.linearSpeed = options.json && !isFinite(message.linearSpeed) ? String(message.linearSpeed) : message.linearSpeed; - if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; - if (message.removed != null && message.hasOwnProperty("removed")) - object.removed = message.removed; - return object; - }; - - /** - * Converts this Pumpkin to JSON. - * @function toJSON - * @memberof treasurehunterx.Pumpkin - * @instance - * @returns {Object.} JSON object - */ - Pumpkin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Pumpkin - * @function getTypeUrl - * @memberof treasurehunterx.Pumpkin - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Pumpkin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Pumpkin"; - }; - - return Pumpkin; - })(); - - treasurehunterx.GuardTower = (function() { - - /** - * Properties of a GuardTower. - * @memberof treasurehunterx - * @interface IGuardTower - * @property {number|null} [id] GuardTower id - * @property {number|null} [localIdInBattle] GuardTower localIdInBattle - * @property {number|null} [type] GuardTower type - * @property {number|null} [x] GuardTower x - * @property {number|null} [y] GuardTower y - * @property {boolean|null} [removed] GuardTower removed - */ - - /** - * Constructs a new GuardTower. - * @memberof treasurehunterx - * @classdesc Represents a GuardTower. - * @implements IGuardTower - * @constructor - * @param {treasurehunterx.IGuardTower=} [properties] Properties to set - */ - function GuardTower(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]]; - } - - /** - * GuardTower id. - * @member {number} id - * @memberof treasurehunterx.GuardTower - * @instance - */ - GuardTower.prototype.id = 0; - - /** - * GuardTower localIdInBattle. - * @member {number} localIdInBattle - * @memberof treasurehunterx.GuardTower - * @instance - */ - GuardTower.prototype.localIdInBattle = 0; - - /** - * GuardTower type. - * @member {number} type - * @memberof treasurehunterx.GuardTower - * @instance - */ - GuardTower.prototype.type = 0; - - /** - * GuardTower x. - * @member {number} x - * @memberof treasurehunterx.GuardTower - * @instance - */ - GuardTower.prototype.x = 0; - - /** - * GuardTower y. - * @member {number} y - * @memberof treasurehunterx.GuardTower - * @instance - */ - GuardTower.prototype.y = 0; - - /** - * GuardTower removed. - * @member {boolean} removed - * @memberof treasurehunterx.GuardTower - * @instance - */ - GuardTower.prototype.removed = false; - - /** - * Creates a new GuardTower instance using the specified properties. - * @function create - * @memberof treasurehunterx.GuardTower - * @static - * @param {treasurehunterx.IGuardTower=} [properties] Properties to set - * @returns {treasurehunterx.GuardTower} GuardTower instance - */ - GuardTower.create = function create(properties) { - return new GuardTower(properties); - }; - - /** - * Encodes the specified GuardTower message. Does not implicitly {@link treasurehunterx.GuardTower.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.GuardTower - * @static - * @param {treasurehunterx.GuardTower} message GuardTower message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GuardTower.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.localIdInBattle != null && Object.hasOwnProperty.call(message, "localIdInBattle")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.localIdInBattle); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.y); - if (message.removed != null && Object.hasOwnProperty.call(message, "removed")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.removed); - return writer; - }; - - /** - * Encodes the specified GuardTower message, length delimited. Does not implicitly {@link treasurehunterx.GuardTower.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.GuardTower - * @static - * @param {treasurehunterx.GuardTower} message GuardTower message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GuardTower.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GuardTower message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.GuardTower - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.GuardTower} GuardTower - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GuardTower.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.treasurehunterx.GuardTower(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.id = reader.int32(); - break; - } - case 2: { - message.localIdInBattle = reader.int32(); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - case 4: { - message.x = reader.double(); - break; - } - case 5: { - message.y = reader.double(); - break; - } - case 6: { - message.removed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GuardTower message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.GuardTower - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.GuardTower} GuardTower - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GuardTower.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GuardTower message. - * @function verify - * @memberof treasurehunterx.GuardTower - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GuardTower.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.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - if (!$util.isInteger(message.localIdInBattle)) - return "localIdInBattle: integer expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isInteger(message.type)) - return "type: integer expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; - if (message.removed != null && message.hasOwnProperty("removed")) - if (typeof message.removed !== "boolean") - return "removed: boolean expected"; - return null; - }; - - /** - * Creates a GuardTower message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.GuardTower - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.GuardTower} GuardTower - */ - GuardTower.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.GuardTower) - return object; - var message = new $root.treasurehunterx.GuardTower(); - if (object.id != null) - message.id = object.id | 0; - if (object.localIdInBattle != null) - message.localIdInBattle = object.localIdInBattle | 0; - if (object.type != null) - message.type = object.type | 0; - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - if (object.removed != null) - message.removed = Boolean(object.removed); - return message; - }; - - /** - * Creates a plain object from a GuardTower message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.GuardTower - * @static - * @param {treasurehunterx.GuardTower} message GuardTower - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GuardTower.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = 0; - object.localIdInBattle = 0; - object.type = 0; - object.x = 0; - object.y = 0; - object.removed = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.localIdInBattle != null && message.hasOwnProperty("localIdInBattle")) - object.localIdInBattle = message.localIdInBattle; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; - if (message.removed != null && message.hasOwnProperty("removed")) - object.removed = message.removed; - return object; - }; - - /** - * Converts this GuardTower to JSON. - * @function toJSON - * @memberof treasurehunterx.GuardTower - * @instance - * @returns {Object.} JSON object - */ - GuardTower.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GuardTower - * @function getTypeUrl - * @memberof treasurehunterx.GuardTower - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GuardTower.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.GuardTower"; - }; - - return GuardTower; - })(); - treasurehunterx.RoomDownsyncFrame = (function() { /** @@ -4339,11 +2392,6 @@ $root.treasurehunterx = (function() { * @property {Object.|null} [players] RoomDownsyncFrame players * @property {number|Long|null} [sentAt] RoomDownsyncFrame sentAt * @property {number|Long|null} [countdownNanos] RoomDownsyncFrame countdownNanos - * @property {Object.|null} [treasures] RoomDownsyncFrame treasures - * @property {Object.|null} [traps] RoomDownsyncFrame traps - * @property {Object.|null} [bullets] RoomDownsyncFrame bullets - * @property {Object.|null} [speedShoes] RoomDownsyncFrame speedShoes - * @property {Object.|null} [guardTowers] RoomDownsyncFrame guardTowers * @property {Object.|null} [playerMetas] RoomDownsyncFrame playerMetas */ @@ -4357,11 +2405,6 @@ $root.treasurehunterx = (function() { */ function RoomDownsyncFrame(properties) { this.players = {}; - this.treasures = {}; - this.traps = {}; - this.bullets = {}; - this.speedShoes = {}; - this.guardTowers = {}; this.playerMetas = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -4409,46 +2452,6 @@ $root.treasurehunterx = (function() { */ RoomDownsyncFrame.prototype.countdownNanos = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * RoomDownsyncFrame treasures. - * @member {Object.} treasures - * @memberof treasurehunterx.RoomDownsyncFrame - * @instance - */ - RoomDownsyncFrame.prototype.treasures = $util.emptyObject; - - /** - * RoomDownsyncFrame traps. - * @member {Object.} traps - * @memberof treasurehunterx.RoomDownsyncFrame - * @instance - */ - RoomDownsyncFrame.prototype.traps = $util.emptyObject; - - /** - * RoomDownsyncFrame bullets. - * @member {Object.} bullets - * @memberof treasurehunterx.RoomDownsyncFrame - * @instance - */ - RoomDownsyncFrame.prototype.bullets = $util.emptyObject; - - /** - * RoomDownsyncFrame speedShoes. - * @member {Object.} speedShoes - * @memberof treasurehunterx.RoomDownsyncFrame - * @instance - */ - RoomDownsyncFrame.prototype.speedShoes = $util.emptyObject; - - /** - * RoomDownsyncFrame guardTowers. - * @member {Object.} guardTowers - * @memberof treasurehunterx.RoomDownsyncFrame - * @instance - */ - RoomDownsyncFrame.prototype.guardTowers = $util.emptyObject; - /** * RoomDownsyncFrame playerMetas. * @member {Object.} playerMetas @@ -4494,34 +2497,9 @@ $root.treasurehunterx = (function() { writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sentAt); if (message.countdownNanos != null && Object.hasOwnProperty.call(message, "countdownNanos")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.countdownNanos); - if (message.treasures != null && Object.hasOwnProperty.call(message, "treasures")) - for (var keys = Object.keys(message.treasures), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.treasurehunterx.Treasure.encode(message.treasures[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.traps != null && Object.hasOwnProperty.call(message, "traps")) - for (var keys = Object.keys(message.traps), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.treasurehunterx.Trap.encode(message.traps[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.bullets != null && Object.hasOwnProperty.call(message, "bullets")) - for (var keys = Object.keys(message.bullets), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.treasurehunterx.Bullet.encode(message.bullets[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.speedShoes != null && Object.hasOwnProperty.call(message, "speedShoes")) - for (var keys = Object.keys(message.speedShoes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.treasurehunterx.SpeedShoe.encode(message.speedShoes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.guardTowers != null && Object.hasOwnProperty.call(message, "guardTowers")) - for (var keys = Object.keys(message.guardTowers), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.treasurehunterx.GuardTower.encode(message.guardTowers[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } if (message.playerMetas != null && Object.hasOwnProperty.call(message, "playerMetas")) for (var keys = Object.keys(message.playerMetas), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); $root.treasurehunterx.PlayerMeta.encode(message.playerMetas[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } return writer; @@ -4598,121 +2576,6 @@ $root.treasurehunterx = (function() { break; } case 6: { - if (message.treasures === $util.emptyObject) - message.treasures = {}; - 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.treasurehunterx.Treasure.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.treasures[key] = value; - break; - } - case 7: { - if (message.traps === $util.emptyObject) - message.traps = {}; - 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.treasurehunterx.Trap.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.traps[key] = value; - break; - } - case 8: { - if (message.bullets === $util.emptyObject) - message.bullets = {}; - 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.treasurehunterx.Bullet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.bullets[key] = value; - break; - } - case 9: { - if (message.speedShoes === $util.emptyObject) - message.speedShoes = {}; - 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.treasurehunterx.SpeedShoe.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.speedShoes[key] = value; - break; - } - case 10: { - if (message.guardTowers === $util.emptyObject) - message.guardTowers = {}; - 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.treasurehunterx.GuardTower.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.guardTowers[key] = value; - break; - } - case 11: { if (message.playerMetas === $util.emptyObject) message.playerMetas = {}; var end2 = reader.uint32() + reader.pos; @@ -4796,76 +2659,6 @@ $root.treasurehunterx = (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.treasures != null && message.hasOwnProperty("treasures")) { - if (!$util.isObject(message.treasures)) - return "treasures: object expected"; - var key = Object.keys(message.treasures); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "treasures: integer key{k:int32} expected"; - { - var error = $root.treasurehunterx.Treasure.verify(message.treasures[key[i]]); - if (error) - return "treasures." + error; - } - } - } - if (message.traps != null && message.hasOwnProperty("traps")) { - if (!$util.isObject(message.traps)) - return "traps: object expected"; - var key = Object.keys(message.traps); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "traps: integer key{k:int32} expected"; - { - var error = $root.treasurehunterx.Trap.verify(message.traps[key[i]]); - if (error) - return "traps." + error; - } - } - } - if (message.bullets != null && message.hasOwnProperty("bullets")) { - if (!$util.isObject(message.bullets)) - return "bullets: object expected"; - var key = Object.keys(message.bullets); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "bullets: integer key{k:int32} expected"; - { - var error = $root.treasurehunterx.Bullet.verify(message.bullets[key[i]]); - if (error) - return "bullets." + error; - } - } - } - if (message.speedShoes != null && message.hasOwnProperty("speedShoes")) { - if (!$util.isObject(message.speedShoes)) - return "speedShoes: object expected"; - var key = Object.keys(message.speedShoes); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "speedShoes: integer key{k:int32} expected"; - { - var error = $root.treasurehunterx.SpeedShoe.verify(message.speedShoes[key[i]]); - if (error) - return "speedShoes." + error; - } - } - } - if (message.guardTowers != null && message.hasOwnProperty("guardTowers")) { - if (!$util.isObject(message.guardTowers)) - return "guardTowers: object expected"; - var key = Object.keys(message.guardTowers); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "guardTowers: integer key{k:int32} expected"; - { - var error = $root.treasurehunterx.GuardTower.verify(message.guardTowers[key[i]]); - if (error) - return "guardTowers." + error; - } - } - } if (message.playerMetas != null && message.hasOwnProperty("playerMetas")) { if (!$util.isObject(message.playerMetas)) return "playerMetas: object expected"; @@ -4927,56 +2720,6 @@ $root.treasurehunterx = (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.treasures) { - if (typeof object.treasures !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.treasures: object expected"); - message.treasures = {}; - for (var keys = Object.keys(object.treasures), i = 0; i < keys.length; ++i) { - if (typeof object.treasures[keys[i]] !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.treasures: object expected"); - message.treasures[keys[i]] = $root.treasurehunterx.Treasure.fromObject(object.treasures[keys[i]]); - } - } - if (object.traps) { - if (typeof object.traps !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.traps: object expected"); - message.traps = {}; - for (var keys = Object.keys(object.traps), i = 0; i < keys.length; ++i) { - if (typeof object.traps[keys[i]] !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.traps: object expected"); - message.traps[keys[i]] = $root.treasurehunterx.Trap.fromObject(object.traps[keys[i]]); - } - } - if (object.bullets) { - if (typeof object.bullets !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.bullets: object expected"); - message.bullets = {}; - for (var keys = Object.keys(object.bullets), i = 0; i < keys.length; ++i) { - if (typeof object.bullets[keys[i]] !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.bullets: object expected"); - message.bullets[keys[i]] = $root.treasurehunterx.Bullet.fromObject(object.bullets[keys[i]]); - } - } - if (object.speedShoes) { - if (typeof object.speedShoes !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.speedShoes: object expected"); - message.speedShoes = {}; - for (var keys = Object.keys(object.speedShoes), i = 0; i < keys.length; ++i) { - if (typeof object.speedShoes[keys[i]] !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.speedShoes: object expected"); - message.speedShoes[keys[i]] = $root.treasurehunterx.SpeedShoe.fromObject(object.speedShoes[keys[i]]); - } - } - if (object.guardTowers) { - if (typeof object.guardTowers !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.guardTowers: object expected"); - message.guardTowers = {}; - for (var keys = Object.keys(object.guardTowers), i = 0; i < keys.length; ++i) { - if (typeof object.guardTowers[keys[i]] !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.guardTowers: object expected"); - message.guardTowers[keys[i]] = $root.treasurehunterx.GuardTower.fromObject(object.guardTowers[keys[i]]); - } - } if (object.playerMetas) { if (typeof object.playerMetas !== "object") throw TypeError(".treasurehunterx.RoomDownsyncFrame.playerMetas: object expected"); @@ -5005,11 +2748,6 @@ $root.treasurehunterx = (function() { var object = {}; if (options.objects || options.defaults) { object.players = {}; - object.treasures = {}; - object.traps = {}; - object.bullets = {}; - object.speedShoes = {}; - object.guardTowers = {}; object.playerMetas = {}; } if (options.defaults) { @@ -5046,31 +2784,6 @@ $root.treasurehunterx = (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.treasures && (keys2 = Object.keys(message.treasures)).length) { - object.treasures = {}; - for (var j = 0; j < keys2.length; ++j) - object.treasures[keys2[j]] = $root.treasurehunterx.Treasure.toObject(message.treasures[keys2[j]], options); - } - if (message.traps && (keys2 = Object.keys(message.traps)).length) { - object.traps = {}; - for (var j = 0; j < keys2.length; ++j) - object.traps[keys2[j]] = $root.treasurehunterx.Trap.toObject(message.traps[keys2[j]], options); - } - if (message.bullets && (keys2 = Object.keys(message.bullets)).length) { - object.bullets = {}; - for (var j = 0; j < keys2.length; ++j) - object.bullets[keys2[j]] = $root.treasurehunterx.Bullet.toObject(message.bullets[keys2[j]], options); - } - if (message.speedShoes && (keys2 = Object.keys(message.speedShoes)).length) { - object.speedShoes = {}; - for (var j = 0; j < keys2.length; ++j) - object.speedShoes[keys2[j]] = $root.treasurehunterx.SpeedShoe.toObject(message.speedShoes[keys2[j]], options); - } - if (message.guardTowers && (keys2 = Object.keys(message.guardTowers)).length) { - object.guardTowers = {}; - for (var j = 0; j < keys2.length; ++j) - object.guardTowers[keys2[j]] = $root.treasurehunterx.GuardTower.toObject(message.guardTowers[keys2[j]], options); - } if (message.playerMetas && (keys2 = Object.keys(message.playerMetas)).length) { object.playerMetas = {}; for (var j = 0; j < keys2.length; ++j)