diff --git a/battle_srv/go.mod b/battle_srv/go.mod index 9bcd700..71dab42 100644 --- a/battle_srv/go.mod +++ b/battle_srv/go.mod @@ -1,4 +1,4 @@ -module server +module battle_srv go 1.19 diff --git a/battle_srv/main.go b/battle_srv/main.go index 81e4348..c214e8c 100644 --- a/battle_srv/main.go +++ b/battle_srv/main.go @@ -7,13 +7,13 @@ import ( "os" "os/signal" "path/filepath" - "server/api" - "server/api/v1" - . "server/common" - "server/env_tools" - "server/models" - "server/storage" - "server/ws" + "battle_srv/api" + "battle_srv/api/v1" + . "battle_srv/common" + "battle_srv/env_tools" + "battle_srv/models" + "battle_srv/storage" + "battle_srv/ws" "syscall" "time" diff --git a/battle_srv/models/pb_type_convert.go b/battle_srv/models/pb_type_convert.go index d460097..f273271 100644 --- a/battle_srv/models/pb_type_convert.go +++ b/battle_srv/models/pb_type_convert.go @@ -68,9 +68,9 @@ func toPbPlayers(modelInstances map[int32]*Player) map[int32]*pb.Player { for k, last := range modelInstances { toRet[k] = &pb.Player{ - Id: last.Id, - X: last.X, - Y: last.Y, + Id: last.Id, + VirtualGridX: last.VirtualGridX, + VirtualGridY: last.VirtualGridY, Dir: &pb.Direction{ Dx: last.Dir.Dx, Dy: last.Dir.Dy, diff --git a/battle_srv/models/player.go b/battle_srv/models/player.go index f2ce027..b0943e6 100644 --- a/battle_srv/models/player.go +++ b/battle_srv/models/player.go @@ -33,30 +33,31 @@ func InitPlayerBattleStateIns() { } type Player struct { - Id int32 `json:"id,omitempty" db:"id"` - X float64 `json:"x,omitempty"` - Y float64 `json:"y,omitempty"` - Dir *Direction `json:"dir,omitempty"` - Speed float64 `json:"speed,omitempty"` - BattleState int32 `json:"battleState,omitempty"` - LastMoveGmtMillis int32 `json:"lastMoveGmtMillis,omitempty"` - Score int32 `json:"score,omitempty"` - Removed bool `json:"removed,omitempty"` - JoinIndex int32 - + // Meta info fields + Id int32 `json:"id,omitempty" db:"id"` Name string `json:"name,omitempty" db:"name"` DisplayName string `json:"displayName,omitempty" db:"display_name"` Avatar string `json:"avatar,omitempty"` - FrozenAtGmtMillis int64 `json:"-" db:"-"` - AddSpeedAtGmtMillis int64 `json:"-" db:"-"` - CreatedAt int64 `json:"-" db:"created_at"` - UpdatedAt int64 `json:"-" db:"updated_at"` - DeletedAt NullInt64 `json:"-" db:"deleted_at"` - TutorialStage int `json:"-" db:"tutorial_stage"` - AckingFrameId int32 `json:"ackingFrameId"` - AckingInputFrameId int32 `json:"-"` - LastSentInputFrameId int32 `json:"-"` + // DB only fields + CreatedAt int64 `db:"created_at"` + UpdatedAt int64 `db:"updated_at"` + DeletedAt NullInt64 `db:"deleted_at"` + TutorialStage int `db:"tutorial_stage"` + + // in-battle info fields + VirtualGridX int32 + VirtualGridY int32 + Dir *Direction + Speed int32 + BattleState int32 + LastMoveGmtMillis int32 + Score int32 + Removed bool + JoinIndex int32 + AckingFrameId int32 + AckingInputFrameId int32 + LastSentInputFrameId int32 } func ExistPlayerByName(name string) (bool, error) { diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index b84b8ee..456ceb2 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -13,9 +13,9 @@ import ( "math/rand" "os" "path/filepath" - . "server/common" - "server/common/utils" - pb "server/pb_output" + . "battle_srv/common" + "battle_srv/common/utils" + pb "battle_srv/protos" "strings" "sync" "sync/atomic" @@ -82,10 +82,10 @@ var DIRECTION_DECODER_INVERSE_LENGTH = []float64{ 1.0, 0.5, 0.5, - 0.4472, - 0.4472, - 0.4472, - 0.4472, + 0.44, // Actually it should be "0.4472", but truncated for better precision sync as well as a reduction of speed in diagonal direction + 0.44, + 0.44, + 0.44, 0.5, 0.5, 1.0, @@ -128,12 +128,14 @@ func calRoomScore(inRoomPlayerCount int32, roomPlayerCnt int, currentRoomBattleS } type Room struct { - Id int32 - Capacity int - playerColliderRadius float64 - Players map[int32]*Player - PlayersArr []*Player // ordered by joinIndex - CollisionSysMap map[int32]*resolv.Object + Id int32 + Capacity int + playerColliderRadius float64 + collisionSpaceOffsetX float64 + collisionSpaceOffsetY float64 + Players map[int32]*Player + PlayersArr []*Player // ordered by joinIndex + CollisionSysMap map[int32]*resolv.Object /** * The following `PlayerDownsyncSessionDict` is NOT individually put * under `type Player struct` for a reason. @@ -177,11 +179,15 @@ type Room struct { NstDelayFrames int32 // network-single-trip delay in the count of render frames, proposed to be (InputDelayFrames >> 1) because we expect a round-trip delay to be exactly "InputDelayFrames" InputScaleFrames uint32 // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames) JoinIndexBooleanArr []bool - RollbackEstimatedDt float64 RollbackEstimatedDtMillis float64 RollbackEstimatedDtNanos int64 LastRenderFrameIdTriggeredAt int64 + WorldToVirtualGridRatio float64 + VirtualGridToWorldRatio float64 + + PlayerDefaultSpeed int32 + StageName string StageDiscreteW int32 StageDiscreteH int32 @@ -192,11 +198,6 @@ type Room struct { BackendDynamicsEnabled bool } -const ( - PLAYER_DEFAULT_SPEED = float64(200) // Hardcoded - ADD_SPEED = float64(100) // Hardcoded -) - func (pR *Room) updateScore() { pR.Score = calRoomScore(pR.EffectivePlayerCount, pR.Capacity, pR.State) } @@ -218,9 +219,7 @@ func (pR *Room) AddPlayerIfPossible(pPlayerFromDbInit *Player, session *websocke pPlayerFromDbInit.AckingInputFrameId = -1 pPlayerFromDbInit.LastSentInputFrameId = MAGIC_LAST_SENT_INPUT_FRAME_ID_NORMAL_ADDED pPlayerFromDbInit.BattleState = PlayerBattleStateIns.ADDED_PENDING_BATTLE_COLLIDER_ACK - pPlayerFromDbInit.FrozenAtGmtMillis = -1 // Hardcoded temporarily. - pPlayerFromDbInit.Speed = PLAYER_DEFAULT_SPEED // Hardcoded temporarily. - pPlayerFromDbInit.AddSpeedAtGmtMillis = -1 // Hardcoded temporarily. + pPlayerFromDbInit.Speed = pR.PlayerDefaultSpeed pR.Players[playerId] = pPlayerFromDbInit pR.PlayerDownsyncSessionDict[playerId] = session @@ -421,7 +420,7 @@ func (pR *Room) StartBattle() { spaceOffsetX := float64(spaceW) * 0.5 spaceOffsetY := float64(spaceH) * 0.5 - pR.refreshColliders(spaceW, spaceH, spaceOffsetX, spaceOffsetY) + pR.refreshColliders(spaceW, spaceH) /** * Will be triggered from a goroutine which executes the critical `Room.AddPlayerIfPossible`, thus the `battleMainLoop` should be detached. @@ -799,6 +798,9 @@ 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.playerColliderRadius = float64(12) // hardcoded + pR.WorldToVirtualGridRatio = float64(10) + pR.VirtualGridToWorldRatio = float64(1.0) / pR.WorldToVirtualGridRatio // this is a one-off computation, should avoid division in iterations + pR.PlayerDefaultSpeed = int32(3 * pR.WorldToVirtualGridRatio) // Hardcoded in virtual grids per frame pR.Players = make(map[int32]*Player) pR.PlayersArr = make([]*Player, pR.Capacity) pR.CollisionSysMap = make(map[int32]*resolv.Object) @@ -820,7 +822,6 @@ func (pR *Room) OnDismissed() { pR.NstDelayFrames = 8 pR.InputScaleFrames = uint32(2) pR.ServerFps = 60 - pR.RollbackEstimatedDt = 0.016667 // Use fixed-and-low-precision to mitigate the inconsistent floating-point-number issue between Golang and JavaScript pR.RollbackEstimatedDtMillis = 16.667 // Use fixed-and-low-precision to mitigate the inconsistent floating-point-number issue between Golang and JavaScript pR.RollbackEstimatedDtNanos = 16666666 // A little smaller than the actual per frame time, just for preventing FAST FRAME pR.BattleDurationFrames = 30 * pR.ServerFps @@ -947,8 +948,7 @@ func (pR *Room) onPlayerAdded(playerId int32) { if nil == playerPos { panic(fmt.Sprintf("onPlayerAdded error, nil == playerPos, roomId=%v, playerId=%v, roomState=%v, roomEffectivePlayerCount=%v", pR.Id, playerId, pR.State, pR.EffectivePlayerCount)) } - pR.Players[playerId].X = playerPos.X - pR.Players[playerId].Y = playerPos.Y + pR.Players[playerId].VirtualGridX, pR.Players[playerId].VirtualGridY = pR.worldToVirtualGridPos(playerPos.X, playerPos.Y) break } @@ -1215,12 +1215,15 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende if 0.0 == decodedInputSpeedFactor { continue } - baseChange := player.Speed * pR.RollbackEstimatedDt * decodedInputSpeedFactor + baseChange := float64(player.Speed) * pR.VirtualGridToWorldRatio * decodedInputSpeedFactor oldDx, oldDy := baseChange*float64(decodedInput[0]), baseChange*float64(decodedInput[1]) dx, dy := oldDx, oldDy collisionPlayerIndex := COLLISION_PLAYER_INDEX_PREFIX + joinIndex playerCollider := pR.CollisionSysMap[collisionPlayerIndex] + // Reset playerCollider position from the "virtual grid position" + playerCollider.X, playerCollider.Y = pR.virtualGridToPlayerColliderPos(player.VirtualGridX, player.VirtualGridY) + if collision := playerCollider.Check(oldDx, oldDy, "Barrier"); collision != nil { playerShape := playerCollider.Shape.(*resolv.ConvexPolygon) for _, obj := range collision.Objects { @@ -1242,8 +1245,7 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende player.Dir.Dx = decodedInput[0] player.Dir.Dy = decodedInput[1] - player.X = playerCollider.X + pR.playerColliderRadius - spaceOffsetX - player.Y = playerCollider.Y + pR.playerColliderRadius - spaceOffsetY + player.VirtualGridX, player.VirtualGridY = pR.playerColliderAnchorToVirtualGridPos(playerCollider.X, playerCollider.Y) } } @@ -1261,13 +1263,14 @@ func (pR *Room) inputFrameIdDebuggable(inputFrameId int32) bool { return 0 == (inputFrameId % 10) } -func (pR *Room) refreshColliders(spaceW, spaceH int32, spaceOffsetX, spaceOffsetY float64) { +func (pR *Room) refreshColliders(spaceW, spaceH int32) { // Kindly note that by now, we've already got all the shapes in the tmx file into "pR.(Players | Barriers)" from "ParseTmxLayersAndGroups" - minStep := int(3) // the approx minimum distance a player can move per frame + minStep := int(3) // the approx minimum distance a player can move per frame in world coordinate space := resolv.NewSpace(int(spaceW), int(spaceH), minStep, minStep) // allocate a new collision space everytime after a battle is settled for _, player := range pR.Players { - playerCollider := GenerateRectCollider(player.X, player.Y, pR.playerColliderRadius*2, pR.playerColliderRadius*2, spaceOffsetX, spaceOffsetY, "Player") + wx, wy := pR.virtualGridToWorldPos(player.VirtualGridX, player.VirtualGridY) + playerCollider := GenerateRectCollider(wx, wy, pR.playerColliderRadius*2, pR.playerColliderRadius*2, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, "Player") space.Add(playerCollider) // Keep track of the collider in "pR.CollisionSysMap" joinIndex := player.JoinIndex @@ -1278,7 +1281,7 @@ func (pR *Room) refreshColliders(spaceW, spaceH int32, spaceOffsetX, spaceOffset for _, barrier := range pR.Barriers { boundaryUnaligned := barrier.Boundary - barrierCollider := GenerateConvexPolygonCollider(boundaryUnaligned, spaceOffsetX, spaceOffsetY, "Barrier") + barrierCollider := GenerateConvexPolygonCollider(boundaryUnaligned, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, "Barrier") space.Add(barrierCollider) } } @@ -1286,3 +1289,35 @@ func (pR *Room) refreshColliders(spaceW, spaceH int32, spaceOffsetX, spaceOffset func (pR *Room) printBarrier(barrierCollider *resolv.Object) { Logger.Info(fmt.Sprintf("Barrier in roomId=%v: w=%v, h=%v, shape=%v", pR.Id, barrierCollider.W, barrierCollider.H, barrierCollider.Shape)) } + +func (pR *Room) worldToVirtualGridPos(x, y float64) (int32, int32) { + // In JavaScript floating numbers suffer from seemingly non-deterministic arithmetics, and even if certain libs solved this issue by approaches such as fixed-point-number, they might not be used in other libs -- e.g. the "collision libs" we're interested in -- thus couldn't kill all pains. + var virtualGridX int32 = int32(x * pR.WorldToVirtualGridRatio) + var virtualGridY int32 = int32(y * pR.WorldToVirtualGridRatio) + return virtualGridX, virtualGridY +} + +func (pR *Room) virtualGridToWorldPos(vx, vy int32) (float64, float64) { + var x float64 = float64(vx) * pR.VirtualGridToWorldRatio + var y float64 = float64(vy) * pR.VirtualGridToWorldRatio + return x, y +} + +func (pR *Room) playerWorldToCollisionPos(wx, wy float64) (float64, float64) { + // TODO: remove this duplicate code w.r.t. "dnmshared/resolv_helper.go" + return wx - pR.playerColliderRadius + pR.collisionSpaceOffsetX, wy - pR.playerColliderRadius + pR.collisionSpaceOffsetY +} + +func (pR *Room) playerColliderAnchorToWorldPos(cx, cy float64) (float64, float64) { + return cx + pR.playerColliderRadius - pR.collisionSpaceOffsetX, cy + pR.playerColliderRadius - pR.collisionSpaceOffsetY +} + +func (pR *Room) playerColliderAnchorToVirtualGridPos(cx, cy float64) (int32, int32) { + wx, wy := pR.playerColliderAnchorToWorldPos(cx, cy) + return pR.worldToVirtualGridPos(wx, wy) +} + +func (pR *Room) virtualGridToPlayerColliderPos(vx, vy int32) (float64, float64) { + wx, wy := pR.virtualGridToWorldPos(vx, vy) + return pR.playerWorldToCollisionPos(wx, wy) +} diff --git a/battle_srv/pb_output/room_downsync_frame.pb.go b/battle_srv/pb_output/room_downsync_frame.pb.go deleted file mode 100644 index 19395b1..0000000 --- a/battle_srv/pb_output/room_downsync_frame.pb.go +++ /dev/null @@ -1,1587 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.4 -// source: room_downsync_frame.proto - -package __ - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Direction struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Dx int32 `protobuf:"varint,1,opt,name=dx,proto3" json:"dx,omitempty"` - Dy int32 `protobuf:"varint,2,opt,name=dy,proto3" json:"dy,omitempty"` -} - -func (x *Direction) Reset() { - *x = Direction{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Direction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Direction) ProtoMessage() {} - -func (x *Direction) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[0] - 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 Direction.ProtoReflect.Descriptor instead. -func (*Direction) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{0} -} - -func (x *Direction) GetDx() int32 { - if x != nil { - return x.Dx - } - return 0 -} - -func (x *Direction) GetDy() int32 { - if x != nil { - return x.Dy - } - return 0 -} - -type Vec2D struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - X float64 `protobuf:"fixed64,1,opt,name=x,proto3" json:"x,omitempty"` - Y float64 `protobuf:"fixed64,2,opt,name=y,proto3" json:"y,omitempty"` -} - -func (x *Vec2D) Reset() { - *x = Vec2D{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Vec2D) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Vec2D) ProtoMessage() {} - -func (x *Vec2D) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[1] - 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 Vec2D.ProtoReflect.Descriptor instead. -func (*Vec2D) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{1} -} - -func (x *Vec2D) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *Vec2D) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -type Polygon2D struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Anchor *Vec2D `protobuf:"bytes,1,opt,name=Anchor,proto3" json:"Anchor,omitempty"` - Points []*Vec2D `protobuf:"bytes,2,rep,name=Points,proto3" json:"Points,omitempty"` -} - -func (x *Polygon2D) Reset() { - *x = Polygon2D{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Polygon2D) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Polygon2D) ProtoMessage() {} - -func (x *Polygon2D) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Polygon2D.ProtoReflect.Descriptor instead. -func (*Polygon2D) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{2} -} - -func (x *Polygon2D) GetAnchor() *Vec2D { - if x != nil { - return x.Anchor - } - return nil -} - -func (x *Polygon2D) GetPoints() []*Vec2D { - if x != nil { - return x.Points - } - return nil -} - -type Vec2DList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Vec2DList []*Vec2D `protobuf:"bytes,1,rep,name=vec2DList,proto3" json:"vec2DList,omitempty"` -} - -func (x *Vec2DList) Reset() { - *x = Vec2DList{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Vec2DList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Vec2DList) ProtoMessage() {} - -func (x *Vec2DList) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[3] - 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 Vec2DList.ProtoReflect.Descriptor instead. -func (*Vec2DList) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{3} -} - -func (x *Vec2DList) GetVec2DList() []*Vec2D { - if x != nil { - return x.Vec2DList - } - return nil -} - -type Polygon2DList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Polygon2DList []*Polygon2D `protobuf:"bytes,1,rep,name=polygon2DList,proto3" json:"polygon2DList,omitempty"` -} - -func (x *Polygon2DList) Reset() { - *x = Polygon2DList{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Polygon2DList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Polygon2DList) ProtoMessage() {} - -func (x *Polygon2DList) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[4] - 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 Polygon2DList.ProtoReflect.Descriptor instead. -func (*Polygon2DList) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{4} -} - -func (x *Polygon2DList) GetPolygon2DList() []*Polygon2D { - if x != nil { - return x.Polygon2DList - } - return nil -} - -type BattleColliderInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StageName string `protobuf:"bytes,1,opt,name=stageName,proto3" json:"stageName,omitempty"` - StrToVec2DListMap map[string]*Vec2DList `protobuf:"bytes,2,rep,name=strToVec2DListMap,proto3" json:"strToVec2DListMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StrToPolygon2DListMap map[string]*Polygon2DList `protobuf:"bytes,3,rep,name=strToPolygon2DListMap,proto3" json:"strToPolygon2DListMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StageDiscreteW int32 `protobuf:"varint,4,opt,name=stageDiscreteW,proto3" json:"stageDiscreteW,omitempty"` - StageDiscreteH int32 `protobuf:"varint,5,opt,name=stageDiscreteH,proto3" json:"stageDiscreteH,omitempty"` - StageTileW int32 `protobuf:"varint,6,opt,name=stageTileW,proto3" json:"stageTileW,omitempty"` - StageTileH int32 `protobuf:"varint,7,opt,name=stageTileH,proto3" json:"stageTileH,omitempty"` - IntervalToPing int32 `protobuf:"varint,8,opt,name=intervalToPing,proto3" json:"intervalToPing,omitempty"` - WillKickIfInactiveFor int32 `protobuf:"varint,9,opt,name=willKickIfInactiveFor,proto3" json:"willKickIfInactiveFor,omitempty"` - BoundRoomId int32 `protobuf:"varint,10,opt,name=boundRoomId,proto3" json:"boundRoomId,omitempty"` - BattleDurationNanos int64 `protobuf:"varint,11,opt,name=battleDurationNanos,proto3" json:"battleDurationNanos,omitempty"` - ServerFps int32 `protobuf:"varint,12,opt,name=serverFps,proto3" json:"serverFps,omitempty"` - InputDelayFrames int32 `protobuf:"varint,13,opt,name=inputDelayFrames,proto3" json:"inputDelayFrames,omitempty"` - InputScaleFrames uint32 `protobuf:"varint,14,opt,name=inputScaleFrames,proto3" json:"inputScaleFrames,omitempty"` - NstDelayFrames int32 `protobuf:"varint,15,opt,name=nstDelayFrames,proto3" json:"nstDelayFrames,omitempty"` - InputFrameUpsyncDelayTolerance int32 `protobuf:"varint,16,opt,name=inputFrameUpsyncDelayTolerance,proto3" json:"inputFrameUpsyncDelayTolerance,omitempty"` - MaxChasingRenderFramesPerUpdate int32 `protobuf:"varint,17,opt,name=maxChasingRenderFramesPerUpdate,proto3" json:"maxChasingRenderFramesPerUpdate,omitempty"` - PlayerBattleState int32 `protobuf:"varint,18,opt,name=playerBattleState,proto3" json:"playerBattleState,omitempty"` - RollbackEstimatedDt float64 `protobuf:"fixed64,19,opt,name=rollbackEstimatedDt,proto3" json:"rollbackEstimatedDt,omitempty"` - RollbackEstimatedDtMillis float64 `protobuf:"fixed64,20,opt,name=rollbackEstimatedDtMillis,proto3" json:"rollbackEstimatedDtMillis,omitempty"` - RollbackEstimatedDtNanos int64 `protobuf:"varint,21,opt,name=rollbackEstimatedDtNanos,proto3" json:"rollbackEstimatedDtNanos,omitempty"` -} - -func (x *BattleColliderInfo) Reset() { - *x = BattleColliderInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BattleColliderInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BattleColliderInfo) ProtoMessage() {} - -func (x *BattleColliderInfo) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[5] - 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 BattleColliderInfo.ProtoReflect.Descriptor instead. -func (*BattleColliderInfo) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{5} -} - -func (x *BattleColliderInfo) GetStageName() string { - if x != nil { - return x.StageName - } - return "" -} - -func (x *BattleColliderInfo) GetStrToVec2DListMap() map[string]*Vec2DList { - if x != nil { - return x.StrToVec2DListMap - } - return nil -} - -func (x *BattleColliderInfo) GetStrToPolygon2DListMap() map[string]*Polygon2DList { - if x != nil { - return x.StrToPolygon2DListMap - } - return nil -} - -func (x *BattleColliderInfo) GetStageDiscreteW() int32 { - if x != nil { - return x.StageDiscreteW - } - return 0 -} - -func (x *BattleColliderInfo) GetStageDiscreteH() int32 { - if x != nil { - return x.StageDiscreteH - } - return 0 -} - -func (x *BattleColliderInfo) GetStageTileW() int32 { - if x != nil { - return x.StageTileW - } - return 0 -} - -func (x *BattleColliderInfo) GetStageTileH() int32 { - if x != nil { - return x.StageTileH - } - return 0 -} - -func (x *BattleColliderInfo) GetIntervalToPing() int32 { - if x != nil { - return x.IntervalToPing - } - return 0 -} - -func (x *BattleColliderInfo) GetWillKickIfInactiveFor() int32 { - if x != nil { - return x.WillKickIfInactiveFor - } - return 0 -} - -func (x *BattleColliderInfo) GetBoundRoomId() int32 { - if x != nil { - return x.BoundRoomId - } - return 0 -} - -func (x *BattleColliderInfo) GetBattleDurationNanos() int64 { - if x != nil { - return x.BattleDurationNanos - } - return 0 -} - -func (x *BattleColliderInfo) GetServerFps() int32 { - if x != nil { - return x.ServerFps - } - return 0 -} - -func (x *BattleColliderInfo) GetInputDelayFrames() int32 { - if x != nil { - return x.InputDelayFrames - } - return 0 -} - -func (x *BattleColliderInfo) GetInputScaleFrames() uint32 { - if x != nil { - return x.InputScaleFrames - } - return 0 -} - -func (x *BattleColliderInfo) GetNstDelayFrames() int32 { - if x != nil { - return x.NstDelayFrames - } - return 0 -} - -func (x *BattleColliderInfo) GetInputFrameUpsyncDelayTolerance() int32 { - if x != nil { - return x.InputFrameUpsyncDelayTolerance - } - return 0 -} - -func (x *BattleColliderInfo) GetMaxChasingRenderFramesPerUpdate() int32 { - if x != nil { - return x.MaxChasingRenderFramesPerUpdate - } - return 0 -} - -func (x *BattleColliderInfo) GetPlayerBattleState() int32 { - if x != nil { - return x.PlayerBattleState - } - return 0 -} - -func (x *BattleColliderInfo) GetRollbackEstimatedDt() float64 { - if x != nil { - return x.RollbackEstimatedDt - } - return 0 -} - -func (x *BattleColliderInfo) GetRollbackEstimatedDtMillis() float64 { - if x != nil { - return x.RollbackEstimatedDtMillis - } - return 0 -} - -func (x *BattleColliderInfo) GetRollbackEstimatedDtNanos() int64 { - if x != nil { - return x.RollbackEstimatedDtNanos - } - return 0 -} - -type Player struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - X float64 `protobuf:"fixed64,2,opt,name=x,proto3" json:"x,omitempty"` - Y float64 `protobuf:"fixed64,3,opt,name=y,proto3" json:"y,omitempty"` - Dir *Direction `protobuf:"bytes,4,opt,name=dir,proto3" json:"dir,omitempty"` - Speed float64 `protobuf:"fixed64,5,opt,name=speed,proto3" json:"speed,omitempty"` - BattleState int32 `protobuf:"varint,6,opt,name=battleState,proto3" json:"battleState,omitempty"` - LastMoveGmtMillis int32 `protobuf:"varint,7,opt,name=lastMoveGmtMillis,proto3" json:"lastMoveGmtMillis,omitempty"` - Score int32 `protobuf:"varint,10,opt,name=score,proto3" json:"score,omitempty"` - Removed bool `protobuf:"varint,11,opt,name=removed,proto3" json:"removed,omitempty"` - JoinIndex int32 `protobuf:"varint,12,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` -} - -func (x *Player) Reset() { - *x = Player{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Player) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Player) ProtoMessage() {} - -func (x *Player) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[6] - 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 Player.ProtoReflect.Descriptor instead. -func (*Player) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{6} -} - -func (x *Player) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Player) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *Player) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -func (x *Player) GetDir() *Direction { - if x != nil { - return x.Dir - } - return nil -} - -func (x *Player) GetSpeed() float64 { - if x != nil { - return x.Speed - } - return 0 -} - -func (x *Player) GetBattleState() int32 { - if x != nil { - return x.BattleState - } - return 0 -} - -func (x *Player) GetLastMoveGmtMillis() int32 { - if x != nil { - return x.LastMoveGmtMillis - } - return 0 -} - -func (x *Player) GetScore() int32 { - if x != nil { - return x.Score - } - return 0 -} - -func (x *Player) GetRemoved() bool { - if x != nil { - return x.Removed - } - return false -} - -func (x *Player) GetJoinIndex() int32 { - if x != nil { - return x.JoinIndex - } - return 0 -} - -type PlayerMeta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - DisplayName string `protobuf:"bytes,3,opt,name=displayName,proto3" json:"displayName,omitempty"` - Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` - JoinIndex int32 `protobuf:"varint,5,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` -} - -func (x *PlayerMeta) Reset() { - *x = PlayerMeta{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlayerMeta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlayerMeta) ProtoMessage() {} - -func (x *PlayerMeta) ProtoReflect() protoreflect.Message { - mi := &file_room_downsync_frame_proto_msgTypes[7] - 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 PlayerMeta.ProtoReflect.Descriptor instead. -func (*PlayerMeta) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{7} -} - -func (x *PlayerMeta) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *PlayerMeta) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PlayerMeta) GetDisplayName() string { - if x != nil { - return x.DisplayName - } - return "" -} - -func (x *PlayerMeta) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -func (x *PlayerMeta) GetJoinIndex() int32 { - if x != nil { - return x.JoinIndex - } - return 0 -} - -type InputFrameUpsync struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InputFrameId int32 `protobuf:"varint,1,opt,name=inputFrameId,proto3" json:"inputFrameId,omitempty"` - EncodedDir int32 `protobuf:"varint,6,opt,name=encodedDir,proto3" json:"encodedDir,omitempty"` -} - -func (x *InputFrameUpsync) Reset() { - *x = InputFrameUpsync{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InputFrameUpsync) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InputFrameUpsync) ProtoMessage() {} - -func (x *InputFrameUpsync) 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 InputFrameUpsync.ProtoReflect.Descriptor instead. -func (*InputFrameUpsync) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{8} -} - -func (x *InputFrameUpsync) GetInputFrameId() int32 { - if x != nil { - return x.InputFrameId - } - return 0 -} - -func (x *InputFrameUpsync) GetEncodedDir() int32 { - if x != nil { - return x.EncodedDir - } - return 0 -} - -type InputFrameDownsync struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InputFrameId int32 `protobuf:"varint,1,opt,name=inputFrameId,proto3" json:"inputFrameId,omitempty"` - InputList []uint64 `protobuf:"varint,2,rep,packed,name=inputList,proto3" json:"inputList,omitempty"` // Indexed by "joinIndex", we try to compress the "single player input" into 1 word (64-bit for 64-bit Golang runtime) because atomic compare-and-swap only works on 1 word. Although CAS on custom struct is possible in Golang 1.19 https://pkg.go.dev/sync/atomic@go1.19.1#Value.CompareAndSwap, using a single word is still faster whenever possible. - ConfirmedList uint64 `protobuf:"varint,3,opt,name=confirmedList,proto3" json:"confirmedList,omitempty"` // Indexed by "joinIndex", same compression concern as above -} - -func (x *InputFrameDownsync) Reset() { - *x = InputFrameDownsync{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InputFrameDownsync) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InputFrameDownsync) ProtoMessage() {} - -func (x *InputFrameDownsync) 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 InputFrameDownsync.ProtoReflect.Descriptor instead. -func (*InputFrameDownsync) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{9} -} - -func (x *InputFrameDownsync) GetInputFrameId() int32 { - if x != nil { - return x.InputFrameId - } - return 0 -} - -func (x *InputFrameDownsync) GetInputList() []uint64 { - if x != nil { - return x.InputList - } - return nil -} - -func (x *InputFrameDownsync) GetConfirmedList() uint64 { - if x != nil { - return x.ConfirmedList - } - return 0 -} - -type HeartbeatUpsync struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClientTimestamp int64 `protobuf:"varint,1,opt,name=clientTimestamp,proto3" json:"clientTimestamp,omitempty"` -} - -func (x *HeartbeatUpsync) Reset() { - *x = HeartbeatUpsync{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeartbeatUpsync) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeartbeatUpsync) ProtoMessage() {} - -func (x *HeartbeatUpsync) 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 HeartbeatUpsync.ProtoReflect.Descriptor instead. -func (*HeartbeatUpsync) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{10} -} - -func (x *HeartbeatUpsync) GetClientTimestamp() int64 { - if x != nil { - return x.ClientTimestamp - } - return 0 -} - -type RoomDownsyncFrame struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Players map[int32]*Player `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"` - PlayerMetas map[int32]*PlayerMeta `protobuf:"bytes,4,rep,name=playerMetas,proto3" json:"playerMetas,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *RoomDownsyncFrame) Reset() { - *x = RoomDownsyncFrame{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoomDownsyncFrame) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoomDownsyncFrame) ProtoMessage() {} - -func (x *RoomDownsyncFrame) 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 RoomDownsyncFrame.ProtoReflect.Descriptor instead. -func (*RoomDownsyncFrame) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{11} -} - -func (x *RoomDownsyncFrame) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *RoomDownsyncFrame) GetPlayers() map[int32]*Player { - if x != nil { - return x.Players - } - return nil -} - -func (x *RoomDownsyncFrame) GetCountdownNanos() int64 { - if x != nil { - return x.CountdownNanos - } - return 0 -} - -func (x *RoomDownsyncFrame) GetPlayerMetas() map[int32]*PlayerMeta { - if x != nil { - return x.PlayerMetas - } - return nil -} - -type WsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MsgId int32 `protobuf:"varint,1,opt,name=msgId,proto3" json:"msgId,omitempty"` - PlayerId int32 `protobuf:"varint,2,opt,name=playerId,proto3" json:"playerId,omitempty"` - Act int32 `protobuf:"varint,3,opt,name=act,proto3" json:"act,omitempty"` - JoinIndex int32 `protobuf:"varint,4,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` - AckingFrameId int32 `protobuf:"varint,5,opt,name=ackingFrameId,proto3" json:"ackingFrameId,omitempty"` - AckingInputFrameId int32 `protobuf:"varint,6,opt,name=ackingInputFrameId,proto3" json:"ackingInputFrameId,omitempty"` - InputFrameUpsyncBatch []*InputFrameUpsync `protobuf:"bytes,7,rep,name=inputFrameUpsyncBatch,proto3" json:"inputFrameUpsyncBatch,omitempty"` - Hb *HeartbeatUpsync `protobuf:"bytes,8,opt,name=hb,proto3" json:"hb,omitempty"` -} - -func (x *WsReq) Reset() { - *x = WsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WsReq) ProtoMessage() {} - -func (x *WsReq) 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 WsReq.ProtoReflect.Descriptor instead. -func (*WsReq) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{12} -} - -func (x *WsReq) GetMsgId() int32 { - if x != nil { - return x.MsgId - } - return 0 -} - -func (x *WsReq) GetPlayerId() int32 { - if x != nil { - return x.PlayerId - } - return 0 -} - -func (x *WsReq) GetAct() int32 { - if x != nil { - return x.Act - } - return 0 -} - -func (x *WsReq) GetJoinIndex() int32 { - if x != nil { - return x.JoinIndex - } - return 0 -} - -func (x *WsReq) GetAckingFrameId() int32 { - if x != nil { - return x.AckingFrameId - } - return 0 -} - -func (x *WsReq) GetAckingInputFrameId() int32 { - if x != nil { - return x.AckingInputFrameId - } - return 0 -} - -func (x *WsReq) GetInputFrameUpsyncBatch() []*InputFrameUpsync { - if x != nil { - return x.InputFrameUpsyncBatch - } - return nil -} - -func (x *WsReq) GetHb() *HeartbeatUpsync { - if x != nil { - return x.Hb - } - return nil -} - -type WsResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ret int32 `protobuf:"varint,1,opt,name=ret,proto3" json:"ret,omitempty"` - EchoedMsgId int32 `protobuf:"varint,2,opt,name=echoedMsgId,proto3" json:"echoedMsgId,omitempty"` - Act int32 `protobuf:"varint,3,opt,name=act,proto3" json:"act,omitempty"` - Rdf *RoomDownsyncFrame `protobuf:"bytes,4,opt,name=rdf,proto3" json:"rdf,omitempty"` - InputFrameDownsyncBatch []*InputFrameDownsync `protobuf:"bytes,5,rep,name=inputFrameDownsyncBatch,proto3" json:"inputFrameDownsyncBatch,omitempty"` - BciFrame *BattleColliderInfo `protobuf:"bytes,6,opt,name=bciFrame,proto3" json:"bciFrame,omitempty"` -} - -func (x *WsResp) Reset() { - *x = WsResp{} - if protoimpl.UnsafeEnabled { - mi := &file_room_downsync_frame_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WsResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WsResp) ProtoMessage() {} - -func (x *WsResp) 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 WsResp.ProtoReflect.Descriptor instead. -func (*WsResp) Descriptor() ([]byte, []int) { - return file_room_downsync_frame_proto_rawDescGZIP(), []int{13} -} - -func (x *WsResp) GetRet() int32 { - if x != nil { - return x.Ret - } - return 0 -} - -func (x *WsResp) GetEchoedMsgId() int32 { - if x != nil { - return x.EchoedMsgId - } - return 0 -} - -func (x *WsResp) GetAct() int32 { - if x != nil { - return x.Act - } - return 0 -} - -func (x *WsResp) GetRdf() *RoomDownsyncFrame { - if x != nil { - return x.Rdf - } - return nil -} - -func (x *WsResp) GetInputFrameDownsyncBatch() []*InputFrameDownsync { - if x != nil { - return x.InputFrameDownsyncBatch - } - return nil -} - -func (x *WsResp) GetBciFrame() *BattleColliderInfo { - if x != nil { - return x.BciFrame - } - return nil -} - -var File_room_downsync_frame_proto protoreflect.FileDescriptor - -var file_room_downsync_frame_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x5f, - 0x66, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x74, 0x72, 0x65, - 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x22, 0x2b, 0x0a, 0x09, - 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x78, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x79, 0x22, 0x23, 0x0a, 0x05, 0x56, 0x65, 0x63, - 0x32, 0x44, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x78, - 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x79, 0x22, 0x6b, - 0x0a, 0x09, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x12, 0x2e, 0x0a, 0x06, 0x41, - 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x18, 0x01, 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, 0x06, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x06, 0x50, - 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 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, 0x06, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x41, 0x0a, 0x09, 0x56, - 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x76, 0x65, 0x63, 0x32, - 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 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, 0x09, 0x76, 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x51, - 0x0a, 0x0d, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x40, 0x0a, 0x0d, 0x70, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, - 0x65, 0x68, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, - 0x32, 0x44, 0x52, 0x0d, 0x70, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, - 0x74, 0x22, 0xaa, 0x0a, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, - 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x67, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x54, 0x6f, 0x56, - 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x3a, 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, 0x2e, 0x53, 0x74, 0x72, 0x54, 0x6f, 0x56, 0x65, 0x63, 0x32, - 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, - 0x74, 0x72, 0x54, 0x6f, 0x56, 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, - 0x12, 0x74, 0x0a, 0x15, 0x73, 0x74, 0x72, 0x54, 0x6f, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, - 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x3e, 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, 0x2e, 0x53, 0x74, 0x72, 0x54, 0x6f, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, - 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x15, 0x73, 0x74, 0x72, 0x54, 0x6f, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, - 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x57, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, - 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x57, 0x12, 0x26, - 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x48, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, - 0x63, 0x72, 0x65, 0x74, 0x65, 0x48, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x67, 0x65, 0x54, - 0x69, 0x6c, 0x65, 0x57, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x67, - 0x65, 0x54, 0x69, 0x6c, 0x65, 0x57, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x67, 0x65, 0x54, - 0x69, 0x6c, 0x65, 0x48, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x67, - 0x65, 0x54, 0x69, 0x6c, 0x65, 0x48, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, - 0x61, 0x6c, 0x54, 0x6f, 0x50, 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x54, 0x6f, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x34, - 0x0a, 0x15, 0x77, 0x69, 0x6c, 0x6c, 0x4b, 0x69, 0x63, 0x6b, 0x49, 0x66, 0x49, 0x6e, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x46, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x77, - 0x69, 0x6c, 0x6c, 0x4b, 0x69, 0x63, 0x6b, 0x49, 0x66, 0x49, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x46, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x6f, 0x6f, - 0x6d, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x13, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x46, 0x70, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x46, 0x70, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x44, - 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, 0x6d, - 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, - 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x69, 0x6e, - 0x70, 0x75, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x26, - 0x0a, 0x0e, 0x6e, 0x73, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x6e, 0x73, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, - 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x1e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, - 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x54, - 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x1e, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, - 0x44, 0x65, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x48, - 0x0a, 0x1f, 0x6d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x50, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x1f, 0x6d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x73, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x50, - 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x70, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x12, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x11, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x13, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x18, 0x13, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x13, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x45, 0x73, 0x74, - 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x12, 0x3c, 0x0a, 0x19, 0x72, 0x6f, 0x6c, 0x6c, - 0x62, 0x61, 0x63, 0x6b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4d, - 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x01, 0x52, 0x19, 0x72, 0x6f, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, - 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x3a, 0x0a, 0x18, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4e, 0x61, 0x6e, - 0x6f, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x03, 0x52, 0x18, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4e, 0x61, 0x6e, - 0x6f, 0x73, 0x1a, 0x60, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x54, 0x6f, 0x56, 0x65, 0x63, 0x32, 0x44, - 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, - 0x56, 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x68, 0x0a, 0x1a, 0x53, 0x74, 0x72, 0x54, 0x6f, 0x50, 0x6f, 0x6c, - 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, - 0x6e, 0x74, 0x65, 0x72, 0x78, 0x2e, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x96, - 0x02, 0x0a, 0x06, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x01, 0x79, 0x12, 0x2c, 0x0a, 0x03, 0x64, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x68, 0x75, 0x6e, - 0x74, 0x65, 0x72, 0x78, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, - 0x64, 0x69, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x61, 0x74, - 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, - 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x6c, - 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, - 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, - 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, - 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, - 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x88, 0x01, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x69, - 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, - 0x61, 0x74, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 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, 0x9f, 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, 0x49, 0x0a, 0x07, 0x70, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, 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, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, - 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x55, - 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x18, 0x04, 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, 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, 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 ( - file_room_downsync_frame_proto_rawDescOnce sync.Once - file_room_downsync_frame_proto_rawDescData = file_room_downsync_frame_proto_rawDesc -) - -func file_room_downsync_frame_proto_rawDescGZIP() []byte { - file_room_downsync_frame_proto_rawDescOnce.Do(func() { - file_room_downsync_frame_proto_rawDescData = protoimpl.X.CompressGZIP(file_room_downsync_frame_proto_rawDescData) - }) - return file_room_downsync_frame_proto_rawDescData -} - -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 - (*Polygon2D)(nil), // 2: treasurehunterx.Polygon2D - (*Vec2DList)(nil), // 3: treasurehunterx.Vec2DList - (*Polygon2DList)(nil), // 4: treasurehunterx.Polygon2DList - (*BattleColliderInfo)(nil), // 5: treasurehunterx.BattleColliderInfo - (*Player)(nil), // 6: treasurehunterx.Player - (*PlayerMeta)(nil), // 7: treasurehunterx.PlayerMeta - (*InputFrameUpsync)(nil), // 8: treasurehunterx.InputFrameUpsync - (*InputFrameDownsync)(nil), // 9: treasurehunterx.InputFrameDownsync - (*HeartbeatUpsync)(nil), // 10: treasurehunterx.HeartbeatUpsync - (*RoomDownsyncFrame)(nil), // 11: treasurehunterx.RoomDownsyncFrame - (*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 - 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 - 16, // 7: treasurehunterx.RoomDownsyncFrame.players:type_name -> treasurehunterx.RoomDownsyncFrame.PlayersEntry - 17, // 8: treasurehunterx.RoomDownsyncFrame.playerMetas:type_name -> treasurehunterx.RoomDownsyncFrame.PlayerMetasEntry - 8, // 9: treasurehunterx.WsReq.inputFrameUpsyncBatch:type_name -> treasurehunterx.InputFrameUpsync - 10, // 10: treasurehunterx.WsReq.hb:type_name -> treasurehunterx.HeartbeatUpsync - 11, // 11: treasurehunterx.WsResp.rdf:type_name -> treasurehunterx.RoomDownsyncFrame - 9, // 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() } -func file_room_downsync_frame_proto_init() { - if File_room_downsync_frame_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_room_downsync_frame_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Direction); 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[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Vec2D); 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[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Polygon2D); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_downsync_frame_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Vec2DList); 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[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Polygon2DList); 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[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleColliderInfo); 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[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Player); 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[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlayerMeta); 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[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InputFrameUpsync); 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.(*InputFrameDownsync); 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.(*HeartbeatUpsync); 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.(*RoomDownsyncFrame); 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.(*WsReq); 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.(*WsResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_room_downsync_frame_proto_rawDesc, - NumEnums: 0, - NumMessages: 18, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_room_downsync_frame_proto_goTypes, - DependencyIndexes: file_room_downsync_frame_proto_depIdxs, - MessageInfos: file_room_downsync_frame_proto_msgTypes, - }.Build() - File_room_downsync_frame_proto = out.File - file_room_downsync_frame_proto_rawDesc = nil - file_room_downsync_frame_proto_goTypes = nil - file_room_downsync_frame_proto_depIdxs = nil -} diff --git a/battle_srv/protos/room_downsync_frame.pb.go b/battle_srv/protos/room_downsync_frame.pb.go new file mode 100644 index 0000000..bd540d9 --- /dev/null +++ b/battle_srv/protos/room_downsync_frame.pb.go @@ -0,0 +1,1250 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.7.1 +// source: room_downsync_frame.proto + +package protos + +import ( + protos "dnmshared/protos" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BattleColliderInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StageName string `protobuf:"bytes,1,opt,name=stageName,proto3" json:"stageName,omitempty"` + StrToVec2DListMap map[string]*protos.Vec2DList `protobuf:"bytes,2,rep,name=strToVec2DListMap,proto3" json:"strToVec2DListMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StrToPolygon2DListMap map[string]*protos.Polygon2DList `protobuf:"bytes,3,rep,name=strToPolygon2DListMap,proto3" json:"strToPolygon2DListMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StageDiscreteW int32 `protobuf:"varint,4,opt,name=stageDiscreteW,proto3" json:"stageDiscreteW,omitempty"` + StageDiscreteH int32 `protobuf:"varint,5,opt,name=stageDiscreteH,proto3" json:"stageDiscreteH,omitempty"` + StageTileW int32 `protobuf:"varint,6,opt,name=stageTileW,proto3" json:"stageTileW,omitempty"` + StageTileH int32 `protobuf:"varint,7,opt,name=stageTileH,proto3" json:"stageTileH,omitempty"` + IntervalToPing int32 `protobuf:"varint,8,opt,name=intervalToPing,proto3" json:"intervalToPing,omitempty"` + WillKickIfInactiveFor int32 `protobuf:"varint,9,opt,name=willKickIfInactiveFor,proto3" json:"willKickIfInactiveFor,omitempty"` + BoundRoomId int32 `protobuf:"varint,10,opt,name=boundRoomId,proto3" json:"boundRoomId,omitempty"` + BattleDurationNanos int64 `protobuf:"varint,11,opt,name=battleDurationNanos,proto3" json:"battleDurationNanos,omitempty"` + ServerFps int32 `protobuf:"varint,12,opt,name=serverFps,proto3" json:"serverFps,omitempty"` + InputDelayFrames int32 `protobuf:"varint,13,opt,name=inputDelayFrames,proto3" json:"inputDelayFrames,omitempty"` + InputScaleFrames uint32 `protobuf:"varint,14,opt,name=inputScaleFrames,proto3" json:"inputScaleFrames,omitempty"` + NstDelayFrames int32 `protobuf:"varint,15,opt,name=nstDelayFrames,proto3" json:"nstDelayFrames,omitempty"` + InputFrameUpsyncDelayTolerance int32 `protobuf:"varint,16,opt,name=inputFrameUpsyncDelayTolerance,proto3" json:"inputFrameUpsyncDelayTolerance,omitempty"` + MaxChasingRenderFramesPerUpdate int32 `protobuf:"varint,17,opt,name=maxChasingRenderFramesPerUpdate,proto3" json:"maxChasingRenderFramesPerUpdate,omitempty"` + PlayerBattleState int32 `protobuf:"varint,18,opt,name=playerBattleState,proto3" json:"playerBattleState,omitempty"` + RollbackEstimatedDtMillis float64 `protobuf:"fixed64,19,opt,name=rollbackEstimatedDtMillis,proto3" json:"rollbackEstimatedDtMillis,omitempty"` + RollbackEstimatedDtNanos int64 `protobuf:"varint,20,opt,name=rollbackEstimatedDtNanos,proto3" json:"rollbackEstimatedDtNanos,omitempty"` + WorldToVirtualGridRatio float64 `protobuf:"fixed64,21,opt,name=worldToVirtualGridRatio,proto3" json:"worldToVirtualGridRatio,omitempty"` + VirtualGridToWorldRatio float64 `protobuf:"fixed64,22,opt,name=virtualGridToWorldRatio,proto3" json:"virtualGridToWorldRatio,omitempty"` +} + +func (x *BattleColliderInfo) Reset() { + *x = BattleColliderInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BattleColliderInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BattleColliderInfo) ProtoMessage() {} + +func (x *BattleColliderInfo) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[0] + 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 BattleColliderInfo.ProtoReflect.Descriptor instead. +func (*BattleColliderInfo) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{0} +} + +func (x *BattleColliderInfo) GetStageName() string { + if x != nil { + return x.StageName + } + return "" +} + +func (x *BattleColliderInfo) GetStrToVec2DListMap() map[string]*protos.Vec2DList { + if x != nil { + return x.StrToVec2DListMap + } + return nil +} + +func (x *BattleColliderInfo) GetStrToPolygon2DListMap() map[string]*protos.Polygon2DList { + if x != nil { + return x.StrToPolygon2DListMap + } + return nil +} + +func (x *BattleColliderInfo) GetStageDiscreteW() int32 { + if x != nil { + return x.StageDiscreteW + } + return 0 +} + +func (x *BattleColliderInfo) GetStageDiscreteH() int32 { + if x != nil { + return x.StageDiscreteH + } + return 0 +} + +func (x *BattleColliderInfo) GetStageTileW() int32 { + if x != nil { + return x.StageTileW + } + return 0 +} + +func (x *BattleColliderInfo) GetStageTileH() int32 { + if x != nil { + return x.StageTileH + } + return 0 +} + +func (x *BattleColliderInfo) GetIntervalToPing() int32 { + if x != nil { + return x.IntervalToPing + } + return 0 +} + +func (x *BattleColliderInfo) GetWillKickIfInactiveFor() int32 { + if x != nil { + return x.WillKickIfInactiveFor + } + return 0 +} + +func (x *BattleColliderInfo) GetBoundRoomId() int32 { + if x != nil { + return x.BoundRoomId + } + return 0 +} + +func (x *BattleColliderInfo) GetBattleDurationNanos() int64 { + if x != nil { + return x.BattleDurationNanos + } + return 0 +} + +func (x *BattleColliderInfo) GetServerFps() int32 { + if x != nil { + return x.ServerFps + } + return 0 +} + +func (x *BattleColliderInfo) GetInputDelayFrames() int32 { + if x != nil { + return x.InputDelayFrames + } + return 0 +} + +func (x *BattleColliderInfo) GetInputScaleFrames() uint32 { + if x != nil { + return x.InputScaleFrames + } + return 0 +} + +func (x *BattleColliderInfo) GetNstDelayFrames() int32 { + if x != nil { + return x.NstDelayFrames + } + return 0 +} + +func (x *BattleColliderInfo) GetInputFrameUpsyncDelayTolerance() int32 { + if x != nil { + return x.InputFrameUpsyncDelayTolerance + } + return 0 +} + +func (x *BattleColliderInfo) GetMaxChasingRenderFramesPerUpdate() int32 { + if x != nil { + return x.MaxChasingRenderFramesPerUpdate + } + return 0 +} + +func (x *BattleColliderInfo) GetPlayerBattleState() int32 { + if x != nil { + return x.PlayerBattleState + } + return 0 +} + +func (x *BattleColliderInfo) GetRollbackEstimatedDtMillis() float64 { + if x != nil { + return x.RollbackEstimatedDtMillis + } + return 0 +} + +func (x *BattleColliderInfo) GetRollbackEstimatedDtNanos() int64 { + if x != nil { + return x.RollbackEstimatedDtNanos + } + return 0 +} + +func (x *BattleColliderInfo) GetWorldToVirtualGridRatio() float64 { + if x != nil { + return x.WorldToVirtualGridRatio + } + return 0 +} + +func (x *BattleColliderInfo) GetVirtualGridToWorldRatio() float64 { + if x != nil { + return x.VirtualGridToWorldRatio + } + return 0 +} + +type Player struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + VirtualGridX int32 `protobuf:"varint,2,opt,name=virtualGridX,proto3" json:"virtualGridX,omitempty"` + VirtualGridY int32 `protobuf:"varint,3,opt,name=virtualGridY,proto3" json:"virtualGridY,omitempty"` + Dir *protos.Direction `protobuf:"bytes,4,opt,name=dir,proto3" json:"dir,omitempty"` + Speed int32 `protobuf:"varint,5,opt,name=speed,proto3" json:"speed,omitempty"` // in terms of virtual grid units + BattleState int32 `protobuf:"varint,6,opt,name=battleState,proto3" json:"battleState,omitempty"` + LastMoveGmtMillis int32 `protobuf:"varint,7,opt,name=lastMoveGmtMillis,proto3" json:"lastMoveGmtMillis,omitempty"` + Score int32 `protobuf:"varint,10,opt,name=score,proto3" json:"score,omitempty"` + Removed bool `protobuf:"varint,11,opt,name=removed,proto3" json:"removed,omitempty"` + JoinIndex int32 `protobuf:"varint,12,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` +} + +func (x *Player) Reset() { + *x = Player{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Player) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Player) ProtoMessage() {} + +func (x *Player) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[1] + 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 Player.ProtoReflect.Descriptor instead. +func (*Player) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{1} +} + +func (x *Player) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Player) GetVirtualGridX() int32 { + if x != nil { + return x.VirtualGridX + } + return 0 +} + +func (x *Player) GetVirtualGridY() int32 { + if x != nil { + return x.VirtualGridY + } + return 0 +} + +func (x *Player) GetDir() *protos.Direction { + if x != nil { + return x.Dir + } + return nil +} + +func (x *Player) GetSpeed() int32 { + if x != nil { + return x.Speed + } + return 0 +} + +func (x *Player) GetBattleState() int32 { + if x != nil { + return x.BattleState + } + return 0 +} + +func (x *Player) GetLastMoveGmtMillis() int32 { + if x != nil { + return x.LastMoveGmtMillis + } + return 0 +} + +func (x *Player) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *Player) GetRemoved() bool { + if x != nil { + return x.Removed + } + return false +} + +func (x *Player) GetJoinIndex() int32 { + if x != nil { + return x.JoinIndex + } + return 0 +} + +type PlayerMeta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=displayName,proto3" json:"displayName,omitempty"` + Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` + JoinIndex int32 `protobuf:"varint,5,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` +} + +func (x *PlayerMeta) Reset() { + *x = PlayerMeta{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayerMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayerMeta) ProtoMessage() {} + +func (x *PlayerMeta) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlayerMeta.ProtoReflect.Descriptor instead. +func (*PlayerMeta) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{2} +} + +func (x *PlayerMeta) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayerMeta) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PlayerMeta) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *PlayerMeta) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *PlayerMeta) GetJoinIndex() int32 { + if x != nil { + return x.JoinIndex + } + return 0 +} + +type InputFrameUpsync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InputFrameId int32 `protobuf:"varint,1,opt,name=inputFrameId,proto3" json:"inputFrameId,omitempty"` + EncodedDir int32 `protobuf:"varint,6,opt,name=encodedDir,proto3" json:"encodedDir,omitempty"` +} + +func (x *InputFrameUpsync) Reset() { + *x = InputFrameUpsync{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InputFrameUpsync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputFrameUpsync) ProtoMessage() {} + +func (x *InputFrameUpsync) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[3] + 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 InputFrameUpsync.ProtoReflect.Descriptor instead. +func (*InputFrameUpsync) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{3} +} + +func (x *InputFrameUpsync) GetInputFrameId() int32 { + if x != nil { + return x.InputFrameId + } + return 0 +} + +func (x *InputFrameUpsync) GetEncodedDir() int32 { + if x != nil { + return x.EncodedDir + } + return 0 +} + +type InputFrameDownsync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InputFrameId int32 `protobuf:"varint,1,opt,name=inputFrameId,proto3" json:"inputFrameId,omitempty"` + InputList []uint64 `protobuf:"varint,2,rep,packed,name=inputList,proto3" json:"inputList,omitempty"` // Indexed by "joinIndex", we try to compress the "single player input" into 1 word (64-bit for 64-bit Golang runtime) because atomic compare-and-swap only works on 1 word. Although CAS on custom struct is possible in Golang 1.19 https://pkg.go.dev/sync/atomic@go1.19.1#Value.CompareAndSwap, using a single word is still faster whenever possible. + ConfirmedList uint64 `protobuf:"varint,3,opt,name=confirmedList,proto3" json:"confirmedList,omitempty"` // Indexed by "joinIndex", same compression concern as above +} + +func (x *InputFrameDownsync) Reset() { + *x = InputFrameDownsync{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InputFrameDownsync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputFrameDownsync) ProtoMessage() {} + +func (x *InputFrameDownsync) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[4] + 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 InputFrameDownsync.ProtoReflect.Descriptor instead. +func (*InputFrameDownsync) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{4} +} + +func (x *InputFrameDownsync) GetInputFrameId() int32 { + if x != nil { + return x.InputFrameId + } + return 0 +} + +func (x *InputFrameDownsync) GetInputList() []uint64 { + if x != nil { + return x.InputList + } + return nil +} + +func (x *InputFrameDownsync) GetConfirmedList() uint64 { + if x != nil { + return x.ConfirmedList + } + return 0 +} + +type HeartbeatUpsync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientTimestamp int64 `protobuf:"varint,1,opt,name=clientTimestamp,proto3" json:"clientTimestamp,omitempty"` +} + +func (x *HeartbeatUpsync) Reset() { + *x = HeartbeatUpsync{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeartbeatUpsync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeartbeatUpsync) ProtoMessage() {} + +func (x *HeartbeatUpsync) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[5] + 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 HeartbeatUpsync.ProtoReflect.Descriptor instead. +func (*HeartbeatUpsync) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{5} +} + +func (x *HeartbeatUpsync) GetClientTimestamp() int64 { + if x != nil { + return x.ClientTimestamp + } + return 0 +} + +type RoomDownsyncFrame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Players map[int32]*Player `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"` + PlayerMetas map[int32]*PlayerMeta `protobuf:"bytes,4,rep,name=playerMetas,proto3" json:"playerMetas,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *RoomDownsyncFrame) Reset() { + *x = RoomDownsyncFrame{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoomDownsyncFrame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoomDownsyncFrame) ProtoMessage() {} + +func (x *RoomDownsyncFrame) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[6] + 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 RoomDownsyncFrame.ProtoReflect.Descriptor instead. +func (*RoomDownsyncFrame) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{6} +} + +func (x *RoomDownsyncFrame) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RoomDownsyncFrame) GetPlayers() map[int32]*Player { + if x != nil { + return x.Players + } + return nil +} + +func (x *RoomDownsyncFrame) GetCountdownNanos() int64 { + if x != nil { + return x.CountdownNanos + } + return 0 +} + +func (x *RoomDownsyncFrame) GetPlayerMetas() map[int32]*PlayerMeta { + if x != nil { + return x.PlayerMetas + } + return nil +} + +type WsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MsgId int32 `protobuf:"varint,1,opt,name=msgId,proto3" json:"msgId,omitempty"` + PlayerId int32 `protobuf:"varint,2,opt,name=playerId,proto3" json:"playerId,omitempty"` + Act int32 `protobuf:"varint,3,opt,name=act,proto3" json:"act,omitempty"` + JoinIndex int32 `protobuf:"varint,4,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` + AckingFrameId int32 `protobuf:"varint,5,opt,name=ackingFrameId,proto3" json:"ackingFrameId,omitempty"` + AckingInputFrameId int32 `protobuf:"varint,6,opt,name=ackingInputFrameId,proto3" json:"ackingInputFrameId,omitempty"` + InputFrameUpsyncBatch []*InputFrameUpsync `protobuf:"bytes,7,rep,name=inputFrameUpsyncBatch,proto3" json:"inputFrameUpsyncBatch,omitempty"` + Hb *HeartbeatUpsync `protobuf:"bytes,8,opt,name=hb,proto3" json:"hb,omitempty"` +} + +func (x *WsReq) Reset() { + *x = WsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WsReq) ProtoMessage() {} + +func (x *WsReq) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[7] + 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 WsReq.ProtoReflect.Descriptor instead. +func (*WsReq) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{7} +} + +func (x *WsReq) GetMsgId() int32 { + if x != nil { + return x.MsgId + } + return 0 +} + +func (x *WsReq) GetPlayerId() int32 { + if x != nil { + return x.PlayerId + } + return 0 +} + +func (x *WsReq) GetAct() int32 { + if x != nil { + return x.Act + } + return 0 +} + +func (x *WsReq) GetJoinIndex() int32 { + if x != nil { + return x.JoinIndex + } + return 0 +} + +func (x *WsReq) GetAckingFrameId() int32 { + if x != nil { + return x.AckingFrameId + } + return 0 +} + +func (x *WsReq) GetAckingInputFrameId() int32 { + if x != nil { + return x.AckingInputFrameId + } + return 0 +} + +func (x *WsReq) GetInputFrameUpsyncBatch() []*InputFrameUpsync { + if x != nil { + return x.InputFrameUpsyncBatch + } + return nil +} + +func (x *WsReq) GetHb() *HeartbeatUpsync { + if x != nil { + return x.Hb + } + return nil +} + +type WsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ret int32 `protobuf:"varint,1,opt,name=ret,proto3" json:"ret,omitempty"` + EchoedMsgId int32 `protobuf:"varint,2,opt,name=echoedMsgId,proto3" json:"echoedMsgId,omitempty"` + Act int32 `protobuf:"varint,3,opt,name=act,proto3" json:"act,omitempty"` + Rdf *RoomDownsyncFrame `protobuf:"bytes,4,opt,name=rdf,proto3" json:"rdf,omitempty"` + InputFrameDownsyncBatch []*InputFrameDownsync `protobuf:"bytes,5,rep,name=inputFrameDownsyncBatch,proto3" json:"inputFrameDownsyncBatch,omitempty"` + BciFrame *BattleColliderInfo `protobuf:"bytes,6,opt,name=bciFrame,proto3" json:"bciFrame,omitempty"` +} + +func (x *WsResp) Reset() { + *x = WsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WsResp) ProtoMessage() {} + +func (x *WsResp) 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 WsResp.ProtoReflect.Descriptor instead. +func (*WsResp) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{8} +} + +func (x *WsResp) GetRet() int32 { + if x != nil { + return x.Ret + } + return 0 +} + +func (x *WsResp) GetEchoedMsgId() int32 { + if x != nil { + return x.EchoedMsgId + } + return 0 +} + +func (x *WsResp) GetAct() int32 { + if x != nil { + return x.Act + } + return 0 +} + +func (x *WsResp) GetRdf() *RoomDownsyncFrame { + if x != nil { + return x.Rdf + } + return nil +} + +func (x *WsResp) GetInputFrameDownsyncBatch() []*InputFrameDownsync { + if x != nil { + return x.InputFrameDownsyncBatch + } + return nil +} + +func (x *WsResp) GetBciFrame() *BattleColliderInfo { + if x != nil { + return x.BciFrame + } + return nil +} + +var File_room_downsync_frame_proto protoreflect.FileDescriptor + +var file_room_downsync_frame_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x5f, + 0x66, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x1a, 0x0e, 0x67, 0x65, 0x6f, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x0a, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, + 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, + 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x74, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x5f, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x54, + 0x6f, 0x56, 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x53, 0x74, 0x72, 0x54, 0x6f, 0x56, 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x54, 0x6f, 0x56, 0x65, 0x63, + 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x15, 0x73, 0x74, 0x72, + 0x54, 0x6f, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x72, 0x54, 0x6f, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, + 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x15, 0x73, 0x74, 0x72, 0x54, 0x6f, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, + 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, + 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x57, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, + 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x57, 0x12, 0x26, + 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x48, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, + 0x63, 0x72, 0x65, 0x74, 0x65, 0x48, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x67, 0x65, 0x54, + 0x69, 0x6c, 0x65, 0x57, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x67, + 0x65, 0x54, 0x69, 0x6c, 0x65, 0x57, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x67, 0x65, 0x54, + 0x69, 0x6c, 0x65, 0x48, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x67, + 0x65, 0x54, 0x69, 0x6c, 0x65, 0x48, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, + 0x61, 0x6c, 0x54, 0x6f, 0x50, 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x54, 0x6f, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x34, + 0x0a, 0x15, 0x77, 0x69, 0x6c, 0x6c, 0x4b, 0x69, 0x63, 0x6b, 0x49, 0x66, 0x49, 0x6e, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x46, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x77, + 0x69, 0x6c, 0x6c, 0x4b, 0x69, 0x63, 0x6b, 0x49, 0x66, 0x49, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x46, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x6f, 0x6f, + 0x6d, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x13, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x46, 0x70, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x46, 0x70, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x44, + 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x69, 0x6e, + 0x70, 0x75, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x26, + 0x0a, 0x0e, 0x6e, 0x73, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x6e, 0x73, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x1e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x54, + 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x1e, + 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, + 0x44, 0x65, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x48, + 0x0a, 0x1f, 0x6d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x50, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x1f, 0x6d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x73, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x50, + 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x70, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x12, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x11, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x19, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, + 0x63, 0x6b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4d, 0x69, 0x6c, + 0x6c, 0x69, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x01, 0x52, 0x19, 0x72, 0x6f, 0x6c, 0x6c, 0x62, + 0x61, 0x63, 0x6b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4d, 0x69, + 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x3a, 0x0a, 0x18, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4e, 0x61, 0x6e, 0x6f, 0x73, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, 0x18, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4e, 0x61, 0x6e, 0x6f, 0x73, + 0x12, 0x38, 0x0a, 0x17, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x54, 0x6f, 0x56, 0x69, 0x72, 0x74, 0x75, + 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x17, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x54, 0x6f, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, + 0x6c, 0x47, 0x72, 0x69, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x38, 0x0a, 0x17, 0x76, 0x69, + 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x54, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64, + 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x17, 0x76, 0x69, 0x72, + 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x54, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x52, + 0x61, 0x74, 0x69, 0x6f, 0x1a, 0x57, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x54, 0x6f, 0x56, 0x65, 0x63, + 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x56, 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5f, 0x0a, + 0x1a, 0x53, 0x74, 0x72, 0x54, 0x6f, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, + 0x69, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb9, + 0x02, 0x0a, 0x06, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x69, 0x72, + 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x58, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0c, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x58, 0x12, 0x22, 0x0a, + 0x0c, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x59, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0c, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, + 0x59, 0x12, 0x23, 0x0a, 0x03, 0x64, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x03, 0x64, 0x69, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, + 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, + 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, + 0x6c, 0x69, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, + 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, + 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x88, 0x01, 0x0a, 0x0a, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, + 0x49, 0x6e, 0x64, 0x65, 0x78, 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, 0xfb, 0x02, 0x0a, 0x11, 0x52, 0x6f, 0x6f, + 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x40, + 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, + 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, + 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, + 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, + 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x4c, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, + 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, + 0x65, 0x74, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x1a, 0x4a, 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, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x52, 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, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb8, 0x02, 0x0a, 0x05, 0x57, 0x73, 0x52, 0x65, 0x71, + 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x61, 0x63, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, + 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x61, 0x63, 0x6b, 0x69, + 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x15, 0x69, 0x6e, 0x70, 0x75, + 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, + 0x63, 0x52, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, + 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x27, 0x0a, 0x02, 0x68, 0x62, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, + 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x02, 0x68, + 0x62, 0x22, 0x89, 0x02, 0x0a, 0x06, 0x57, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, + 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x65, 0x74, 0x12, 0x20, + 0x0a, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x49, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, + 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x03, 0x72, 0x64, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, + 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x03, 0x72, 0x64, 0x66, 0x12, + 0x54, 0x0a, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, + 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x17, 0x69, 0x6e, + 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x36, 0x0a, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x42, 0x13, 0x5a, + 0x11, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x73, 0x72, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_room_downsync_frame_proto_rawDescOnce sync.Once + file_room_downsync_frame_proto_rawDescData = file_room_downsync_frame_proto_rawDesc +) + +func file_room_downsync_frame_proto_rawDescGZIP() []byte { + file_room_downsync_frame_proto_rawDescOnce.Do(func() { + file_room_downsync_frame_proto_rawDescData = protoimpl.X.CompressGZIP(file_room_downsync_frame_proto_rawDescData) + }) + return file_room_downsync_frame_proto_rawDescData +} + +var file_room_downsync_frame_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_room_downsync_frame_proto_goTypes = []interface{}{ + (*BattleColliderInfo)(nil), // 0: protos.BattleColliderInfo + (*Player)(nil), // 1: protos.Player + (*PlayerMeta)(nil), // 2: protos.PlayerMeta + (*InputFrameUpsync)(nil), // 3: protos.InputFrameUpsync + (*InputFrameDownsync)(nil), // 4: protos.InputFrameDownsync + (*HeartbeatUpsync)(nil), // 5: protos.HeartbeatUpsync + (*RoomDownsyncFrame)(nil), // 6: protos.RoomDownsyncFrame + (*WsReq)(nil), // 7: protos.WsReq + (*WsResp)(nil), // 8: protos.WsResp + nil, // 9: protos.BattleColliderInfo.StrToVec2DListMapEntry + nil, // 10: protos.BattleColliderInfo.StrToPolygon2DListMapEntry + nil, // 11: protos.RoomDownsyncFrame.PlayersEntry + nil, // 12: protos.RoomDownsyncFrame.PlayerMetasEntry + (*protos.Direction)(nil), // 13: protos.Direction + (*protos.Vec2DList)(nil), // 14: protos.Vec2DList + (*protos.Polygon2DList)(nil), // 15: protos.Polygon2DList +} +var file_room_downsync_frame_proto_depIdxs = []int32{ + 9, // 0: protos.BattleColliderInfo.strToVec2DListMap:type_name -> protos.BattleColliderInfo.StrToVec2DListMapEntry + 10, // 1: protos.BattleColliderInfo.strToPolygon2DListMap:type_name -> protos.BattleColliderInfo.StrToPolygon2DListMapEntry + 13, // 2: protos.Player.dir:type_name -> protos.Direction + 11, // 3: protos.RoomDownsyncFrame.players:type_name -> protos.RoomDownsyncFrame.PlayersEntry + 12, // 4: protos.RoomDownsyncFrame.playerMetas:type_name -> protos.RoomDownsyncFrame.PlayerMetasEntry + 3, // 5: protos.WsReq.inputFrameUpsyncBatch:type_name -> protos.InputFrameUpsync + 5, // 6: protos.WsReq.hb:type_name -> protos.HeartbeatUpsync + 6, // 7: protos.WsResp.rdf:type_name -> protos.RoomDownsyncFrame + 4, // 8: protos.WsResp.inputFrameDownsyncBatch:type_name -> protos.InputFrameDownsync + 0, // 9: protos.WsResp.bciFrame:type_name -> protos.BattleColliderInfo + 14, // 10: protos.BattleColliderInfo.StrToVec2DListMapEntry.value:type_name -> protos.Vec2DList + 15, // 11: protos.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> protos.Polygon2DList + 1, // 12: protos.RoomDownsyncFrame.PlayersEntry.value:type_name -> protos.Player + 2, // 13: protos.RoomDownsyncFrame.PlayerMetasEntry.value:type_name -> protos.PlayerMeta + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_room_downsync_frame_proto_init() } +func file_room_downsync_frame_proto_init() { + if File_room_downsync_frame_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_room_downsync_frame_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BattleColliderInfo); 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[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Player); 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[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayerMeta); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InputFrameUpsync); 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[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InputFrameDownsync); 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[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeartbeatUpsync); 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[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoomDownsyncFrame); 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[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WsReq); 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[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_room_downsync_frame_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_room_downsync_frame_proto_goTypes, + DependencyIndexes: file_room_downsync_frame_proto_depIdxs, + MessageInfos: file_room_downsync_frame_proto_msgTypes, + }.Build() + File_room_downsync_frame_proto = out.File + file_room_downsync_frame_proto_rawDesc = nil + file_room_downsync_frame_proto_goTypes = nil + file_room_downsync_frame_proto_depIdxs = nil +} diff --git a/battle_srv/ws/serve.go b/battle_srv/ws/serve.go index 0830d2c..0c30f8d 100644 --- a/battle_srv/ws/serve.go +++ b/battle_srv/ws/serve.go @@ -8,9 +8,9 @@ import ( "github.com/gorilla/websocket" "go.uber.org/zap" "net/http" - . "server/common" - "server/models" - pb "server/pb_output" + . "battle_srv/common" + "battle_srv/models" + pb "battle_srv/protos" "strconv" "sync/atomic" "time" @@ -263,9 +263,11 @@ func Serve(c *gin.Context) { InputFrameUpsyncDelayTolerance: pRoom.InputFrameUpsyncDelayTolerance, MaxChasingRenderFramesPerUpdate: pRoom.MaxChasingRenderFramesPerUpdate, PlayerBattleState: pThePlayer.BattleState, // For frontend to know whether it's rejoining - RollbackEstimatedDt: pRoom.RollbackEstimatedDt, RollbackEstimatedDtMillis: pRoom.RollbackEstimatedDtMillis, RollbackEstimatedDtNanos: pRoom.RollbackEstimatedDtNanos, + + WorldToVirtualGridRatio: pRoom.WorldToVirtualGridRatio, + VirtualGridToWorldRatio: pRoom.VirtualGridToWorldRatio, } resp := &pb.WsResp{ diff --git a/collider_visualizer/go.mod b/collider_visualizer/go.mod index e05463a..9d2c1eb 100644 --- a/collider_visualizer/go.mod +++ b/collider_visualizer/go.mod @@ -3,11 +3,11 @@ module viscol go 1.19 require ( + dnmshared v0.0.0 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/hajimehoshi/ebiten/v2 v2.4.7 github.com/solarlune/resolv v0.5.1 golang.org/x/image v0.0.0-20220902085622-e7cb96979f69 - dnmshared v0.0.0 ) require ( @@ -22,6 +22,7 @@ require ( golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 // indirect golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105 // indirect golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect + google.golang.org/protobuf v1.28.1 // indirect ) replace dnmshared => ../dnmshared diff --git a/collider_visualizer/go.sum b/collider_visualizer/go.sum index 3eb8bba..376124f 100644 --- a/collider_visualizer/go.sum +++ b/collider_visualizer/go.sum @@ -7,6 +7,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad h1:kX51IjbsJP github.com/go-gl/glfw/v3.3/glfw v0.0.0-20220806181222-55e207c401ad/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/hajimehoshi/bitmapfont/v2 v2.2.1 h1:y7zcy02/UgO24IL3COqYtrRZzhRucNBtmCo/SNU648k= github.com/hajimehoshi/bitmapfont/v2 v2.2.1/go.mod h1:wjrYAy8vKgj9JsFgnYAOK346/uvE22TlmqouzdnYIs0= github.com/hajimehoshi/ebiten/v2 v2.4.7 h1:XuvB7R0Rbw/O7g6vNU8gqr5b9e7MNhhAONMSsyreLDI= @@ -93,4 +95,8 @@ golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098/go.mod h1:LGqMHiF4EqQNHR golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/dnmshared/geometry.go b/dnmshared/geometry.go index 638d8b6..e4e0ef0 100644 --- a/dnmshared/geometry.go +++ b/dnmshared/geometry.go @@ -2,46 +2,45 @@ package dnmshared import ( "math" + . "dnmshared/protos" ) -// Use type `float64` for json unmarshalling of numbers. -type Direction struct { - Dx int32 `json:"dx,omitempty"` - Dy int32 `json:"dy,omitempty"` -} - -type Vec2D struct { - X float64 `json:"x,omitempty"` - Y float64 `json:"y,omitempty"` -} - func NormVec2D(dx, dy float64) Vec2D { - return Vec2D{dy, -dx} + return Vec2D{X: dy, Y:-dx} } -type Polygon2D struct { - Anchor *Vec2D `json:"-"` // This "Polygon2D.Anchor" is used to be assigned to "B2BodyDef.Position", which in turn is used as the position of the FIRST POINT of the polygon. - Points []*Vec2D `json:"-"` +func AlignPolygon2DToBoundingBox(input *Polygon2D) *Polygon2D { + // Transform again to put "anchor" at the top-left point of the bounding box for "resolv" + boundingBoxTL := &Vec2D{ + X: math.MaxFloat64, + Y: math.MaxFloat64, + } + for _, p := range input.Points { + if p.X < boundingBoxTL.X { + boundingBoxTL.X = p.X + } + if p.Y < boundingBoxTL.Y { + boundingBoxTL.Y = p.Y + } + } - /* - When used to represent a "polyline directly drawn in a `Tmx file`", we can initialize both "Anchor" and "Points" simultaneously. + // Now "input.Anchor" should move to "input.Anchor+boundingBoxTL", thus "boundingBoxTL" is also the value of the negative diff for all "input.Points" + output := &Polygon2D{ + Anchor: &Vec2D{ + X: input.Anchor.X + boundingBoxTL.X, + Y: input.Anchor.Y + boundingBoxTL.Y, + }, + Points: make([]*Vec2D, len(input.Points)), + } - Yet when used to represent a "polyline drawn in a `Tsx file`", we have to first initialize "Points w.r.t. center of the tile-rectangle", and then "Anchor(initially nil) of the tile positioned in the `Tmx file`". + for i, p := range input.Points { + output.Points[i] = &Vec2D{ + X: p.X - boundingBoxTL.X, + Y: p.Y - boundingBoxTL.Y, + } + } - Refer to https://shimo.im/docs/SmLJJhXm2C8XMzZT for more information. - */ - - /* - [WARNING] Used to cache "`TileWidth & TileHeight` of a Tsx file" only. - */ - TileWidth int - TileHeight int - - /* - [WARNING] Used to cache "`Width & TileHeight` of an object in Tmx file" only. - */ - TmxObjectWidth float64 - TmxObjectHeight float64 + return output } func Distance(pt1 *Vec2D, pt2 *Vec2D) float64 { diff --git a/dnmshared/go.mod b/dnmshared/go.mod index 5d40f79..919ac63 100644 --- a/dnmshared/go.mod +++ b/dnmshared/go.mod @@ -1,3 +1,3 @@ -module tiled +module dnmshared go 1.19 diff --git a/dnmshared/protos/geometry.pb.go b/dnmshared/protos/geometry.pb.go new file mode 100644 index 0000000..4952826 --- /dev/null +++ b/dnmshared/protos/geometry.pb.go @@ -0,0 +1,425 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.7.1 +// source: geometry.proto + +package protos + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Direction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dx int32 `protobuf:"varint,1,opt,name=dx,proto3" json:"dx,omitempty"` + Dy int32 `protobuf:"varint,2,opt,name=dy,proto3" json:"dy,omitempty"` +} + +func (x *Direction) Reset() { + *x = Direction{} + if protoimpl.UnsafeEnabled { + mi := &file_geometry_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Direction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Direction) ProtoMessage() {} + +func (x *Direction) ProtoReflect() protoreflect.Message { + mi := &file_geometry_proto_msgTypes[0] + 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 Direction.ProtoReflect.Descriptor instead. +func (*Direction) Descriptor() ([]byte, []int) { + return file_geometry_proto_rawDescGZIP(), []int{0} +} + +func (x *Direction) GetDx() int32 { + if x != nil { + return x.Dx + } + return 0 +} + +func (x *Direction) GetDy() int32 { + if x != nil { + return x.Dy + } + return 0 +} + +type Vec2D struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X float64 `protobuf:"fixed64,1,opt,name=x,proto3" json:"x,omitempty"` + Y float64 `protobuf:"fixed64,2,opt,name=y,proto3" json:"y,omitempty"` +} + +func (x *Vec2D) Reset() { + *x = Vec2D{} + if protoimpl.UnsafeEnabled { + mi := &file_geometry_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Vec2D) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Vec2D) ProtoMessage() {} + +func (x *Vec2D) ProtoReflect() protoreflect.Message { + mi := &file_geometry_proto_msgTypes[1] + 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 Vec2D.ProtoReflect.Descriptor instead. +func (*Vec2D) Descriptor() ([]byte, []int) { + return file_geometry_proto_rawDescGZIP(), []int{1} +} + +func (x *Vec2D) GetX() float64 { + if x != nil { + return x.X + } + return 0 +} + +func (x *Vec2D) GetY() float64 { + if x != nil { + return x.Y + } + return 0 +} + +type Polygon2D struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Anchor *Vec2D `protobuf:"bytes,1,opt,name=anchor,proto3" json:"anchor,omitempty"` + Points []*Vec2D `protobuf:"bytes,2,rep,name=points,proto3" json:"points,omitempty"` +} + +func (x *Polygon2D) Reset() { + *x = Polygon2D{} + if protoimpl.UnsafeEnabled { + mi := &file_geometry_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Polygon2D) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Polygon2D) ProtoMessage() {} + +func (x *Polygon2D) ProtoReflect() protoreflect.Message { + mi := &file_geometry_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Polygon2D.ProtoReflect.Descriptor instead. +func (*Polygon2D) Descriptor() ([]byte, []int) { + return file_geometry_proto_rawDescGZIP(), []int{2} +} + +func (x *Polygon2D) GetAnchor() *Vec2D { + if x != nil { + return x.Anchor + } + return nil +} + +func (x *Polygon2D) GetPoints() []*Vec2D { + if x != nil { + return x.Points + } + return nil +} + +type Vec2DList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Eles []*Vec2D `protobuf:"bytes,1,rep,name=eles,proto3" json:"eles,omitempty"` +} + +func (x *Vec2DList) Reset() { + *x = Vec2DList{} + if protoimpl.UnsafeEnabled { + mi := &file_geometry_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Vec2DList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Vec2DList) ProtoMessage() {} + +func (x *Vec2DList) ProtoReflect() protoreflect.Message { + mi := &file_geometry_proto_msgTypes[3] + 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 Vec2DList.ProtoReflect.Descriptor instead. +func (*Vec2DList) Descriptor() ([]byte, []int) { + return file_geometry_proto_rawDescGZIP(), []int{3} +} + +func (x *Vec2DList) GetEles() []*Vec2D { + if x != nil { + return x.Eles + } + return nil +} + +type Polygon2DList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Eles []*Polygon2D `protobuf:"bytes,1,rep,name=eles,proto3" json:"eles,omitempty"` +} + +func (x *Polygon2DList) Reset() { + *x = Polygon2DList{} + if protoimpl.UnsafeEnabled { + mi := &file_geometry_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Polygon2DList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Polygon2DList) ProtoMessage() {} + +func (x *Polygon2DList) ProtoReflect() protoreflect.Message { + mi := &file_geometry_proto_msgTypes[4] + 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 Polygon2DList.ProtoReflect.Descriptor instead. +func (*Polygon2DList) Descriptor() ([]byte, []int) { + return file_geometry_proto_rawDescGZIP(), []int{4} +} + +func (x *Polygon2DList) GetEles() []*Polygon2D { + if x != nil { + return x.Eles + } + return nil +} + +var File_geometry_proto protoreflect.FileDescriptor + +var file_geometry_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x67, 0x65, 0x6f, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x22, 0x2b, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x02, 0x64, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x02, 0x64, 0x79, 0x22, 0x23, 0x0a, 0x05, 0x56, 0x65, 0x63, 0x32, 0x44, 0x12, 0x0c, + 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x79, 0x22, 0x59, 0x0a, 0x09, 0x50, 0x6f, + 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x12, 0x25, 0x0a, 0x06, 0x61, 0x6e, 0x63, 0x68, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x56, 0x65, 0x63, 0x32, 0x44, 0x52, 0x06, 0x61, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x12, 0x25, + 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x56, 0x65, 0x63, 0x32, 0x44, 0x52, 0x06, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x2e, 0x0a, 0x09, 0x56, 0x65, 0x63, 0x32, 0x44, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x04, 0x65, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x56, 0x65, 0x63, 0x32, 0x44, 0x52, + 0x04, 0x65, 0x6c, 0x65, 0x73, 0x22, 0x36, 0x0a, 0x0d, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, + 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x65, 0x6c, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6f, + 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x52, 0x04, 0x65, 0x6c, 0x65, 0x73, 0x42, 0x12, 0x5a, + 0x10, 0x64, 0x6e, 0x6d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_geometry_proto_rawDescOnce sync.Once + file_geometry_proto_rawDescData = file_geometry_proto_rawDesc +) + +func file_geometry_proto_rawDescGZIP() []byte { + file_geometry_proto_rawDescOnce.Do(func() { + file_geometry_proto_rawDescData = protoimpl.X.CompressGZIP(file_geometry_proto_rawDescData) + }) + return file_geometry_proto_rawDescData +} + +var file_geometry_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_geometry_proto_goTypes = []interface{}{ + (*Direction)(nil), // 0: protos.Direction + (*Vec2D)(nil), // 1: protos.Vec2D + (*Polygon2D)(nil), // 2: protos.Polygon2D + (*Vec2DList)(nil), // 3: protos.Vec2DList + (*Polygon2DList)(nil), // 4: protos.Polygon2DList +} +var file_geometry_proto_depIdxs = []int32{ + 1, // 0: protos.Polygon2D.anchor:type_name -> protos.Vec2D + 1, // 1: protos.Polygon2D.points:type_name -> protos.Vec2D + 1, // 2: protos.Vec2DList.eles:type_name -> protos.Vec2D + 2, // 3: protos.Polygon2DList.eles:type_name -> protos.Polygon2D + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_geometry_proto_init() } +func file_geometry_proto_init() { + if File_geometry_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_geometry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Direction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_geometry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Vec2D); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_geometry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Polygon2D); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_geometry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Vec2DList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_geometry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Polygon2DList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_geometry_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_geometry_proto_goTypes, + DependencyIndexes: file_geometry_proto_depIdxs, + MessageInfos: file_geometry_proto_msgTypes, + }.Build() + File_geometry_proto = out.File + file_geometry_proto_rawDesc = nil + file_geometry_proto_goTypes = nil + file_geometry_proto_depIdxs = nil +} diff --git a/dnmshared/resolv_helper.go b/dnmshared/resolv_helper.go index f4b5d28..fb0ae53 100644 --- a/dnmshared/resolv_helper.go +++ b/dnmshared/resolv_helper.go @@ -6,6 +6,7 @@ import ( "github.com/solarlune/resolv" "math" "strings" + . "dnmshared/protos" ) func ConvexPolygonStr(body *resolv.ConvexPolygon) string { diff --git a/dnmshared/tmx_parser.go b/dnmshared/tmx_parser.go index dccb287..a495253 100644 --- a/dnmshared/tmx_parser.go +++ b/dnmshared/tmx_parser.go @@ -11,6 +11,7 @@ import ( "math" "strconv" "strings" + . "dnmshared/protos" ) const ( @@ -173,8 +174,6 @@ func (l *TmxLayer) decodeBase64() ([]uint32, error) { return gids, nil } -type Vec2DList []*Vec2D -type Polygon2DList []*Polygon2D type StrToVec2DListMap map[string]*Vec2DList type StrToPolygon2DListMap map[string]*Polygon2DList @@ -235,8 +234,6 @@ func tsxPolylineToOffsetsWrtTileCenter(pTmxMapIns *TmxMap, singleObjInTsxFile *T thePolygon2DFromPolyline := &Polygon2D{ Anchor: nil, Points: make([]*Vec2D, pointsCount), - TileWidth: pTsxIns.TileWidth, - TileHeight: pTsxIns.TileHeight, } /* @@ -327,7 +324,7 @@ func DeserializeTsxToColliderDict(pTmxMapIns *TmxMap, byteArrOfTsxFile []byte, f if _, ok := theStrToPolygon2DListMap[key]; ok { pThePolygon2DList = theStrToPolygon2DListMap[key] } else { - thePolygon2DList := make(Polygon2DList, 0) + thePolygon2DListEles := make([]*Polygon2D, 0) theStrToPolygon2DListMap[key] = &thePolygon2DList pThePolygon2DList = theStrToPolygon2DListMap[key] } @@ -442,40 +439,3 @@ func (pTmxMapIns *TmxMap) continuousObjLayerOffsetToContinuousMapNodePos(continu return toRet } - -func AlignPolygon2DToBoundingBox(input *Polygon2D) *Polygon2D { - // Transform again to put "anchor" at the top-left point of the bounding box for "resolv" - float64Max := float64(99999999999999.9) - boundingBoxTL := &Vec2D{ - X: float64Max, - Y: float64Max, - } - for _, p := range input.Points { - if p.X < boundingBoxTL.X { - boundingBoxTL.X = p.X - } - if p.Y < boundingBoxTL.Y { - boundingBoxTL.Y = p.Y - } - } - - // Now "input.Anchor" should move to "input.Anchor+boundingBoxTL", thus "boundingBoxTL" is also the value of the negative diff for all "input.Points" - output := &Polygon2D{ - Anchor: &Vec2D{ - X: input.Anchor.X + boundingBoxTL.X, - Y: input.Anchor.Y + boundingBoxTL.Y, - }, - Points: make([]*Vec2D, len(input.Points)), - TileWidth: input.TileWidth, - TileHeight: input.TileHeight, - } - - for i, p := range input.Points { - output.Points[i] = &Vec2D{ - X: p.X - boundingBoxTL.X, - Y: p.Y - boundingBoxTL.Y, - } - } - - return output -} diff --git a/frontend/assets/resources/pbfiles/geometry.proto b/frontend/assets/resources/pbfiles/geometry.proto new file mode 100644 index 0000000..46e64ce --- /dev/null +++ b/frontend/assets/resources/pbfiles/geometry.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +option go_package = "dnmshared/protos"; // here "./" corresponds to the "--go_out" value in "protoc" command + +package protos; + +message Direction { + int32 dx = 1; + int32 dy = 2; +} + +message Vec2D { + double x = 1; + double y = 2; +} + +message Polygon2D { + Vec2D anchor = 1; + repeated Vec2D points = 2; +} + +message Vec2DList { + repeated Vec2D eles = 1; +} + +message Polygon2DList { + repeated Polygon2D eles = 1; +} diff --git a/frontend/assets/resources/pbfiles/room_downsync_frame.proto b/frontend/assets/resources/pbfiles/room_downsync_frame.proto index 5c12b44..1222dd1 100644 --- a/frontend/assets/resources/pbfiles/room_downsync_frame.proto +++ b/frontend/assets/resources/pbfiles/room_downsync_frame.proto @@ -1,30 +1,8 @@ syntax = "proto3"; -option go_package = "."; // "./" corresponds to the "--go_out" value in "protoc" command +option go_package = "battle_srv/protos"; // here "./" corresponds to the "--go_out" value in "protoc" command -package treasurehunterx; - -message Direction { - int32 dx = 1; - int32 dy = 2; -} - -message Vec2D { - double x = 1; - double y = 2; -} - -message Polygon2D { - Vec2D Anchor = 1; - repeated Vec2D Points = 2; -} - -message Vec2DList { - repeated Vec2D vec2DList = 1; -} - -message Polygon2DList { - repeated Polygon2D polygon2DList = 1; -} +package protos; +import "geometry.proto"; // The import path here is only w.r.t. the proto file, not the Go package. message BattleColliderInfo { string stageName = 1; @@ -46,17 +24,19 @@ message BattleColliderInfo { int32 inputFrameUpsyncDelayTolerance = 16; int32 maxChasingRenderFramesPerUpdate = 17; int32 playerBattleState = 18; - double rollbackEstimatedDt = 19; - double rollbackEstimatedDtMillis = 20; - int64 rollbackEstimatedDtNanos = 21; + double rollbackEstimatedDtMillis = 19; + int64 rollbackEstimatedDtNanos = 20; + + double worldToVirtualGridRatio = 21; + double virtualGridToWorldRatio = 22; } message Player { int32 id = 1; - double x = 2; - double y = 3; + int32 virtualGridX = 2; + int32 virtualGridY = 3; Direction dir = 4; - double speed = 5; + int32 speed = 5; // in terms of virtual grid units int32 battleState = 6; int32 lastMoveGmtMillis = 7; int32 score = 10; 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 b8f70f8..f6b171b 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 @@ -1,7 +1,7 @@ /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ "use strict"; -var $protobuf = require("./protobuf-with-floating-num-decoding-endianess-toggle"); +var $protobuf = require("protobufjs/minimal"); // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; @@ -9,1179 +9,24 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); -$root.treasurehunterx = (function() { +$root.protos = (function() { /** - * Namespace treasurehunterx. - * @exports treasurehunterx + * Namespace protos. + * @exports protos * @namespace */ - var treasurehunterx = {}; + var protos = {}; - treasurehunterx.Direction = (function() { - - /** - * Properties of a Direction. - * @memberof treasurehunterx - * @interface IDirection - * @property {number|null} [dx] Direction dx - * @property {number|null} [dy] Direction dy - */ - - /** - * Constructs a new Direction. - * @memberof treasurehunterx - * @classdesc Represents a Direction. - * @implements IDirection - * @constructor - * @param {treasurehunterx.IDirection=} [properties] Properties to set - */ - function Direction(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]]; - } - - /** - * Direction dx. - * @member {number} dx - * @memberof treasurehunterx.Direction - * @instance - */ - Direction.prototype.dx = 0; - - /** - * Direction dy. - * @member {number} dy - * @memberof treasurehunterx.Direction - * @instance - */ - Direction.prototype.dy = 0; - - /** - * Creates a new Direction instance using the specified properties. - * @function create - * @memberof treasurehunterx.Direction - * @static - * @param {treasurehunterx.IDirection=} [properties] Properties to set - * @returns {treasurehunterx.Direction} Direction instance - */ - Direction.create = function create(properties) { - return new Direction(properties); - }; - - /** - * Encodes the specified Direction message. Does not implicitly {@link treasurehunterx.Direction.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Direction - * @static - * @param {treasurehunterx.Direction} message Direction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Direction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dx != null && Object.hasOwnProperty.call(message, "dx")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dx); - if (message.dy != null && Object.hasOwnProperty.call(message, "dy")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dy); - return writer; - }; - - /** - * Encodes the specified Direction message, length delimited. Does not implicitly {@link treasurehunterx.Direction.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Direction - * @static - * @param {treasurehunterx.Direction} message Direction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Direction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Direction message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Direction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Direction} Direction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Direction.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.Direction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.dx = reader.int32(); - break; - } - case 2: { - message.dy = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Direction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Direction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Direction} Direction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Direction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Direction message. - * @function verify - * @memberof treasurehunterx.Direction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Direction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dx != null && message.hasOwnProperty("dx")) - if (!$util.isInteger(message.dx)) - return "dx: integer expected"; - if (message.dy != null && message.hasOwnProperty("dy")) - if (!$util.isInteger(message.dy)) - return "dy: integer expected"; - return null; - }; - - /** - * Creates a Direction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Direction - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Direction} Direction - */ - Direction.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Direction) - return object; - var message = new $root.treasurehunterx.Direction(); - if (object.dx != null) - message.dx = object.dx | 0; - if (object.dy != null) - message.dy = object.dy | 0; - return message; - }; - - /** - * Creates a plain object from a Direction message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Direction - * @static - * @param {treasurehunterx.Direction} message Direction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Direction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dx = 0; - object.dy = 0; - } - if (message.dx != null && message.hasOwnProperty("dx")) - object.dx = message.dx; - if (message.dy != null && message.hasOwnProperty("dy")) - object.dy = message.dy; - return object; - }; - - /** - * Converts this Direction to JSON. - * @function toJSON - * @memberof treasurehunterx.Direction - * @instance - * @returns {Object.} JSON object - */ - Direction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Direction - * @function getTypeUrl - * @memberof treasurehunterx.Direction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Direction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Direction"; - }; - - return Direction; - })(); - - treasurehunterx.Vec2D = (function() { - - /** - * Properties of a Vec2D. - * @memberof treasurehunterx - * @interface IVec2D - * @property {number|null} [x] Vec2D x - * @property {number|null} [y] Vec2D y - */ - - /** - * Constructs a new Vec2D. - * @memberof treasurehunterx - * @classdesc Represents a Vec2D. - * @implements IVec2D - * @constructor - * @param {treasurehunterx.IVec2D=} [properties] Properties to set - */ - function Vec2D(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]]; - } - - /** - * Vec2D x. - * @member {number} x - * @memberof treasurehunterx.Vec2D - * @instance - */ - Vec2D.prototype.x = 0; - - /** - * Vec2D y. - * @member {number} y - * @memberof treasurehunterx.Vec2D - * @instance - */ - Vec2D.prototype.y = 0; - - /** - * Creates a new Vec2D instance using the specified properties. - * @function create - * @memberof treasurehunterx.Vec2D - * @static - * @param {treasurehunterx.IVec2D=} [properties] Properties to set - * @returns {treasurehunterx.Vec2D} Vec2D instance - */ - Vec2D.create = function create(properties) { - return new Vec2D(properties); - }; - - /** - * Encodes the specified Vec2D message. Does not implicitly {@link treasurehunterx.Vec2D.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Vec2D - * @static - * @param {treasurehunterx.Vec2D} message Vec2D message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vec2D.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.y); - return writer; - }; - - /** - * Encodes the specified Vec2D message, length delimited. Does not implicitly {@link treasurehunterx.Vec2D.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Vec2D - * @static - * @param {treasurehunterx.Vec2D} message Vec2D message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vec2D.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vec2D message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Vec2D - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Vec2D} Vec2D - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vec2D.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.Vec2D(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.x = reader.double(); - break; - } - case 2: { - message.y = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vec2D message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Vec2D - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Vec2D} Vec2D - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vec2D.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vec2D message. - * @function verify - * @memberof treasurehunterx.Vec2D - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vec2D.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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"; - return null; - }; - - /** - * Creates a Vec2D message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Vec2D - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Vec2D} Vec2D - */ - Vec2D.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Vec2D) - return object; - var message = new $root.treasurehunterx.Vec2D(); - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - return message; - }; - - /** - * Creates a plain object from a Vec2D message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Vec2D - * @static - * @param {treasurehunterx.Vec2D} message Vec2D - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vec2D.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.x = 0; - object.y = 0; - } - 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; - return object; - }; - - /** - * Converts this Vec2D to JSON. - * @function toJSON - * @memberof treasurehunterx.Vec2D - * @instance - * @returns {Object.} JSON object - */ - Vec2D.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Vec2D - * @function getTypeUrl - * @memberof treasurehunterx.Vec2D - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Vec2D.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Vec2D"; - }; - - return Vec2D; - })(); - - treasurehunterx.Polygon2D = (function() { - - /** - * Properties of a Polygon2D. - * @memberof treasurehunterx - * @interface IPolygon2D - * @property {treasurehunterx.Vec2D|null} [Anchor] Polygon2D Anchor - * @property {Array.|null} [Points] Polygon2D Points - */ - - /** - * Constructs a new Polygon2D. - * @memberof treasurehunterx - * @classdesc Represents a Polygon2D. - * @implements IPolygon2D - * @constructor - * @param {treasurehunterx.IPolygon2D=} [properties] Properties to set - */ - function Polygon2D(properties) { - this.Points = []; - 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]]; - } - - /** - * Polygon2D Anchor. - * @member {treasurehunterx.Vec2D|null|undefined} Anchor - * @memberof treasurehunterx.Polygon2D - * @instance - */ - Polygon2D.prototype.Anchor = null; - - /** - * Polygon2D Points. - * @member {Array.} Points - * @memberof treasurehunterx.Polygon2D - * @instance - */ - Polygon2D.prototype.Points = $util.emptyArray; - - /** - * Creates a new Polygon2D instance using the specified properties. - * @function create - * @memberof treasurehunterx.Polygon2D - * @static - * @param {treasurehunterx.IPolygon2D=} [properties] Properties to set - * @returns {treasurehunterx.Polygon2D} Polygon2D instance - */ - Polygon2D.create = function create(properties) { - return new Polygon2D(properties); - }; - - /** - * Encodes the specified Polygon2D message. Does not implicitly {@link treasurehunterx.Polygon2D.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Polygon2D - * @static - * @param {treasurehunterx.Polygon2D} message Polygon2D message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Polygon2D.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.Anchor != null && Object.hasOwnProperty.call(message, "Anchor")) - $root.treasurehunterx.Vec2D.encode(message.Anchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.Points != null && message.Points.length) - for (var i = 0; i < message.Points.length; ++i) - $root.treasurehunterx.Vec2D.encode(message.Points[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Polygon2D message, length delimited. Does not implicitly {@link treasurehunterx.Polygon2D.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Polygon2D - * @static - * @param {treasurehunterx.Polygon2D} message Polygon2D message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Polygon2D.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Polygon2D message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Polygon2D - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Polygon2D} Polygon2D - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Polygon2D.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.Polygon2D(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.Anchor = $root.treasurehunterx.Vec2D.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.Points && message.Points.length)) - message.Points = []; - message.Points.push($root.treasurehunterx.Vec2D.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Polygon2D message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Polygon2D - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Polygon2D} Polygon2D - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Polygon2D.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Polygon2D message. - * @function verify - * @memberof treasurehunterx.Polygon2D - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Polygon2D.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.Anchor != null && message.hasOwnProperty("Anchor")) { - var error = $root.treasurehunterx.Vec2D.verify(message.Anchor); - if (error) - return "Anchor." + error; - } - if (message.Points != null && message.hasOwnProperty("Points")) { - if (!Array.isArray(message.Points)) - return "Points: array expected"; - for (var i = 0; i < message.Points.length; ++i) { - var error = $root.treasurehunterx.Vec2D.verify(message.Points[i]); - if (error) - return "Points." + error; - } - } - return null; - }; - - /** - * Creates a Polygon2D message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Polygon2D - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Polygon2D} Polygon2D - */ - Polygon2D.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Polygon2D) - return object; - var message = new $root.treasurehunterx.Polygon2D(); - if (object.Anchor != null) { - if (typeof object.Anchor !== "object") - throw TypeError(".treasurehunterx.Polygon2D.Anchor: object expected"); - message.Anchor = $root.treasurehunterx.Vec2D.fromObject(object.Anchor); - } - if (object.Points) { - if (!Array.isArray(object.Points)) - throw TypeError(".treasurehunterx.Polygon2D.Points: array expected"); - message.Points = []; - for (var i = 0; i < object.Points.length; ++i) { - if (typeof object.Points[i] !== "object") - throw TypeError(".treasurehunterx.Polygon2D.Points: object expected"); - message.Points[i] = $root.treasurehunterx.Vec2D.fromObject(object.Points[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Polygon2D message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Polygon2D - * @static - * @param {treasurehunterx.Polygon2D} message Polygon2D - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Polygon2D.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.Points = []; - if (options.defaults) - object.Anchor = null; - if (message.Anchor != null && message.hasOwnProperty("Anchor")) - object.Anchor = $root.treasurehunterx.Vec2D.toObject(message.Anchor, options); - if (message.Points && message.Points.length) { - object.Points = []; - for (var j = 0; j < message.Points.length; ++j) - object.Points[j] = $root.treasurehunterx.Vec2D.toObject(message.Points[j], options); - } - return object; - }; - - /** - * Converts this Polygon2D to JSON. - * @function toJSON - * @memberof treasurehunterx.Polygon2D - * @instance - * @returns {Object.} JSON object - */ - Polygon2D.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Polygon2D - * @function getTypeUrl - * @memberof treasurehunterx.Polygon2D - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Polygon2D.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Polygon2D"; - }; - - return Polygon2D; - })(); - - treasurehunterx.Vec2DList = (function() { - - /** - * Properties of a Vec2DList. - * @memberof treasurehunterx - * @interface IVec2DList - * @property {Array.|null} [vec2DList] Vec2DList vec2DList - */ - - /** - * Constructs a new Vec2DList. - * @memberof treasurehunterx - * @classdesc Represents a Vec2DList. - * @implements IVec2DList - * @constructor - * @param {treasurehunterx.IVec2DList=} [properties] Properties to set - */ - function Vec2DList(properties) { - this.vec2DList = []; - 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]]; - } - - /** - * Vec2DList vec2DList. - * @member {Array.} vec2DList - * @memberof treasurehunterx.Vec2DList - * @instance - */ - Vec2DList.prototype.vec2DList = $util.emptyArray; - - /** - * Creates a new Vec2DList instance using the specified properties. - * @function create - * @memberof treasurehunterx.Vec2DList - * @static - * @param {treasurehunterx.IVec2DList=} [properties] Properties to set - * @returns {treasurehunterx.Vec2DList} Vec2DList instance - */ - Vec2DList.create = function create(properties) { - return new Vec2DList(properties); - }; - - /** - * Encodes the specified Vec2DList message. Does not implicitly {@link treasurehunterx.Vec2DList.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Vec2DList - * @static - * @param {treasurehunterx.Vec2DList} message Vec2DList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vec2DList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.vec2DList != null && message.vec2DList.length) - for (var i = 0; i < message.vec2DList.length; ++i) - $root.treasurehunterx.Vec2D.encode(message.vec2DList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Vec2DList message, length delimited. Does not implicitly {@link treasurehunterx.Vec2DList.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Vec2DList - * @static - * @param {treasurehunterx.Vec2DList} message Vec2DList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vec2DList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vec2DList message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Vec2DList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Vec2DList} Vec2DList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vec2DList.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.Vec2DList(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.vec2DList && message.vec2DList.length)) - message.vec2DList = []; - message.vec2DList.push($root.treasurehunterx.Vec2D.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vec2DList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Vec2DList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Vec2DList} Vec2DList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vec2DList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vec2DList message. - * @function verify - * @memberof treasurehunterx.Vec2DList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vec2DList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.vec2DList != null && message.hasOwnProperty("vec2DList")) { - if (!Array.isArray(message.vec2DList)) - return "vec2DList: array expected"; - for (var i = 0; i < message.vec2DList.length; ++i) { - var error = $root.treasurehunterx.Vec2D.verify(message.vec2DList[i]); - if (error) - return "vec2DList." + error; - } - } - return null; - }; - - /** - * Creates a Vec2DList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Vec2DList - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Vec2DList} Vec2DList - */ - Vec2DList.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Vec2DList) - return object; - var message = new $root.treasurehunterx.Vec2DList(); - if (object.vec2DList) { - if (!Array.isArray(object.vec2DList)) - throw TypeError(".treasurehunterx.Vec2DList.vec2DList: array expected"); - message.vec2DList = []; - for (var i = 0; i < object.vec2DList.length; ++i) { - if (typeof object.vec2DList[i] !== "object") - throw TypeError(".treasurehunterx.Vec2DList.vec2DList: object expected"); - message.vec2DList[i] = $root.treasurehunterx.Vec2D.fromObject(object.vec2DList[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Vec2DList message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Vec2DList - * @static - * @param {treasurehunterx.Vec2DList} message Vec2DList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vec2DList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.vec2DList = []; - if (message.vec2DList && message.vec2DList.length) { - object.vec2DList = []; - for (var j = 0; j < message.vec2DList.length; ++j) - object.vec2DList[j] = $root.treasurehunterx.Vec2D.toObject(message.vec2DList[j], options); - } - return object; - }; - - /** - * Converts this Vec2DList to JSON. - * @function toJSON - * @memberof treasurehunterx.Vec2DList - * @instance - * @returns {Object.} JSON object - */ - Vec2DList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Vec2DList - * @function getTypeUrl - * @memberof treasurehunterx.Vec2DList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Vec2DList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Vec2DList"; - }; - - return Vec2DList; - })(); - - treasurehunterx.Polygon2DList = (function() { - - /** - * Properties of a Polygon2DList. - * @memberof treasurehunterx - * @interface IPolygon2DList - * @property {Array.|null} [polygon2DList] Polygon2DList polygon2DList - */ - - /** - * Constructs a new Polygon2DList. - * @memberof treasurehunterx - * @classdesc Represents a Polygon2DList. - * @implements IPolygon2DList - * @constructor - * @param {treasurehunterx.IPolygon2DList=} [properties] Properties to set - */ - function Polygon2DList(properties) { - this.polygon2DList = []; - 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]]; - } - - /** - * Polygon2DList polygon2DList. - * @member {Array.} polygon2DList - * @memberof treasurehunterx.Polygon2DList - * @instance - */ - Polygon2DList.prototype.polygon2DList = $util.emptyArray; - - /** - * Creates a new Polygon2DList instance using the specified properties. - * @function create - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {treasurehunterx.IPolygon2DList=} [properties] Properties to set - * @returns {treasurehunterx.Polygon2DList} Polygon2DList instance - */ - Polygon2DList.create = function create(properties) { - return new Polygon2DList(properties); - }; - - /** - * Encodes the specified Polygon2DList message. Does not implicitly {@link treasurehunterx.Polygon2DList.verify|verify} messages. - * @function encode - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {treasurehunterx.Polygon2DList} message Polygon2DList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Polygon2DList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.polygon2DList != null && message.polygon2DList.length) - for (var i = 0; i < message.polygon2DList.length; ++i) - $root.treasurehunterx.Polygon2D.encode(message.polygon2DList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Polygon2DList message, length delimited. Does not implicitly {@link treasurehunterx.Polygon2DList.verify|verify} messages. - * @function encodeDelimited - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {treasurehunterx.Polygon2DList} message Polygon2DList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Polygon2DList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Polygon2DList message from the specified reader or buffer. - * @function decode - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Polygon2DList} Polygon2DList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Polygon2DList.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.Polygon2DList(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.polygon2DList && message.polygon2DList.length)) - message.polygon2DList = []; - message.polygon2DList.push($root.treasurehunterx.Polygon2D.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Polygon2DList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Polygon2DList} Polygon2DList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Polygon2DList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Polygon2DList message. - * @function verify - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Polygon2DList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.polygon2DList != null && message.hasOwnProperty("polygon2DList")) { - if (!Array.isArray(message.polygon2DList)) - return "polygon2DList: array expected"; - for (var i = 0; i < message.polygon2DList.length; ++i) { - var error = $root.treasurehunterx.Polygon2D.verify(message.polygon2DList[i]); - if (error) - return "polygon2DList." + error; - } - } - return null; - }; - - /** - * Creates a Polygon2DList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {Object.} object Plain object - * @returns {treasurehunterx.Polygon2DList} Polygon2DList - */ - Polygon2DList.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Polygon2DList) - return object; - var message = new $root.treasurehunterx.Polygon2DList(); - if (object.polygon2DList) { - if (!Array.isArray(object.polygon2DList)) - throw TypeError(".treasurehunterx.Polygon2DList.polygon2DList: array expected"); - message.polygon2DList = []; - for (var i = 0; i < object.polygon2DList.length; ++i) { - if (typeof object.polygon2DList[i] !== "object") - throw TypeError(".treasurehunterx.Polygon2DList.polygon2DList: object expected"); - message.polygon2DList[i] = $root.treasurehunterx.Polygon2D.fromObject(object.polygon2DList[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Polygon2DList message. Also converts values to other types if specified. - * @function toObject - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {treasurehunterx.Polygon2DList} message Polygon2DList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Polygon2DList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.polygon2DList = []; - if (message.polygon2DList && message.polygon2DList.length) { - object.polygon2DList = []; - for (var j = 0; j < message.polygon2DList.length; ++j) - object.polygon2DList[j] = $root.treasurehunterx.Polygon2D.toObject(message.polygon2DList[j], options); - } - return object; - }; - - /** - * Converts this Polygon2DList to JSON. - * @function toJSON - * @memberof treasurehunterx.Polygon2DList - * @instance - * @returns {Object.} JSON object - */ - Polygon2DList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Polygon2DList - * @function getTypeUrl - * @memberof treasurehunterx.Polygon2DList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Polygon2DList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Polygon2DList"; - }; - - return Polygon2DList; - })(); - - treasurehunterx.BattleColliderInfo = (function() { + protos.BattleColliderInfo = (function() { /** * Properties of a BattleColliderInfo. - * @memberof treasurehunterx + * @memberof protos * @interface IBattleColliderInfo * @property {string|null} [stageName] BattleColliderInfo stageName - * @property {Object.|null} [strToVec2DListMap] BattleColliderInfo strToVec2DListMap - * @property {Object.|null} [strToPolygon2DListMap] BattleColliderInfo strToPolygon2DListMap + * @property {Object.|null} [strToVec2DListMap] BattleColliderInfo strToVec2DListMap + * @property {Object.|null} [strToPolygon2DListMap] BattleColliderInfo strToPolygon2DListMap * @property {number|null} [stageDiscreteW] BattleColliderInfo stageDiscreteW * @property {number|null} [stageDiscreteH] BattleColliderInfo stageDiscreteH * @property {number|null} [stageTileW] BattleColliderInfo stageTileW @@ -1197,18 +42,19 @@ $root.treasurehunterx = (function() { * @property {number|null} [inputFrameUpsyncDelayTolerance] BattleColliderInfo inputFrameUpsyncDelayTolerance * @property {number|null} [maxChasingRenderFramesPerUpdate] BattleColliderInfo maxChasingRenderFramesPerUpdate * @property {number|null} [playerBattleState] BattleColliderInfo playerBattleState - * @property {number|null} [rollbackEstimatedDt] BattleColliderInfo rollbackEstimatedDt * @property {number|null} [rollbackEstimatedDtMillis] BattleColliderInfo rollbackEstimatedDtMillis * @property {number|Long|null} [rollbackEstimatedDtNanos] BattleColliderInfo rollbackEstimatedDtNanos + * @property {number|null} [worldToVirtualGridRatio] BattleColliderInfo worldToVirtualGridRatio + * @property {number|null} [virtualGridToWorldRatio] BattleColliderInfo virtualGridToWorldRatio */ /** * Constructs a new BattleColliderInfo. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents a BattleColliderInfo. * @implements IBattleColliderInfo * @constructor - * @param {treasurehunterx.IBattleColliderInfo=} [properties] Properties to set + * @param {protos.IBattleColliderInfo=} [properties] Properties to set */ function BattleColliderInfo(properties) { this.strToVec2DListMap = {}; @@ -1222,23 +68,23 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo stageName. * @member {string} stageName - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.stageName = ""; /** * BattleColliderInfo strToVec2DListMap. - * @member {Object.} strToVec2DListMap - * @memberof treasurehunterx.BattleColliderInfo + * @member {Object.} strToVec2DListMap + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.strToVec2DListMap = $util.emptyObject; /** * BattleColliderInfo strToPolygon2DListMap. - * @member {Object.} strToPolygon2DListMap - * @memberof treasurehunterx.BattleColliderInfo + * @member {Object.} strToPolygon2DListMap + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.strToPolygon2DListMap = $util.emptyObject; @@ -1246,7 +92,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo stageDiscreteW. * @member {number} stageDiscreteW - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.stageDiscreteW = 0; @@ -1254,7 +100,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo stageDiscreteH. * @member {number} stageDiscreteH - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.stageDiscreteH = 0; @@ -1262,7 +108,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo stageTileW. * @member {number} stageTileW - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.stageTileW = 0; @@ -1270,7 +116,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo stageTileH. * @member {number} stageTileH - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.stageTileH = 0; @@ -1278,7 +124,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo intervalToPing. * @member {number} intervalToPing - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.intervalToPing = 0; @@ -1286,7 +132,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo willKickIfInactiveFor. * @member {number} willKickIfInactiveFor - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.willKickIfInactiveFor = 0; @@ -1294,7 +140,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo boundRoomId. * @member {number} boundRoomId - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.boundRoomId = 0; @@ -1302,7 +148,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo battleDurationNanos. * @member {number|Long} battleDurationNanos - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.battleDurationNanos = $util.Long ? $util.Long.fromBits(0,0,false) : 0; @@ -1310,7 +156,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo serverFps. * @member {number} serverFps - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.serverFps = 0; @@ -1318,7 +164,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo inputDelayFrames. * @member {number} inputDelayFrames - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.inputDelayFrames = 0; @@ -1326,7 +172,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo inputScaleFrames. * @member {number} inputScaleFrames - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.inputScaleFrames = 0; @@ -1334,7 +180,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo nstDelayFrames. * @member {number} nstDelayFrames - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.nstDelayFrames = 0; @@ -1342,7 +188,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo inputFrameUpsyncDelayTolerance. * @member {number} inputFrameUpsyncDelayTolerance - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.inputFrameUpsyncDelayTolerance = 0; @@ -1350,7 +196,7 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo maxChasingRenderFramesPerUpdate. * @member {number} maxChasingRenderFramesPerUpdate - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.maxChasingRenderFramesPerUpdate = 0; @@ -1358,23 +204,15 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo playerBattleState. * @member {number} playerBattleState - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.playerBattleState = 0; - /** - * BattleColliderInfo rollbackEstimatedDt. - * @member {number} rollbackEstimatedDt - * @memberof treasurehunterx.BattleColliderInfo - * @instance - */ - BattleColliderInfo.prototype.rollbackEstimatedDt = 0; - /** * BattleColliderInfo rollbackEstimatedDtMillis. * @member {number} rollbackEstimatedDtMillis - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.rollbackEstimatedDtMillis = 0; @@ -1382,92 +220,110 @@ $root.treasurehunterx = (function() { /** * BattleColliderInfo rollbackEstimatedDtNanos. * @member {number|Long} rollbackEstimatedDtNanos - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance */ BattleColliderInfo.prototype.rollbackEstimatedDtNanos = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * BattleColliderInfo worldToVirtualGridRatio. + * @member {number} worldToVirtualGridRatio + * @memberof protos.BattleColliderInfo + * @instance + */ + BattleColliderInfo.prototype.worldToVirtualGridRatio = 0; + + /** + * BattleColliderInfo virtualGridToWorldRatio. + * @member {number} virtualGridToWorldRatio + * @memberof protos.BattleColliderInfo + * @instance + */ + BattleColliderInfo.prototype.virtualGridToWorldRatio = 0; + /** * Creates a new BattleColliderInfo instance using the specified properties. * @function create - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @static - * @param {treasurehunterx.IBattleColliderInfo=} [properties] Properties to set - * @returns {treasurehunterx.BattleColliderInfo} BattleColliderInfo instance + * @param {protos.IBattleColliderInfo=} [properties] Properties to set + * @returns {protos.BattleColliderInfo} BattleColliderInfo instance */ BattleColliderInfo.create = function create(properties) { return new BattleColliderInfo(properties); }; /** - * Encodes the specified BattleColliderInfo message. Does not implicitly {@link treasurehunterx.BattleColliderInfo.verify|verify} messages. + * Encodes the specified BattleColliderInfo message. Does not implicitly {@link protos.BattleColliderInfo.verify|verify} messages. * @function encode - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @static - * @param {treasurehunterx.BattleColliderInfo} message BattleColliderInfo message or plain object to encode + * @param {protos.BattleColliderInfo} message BattleColliderInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BattleColliderInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stageName != null && Object.hasOwnProperty.call(message, "stageName")) + if (message.stageName != null && message.hasOwnProperty("stageName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.stageName); - if (message.strToVec2DListMap != null && Object.hasOwnProperty.call(message, "strToVec2DListMap")) + if (message.strToVec2DListMap != null && message.hasOwnProperty("strToVec2DListMap")) for (var keys = Object.keys(message.strToVec2DListMap), i = 0; i < keys.length; ++i) { writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.treasurehunterx.Vec2DList.encode(message.strToVec2DListMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.protos.Vec2DList.encode(message.strToVec2DListMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.strToPolygon2DListMap != null && Object.hasOwnProperty.call(message, "strToPolygon2DListMap")) + if (message.strToPolygon2DListMap != null && message.hasOwnProperty("strToPolygon2DListMap")) for (var keys = Object.keys(message.strToPolygon2DListMap), i = 0; i < keys.length; ++i) { writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.treasurehunterx.Polygon2DList.encode(message.strToPolygon2DListMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.protos.Polygon2DList.encode(message.strToPolygon2DListMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.stageDiscreteW != null && Object.hasOwnProperty.call(message, "stageDiscreteW")) + if (message.stageDiscreteW != null && message.hasOwnProperty("stageDiscreteW")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.stageDiscreteW); - if (message.stageDiscreteH != null && Object.hasOwnProperty.call(message, "stageDiscreteH")) + if (message.stageDiscreteH != null && message.hasOwnProperty("stageDiscreteH")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.stageDiscreteH); - if (message.stageTileW != null && Object.hasOwnProperty.call(message, "stageTileW")) + if (message.stageTileW != null && message.hasOwnProperty("stageTileW")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.stageTileW); - if (message.stageTileH != null && Object.hasOwnProperty.call(message, "stageTileH")) + if (message.stageTileH != null && message.hasOwnProperty("stageTileH")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.stageTileH); - if (message.intervalToPing != null && Object.hasOwnProperty.call(message, "intervalToPing")) + if (message.intervalToPing != null && message.hasOwnProperty("intervalToPing")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.intervalToPing); - if (message.willKickIfInactiveFor != null && Object.hasOwnProperty.call(message, "willKickIfInactiveFor")) + if (message.willKickIfInactiveFor != null && message.hasOwnProperty("willKickIfInactiveFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.willKickIfInactiveFor); - if (message.boundRoomId != null && Object.hasOwnProperty.call(message, "boundRoomId")) + if (message.boundRoomId != null && message.hasOwnProperty("boundRoomId")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.boundRoomId); - if (message.battleDurationNanos != null && Object.hasOwnProperty.call(message, "battleDurationNanos")) + if (message.battleDurationNanos != null && message.hasOwnProperty("battleDurationNanos")) writer.uint32(/* id 11, wireType 0 =*/88).int64(message.battleDurationNanos); - if (message.serverFps != null && Object.hasOwnProperty.call(message, "serverFps")) + if (message.serverFps != null && message.hasOwnProperty("serverFps")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.serverFps); - if (message.inputDelayFrames != null && Object.hasOwnProperty.call(message, "inputDelayFrames")) + if (message.inputDelayFrames != null && message.hasOwnProperty("inputDelayFrames")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.inputDelayFrames); - if (message.inputScaleFrames != null && Object.hasOwnProperty.call(message, "inputScaleFrames")) + if (message.inputScaleFrames != null && message.hasOwnProperty("inputScaleFrames")) writer.uint32(/* id 14, wireType 0 =*/112).uint32(message.inputScaleFrames); - if (message.nstDelayFrames != null && Object.hasOwnProperty.call(message, "nstDelayFrames")) + if (message.nstDelayFrames != null && message.hasOwnProperty("nstDelayFrames")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.nstDelayFrames); - if (message.inputFrameUpsyncDelayTolerance != null && Object.hasOwnProperty.call(message, "inputFrameUpsyncDelayTolerance")) + if (message.inputFrameUpsyncDelayTolerance != null && message.hasOwnProperty("inputFrameUpsyncDelayTolerance")) writer.uint32(/* id 16, wireType 0 =*/128).int32(message.inputFrameUpsyncDelayTolerance); - if (message.maxChasingRenderFramesPerUpdate != null && Object.hasOwnProperty.call(message, "maxChasingRenderFramesPerUpdate")) + if (message.maxChasingRenderFramesPerUpdate != null && message.hasOwnProperty("maxChasingRenderFramesPerUpdate")) writer.uint32(/* id 17, wireType 0 =*/136).int32(message.maxChasingRenderFramesPerUpdate); - if (message.playerBattleState != null && Object.hasOwnProperty.call(message, "playerBattleState")) + if (message.playerBattleState != null && message.hasOwnProperty("playerBattleState")) writer.uint32(/* id 18, wireType 0 =*/144).int32(message.playerBattleState); - if (message.rollbackEstimatedDt != null && Object.hasOwnProperty.call(message, "rollbackEstimatedDt")) - writer.uint32(/* id 19, wireType 1 =*/153).double(message.rollbackEstimatedDt); - if (message.rollbackEstimatedDtMillis != null && Object.hasOwnProperty.call(message, "rollbackEstimatedDtMillis")) - writer.uint32(/* id 20, wireType 1 =*/161).double(message.rollbackEstimatedDtMillis); - if (message.rollbackEstimatedDtNanos != null && Object.hasOwnProperty.call(message, "rollbackEstimatedDtNanos")) - writer.uint32(/* id 21, wireType 0 =*/168).int64(message.rollbackEstimatedDtNanos); + if (message.rollbackEstimatedDtMillis != null && message.hasOwnProperty("rollbackEstimatedDtMillis")) + writer.uint32(/* id 19, wireType 1 =*/153).double(message.rollbackEstimatedDtMillis); + if (message.rollbackEstimatedDtNanos != null && message.hasOwnProperty("rollbackEstimatedDtNanos")) + writer.uint32(/* id 20, wireType 0 =*/160).int64(message.rollbackEstimatedDtNanos); + if (message.worldToVirtualGridRatio != null && message.hasOwnProperty("worldToVirtualGridRatio")) + writer.uint32(/* id 21, wireType 1 =*/169).double(message.worldToVirtualGridRatio); + if (message.virtualGridToWorldRatio != null && message.hasOwnProperty("virtualGridToWorldRatio")) + writer.uint32(/* id 22, wireType 1 =*/177).double(message.virtualGridToWorldRatio); return writer; }; /** - * Encodes the specified BattleColliderInfo message, length delimited. Does not implicitly {@link treasurehunterx.BattleColliderInfo.verify|verify} messages. + * Encodes the specified BattleColliderInfo message, length delimited. Does not implicitly {@link protos.BattleColliderInfo.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @static - * @param {treasurehunterx.BattleColliderInfo} message BattleColliderInfo message or plain object to encode + * @param {protos.BattleColliderInfo} message BattleColliderInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -1478,143 +334,97 @@ $root.treasurehunterx = (function() { /** * Decodes a BattleColliderInfo message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.BattleColliderInfo} BattleColliderInfo + * @returns {protos.BattleColliderInfo} BattleColliderInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BattleColliderInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.treasurehunterx.BattleColliderInfo(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.BattleColliderInfo(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.stageName = reader.string(); - break; - } - case 2: { - if (message.strToVec2DListMap === $util.emptyObject) - message.strToVec2DListMap = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.treasurehunterx.Vec2DList.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.strToVec2DListMap[key] = value; - break; - } - case 3: { - if (message.strToPolygon2DListMap === $util.emptyObject) - message.strToPolygon2DListMap = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.treasurehunterx.Polygon2DList.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.strToPolygon2DListMap[key] = value; - break; - } - case 4: { - message.stageDiscreteW = reader.int32(); - break; - } - case 5: { - message.stageDiscreteH = reader.int32(); - break; - } - case 6: { - message.stageTileW = reader.int32(); - break; - } - case 7: { - message.stageTileH = reader.int32(); - break; - } - case 8: { - message.intervalToPing = reader.int32(); - break; - } - case 9: { - message.willKickIfInactiveFor = reader.int32(); - break; - } - case 10: { - message.boundRoomId = reader.int32(); - break; - } - case 11: { - message.battleDurationNanos = reader.int64(); - break; - } - case 12: { - message.serverFps = reader.int32(); - break; - } - case 13: { - message.inputDelayFrames = reader.int32(); - break; - } - case 14: { - message.inputScaleFrames = reader.uint32(); - break; - } - case 15: { - message.nstDelayFrames = reader.int32(); - break; - } - case 16: { - message.inputFrameUpsyncDelayTolerance = reader.int32(); - break; - } - case 17: { - message.maxChasingRenderFramesPerUpdate = reader.int32(); - break; - } - case 18: { - message.playerBattleState = reader.int32(); - break; - } - case 19: { - message.rollbackEstimatedDt = reader.double(); - break; - } - case 20: { - message.rollbackEstimatedDtMillis = reader.double(); - break; - } - case 21: { - message.rollbackEstimatedDtNanos = reader.int64(); - break; - } + case 1: + message.stageName = reader.string(); + break; + case 2: + reader.skip().pos++; + if (message.strToVec2DListMap === $util.emptyObject) + message.strToVec2DListMap = {}; + key = reader.string(); + reader.pos++; + message.strToVec2DListMap[key] = $root.protos.Vec2DList.decode(reader, reader.uint32()); + break; + case 3: + reader.skip().pos++; + if (message.strToPolygon2DListMap === $util.emptyObject) + message.strToPolygon2DListMap = {}; + key = reader.string(); + reader.pos++; + message.strToPolygon2DListMap[key] = $root.protos.Polygon2DList.decode(reader, reader.uint32()); + break; + case 4: + message.stageDiscreteW = reader.int32(); + break; + case 5: + message.stageDiscreteH = reader.int32(); + break; + case 6: + message.stageTileW = reader.int32(); + break; + case 7: + message.stageTileH = reader.int32(); + break; + case 8: + message.intervalToPing = reader.int32(); + break; + case 9: + message.willKickIfInactiveFor = reader.int32(); + break; + case 10: + message.boundRoomId = reader.int32(); + break; + case 11: + message.battleDurationNanos = reader.int64(); + break; + case 12: + message.serverFps = reader.int32(); + break; + case 13: + message.inputDelayFrames = reader.int32(); + break; + case 14: + message.inputScaleFrames = reader.uint32(); + break; + case 15: + message.nstDelayFrames = reader.int32(); + break; + case 16: + message.inputFrameUpsyncDelayTolerance = reader.int32(); + break; + case 17: + message.maxChasingRenderFramesPerUpdate = reader.int32(); + break; + case 18: + message.playerBattleState = reader.int32(); + break; + case 19: + message.rollbackEstimatedDtMillis = reader.double(); + break; + case 20: + message.rollbackEstimatedDtNanos = reader.int64(); + break; + case 21: + message.worldToVirtualGridRatio = reader.double(); + break; + case 22: + message.virtualGridToWorldRatio = reader.double(); + break; default: reader.skipType(tag & 7); break; @@ -1626,10 +436,10 @@ $root.treasurehunterx = (function() { /** * Decodes a BattleColliderInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.BattleColliderInfo} BattleColliderInfo + * @returns {protos.BattleColliderInfo} BattleColliderInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -1642,7 +452,7 @@ $root.treasurehunterx = (function() { /** * Verifies a BattleColliderInfo message. * @function verify - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -1658,7 +468,7 @@ $root.treasurehunterx = (function() { return "strToVec2DListMap: object expected"; var key = Object.keys(message.strToVec2DListMap); for (var i = 0; i < key.length; ++i) { - var error = $root.treasurehunterx.Vec2DList.verify(message.strToVec2DListMap[key[i]]); + var error = $root.protos.Vec2DList.verify(message.strToVec2DListMap[key[i]]); if (error) return "strToVec2DListMap." + error; } @@ -1668,7 +478,7 @@ $root.treasurehunterx = (function() { return "strToPolygon2DListMap: object expected"; var key = Object.keys(message.strToPolygon2DListMap); for (var i = 0; i < key.length; ++i) { - var error = $root.treasurehunterx.Polygon2DList.verify(message.strToPolygon2DListMap[key[i]]); + var error = $root.protos.Polygon2DList.verify(message.strToPolygon2DListMap[key[i]]); if (error) return "strToPolygon2DListMap." + error; } @@ -1718,50 +528,53 @@ $root.treasurehunterx = (function() { if (message.playerBattleState != null && message.hasOwnProperty("playerBattleState")) if (!$util.isInteger(message.playerBattleState)) return "playerBattleState: integer expected"; - if (message.rollbackEstimatedDt != null && message.hasOwnProperty("rollbackEstimatedDt")) - if (typeof message.rollbackEstimatedDt !== "number") - return "rollbackEstimatedDt: number expected"; if (message.rollbackEstimatedDtMillis != null && message.hasOwnProperty("rollbackEstimatedDtMillis")) if (typeof message.rollbackEstimatedDtMillis !== "number") return "rollbackEstimatedDtMillis: number expected"; if (message.rollbackEstimatedDtNanos != null && message.hasOwnProperty("rollbackEstimatedDtNanos")) if (!$util.isInteger(message.rollbackEstimatedDtNanos) && !(message.rollbackEstimatedDtNanos && $util.isInteger(message.rollbackEstimatedDtNanos.low) && $util.isInteger(message.rollbackEstimatedDtNanos.high))) return "rollbackEstimatedDtNanos: integer|Long expected"; + if (message.worldToVirtualGridRatio != null && message.hasOwnProperty("worldToVirtualGridRatio")) + if (typeof message.worldToVirtualGridRatio !== "number") + return "worldToVirtualGridRatio: number expected"; + if (message.virtualGridToWorldRatio != null && message.hasOwnProperty("virtualGridToWorldRatio")) + if (typeof message.virtualGridToWorldRatio !== "number") + return "virtualGridToWorldRatio: number expected"; return null; }; /** * Creates a BattleColliderInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.BattleColliderInfo} BattleColliderInfo + * @returns {protos.BattleColliderInfo} BattleColliderInfo */ BattleColliderInfo.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.BattleColliderInfo) + if (object instanceof $root.protos.BattleColliderInfo) return object; - var message = new $root.treasurehunterx.BattleColliderInfo(); + var message = new $root.protos.BattleColliderInfo(); if (object.stageName != null) message.stageName = String(object.stageName); if (object.strToVec2DListMap) { if (typeof object.strToVec2DListMap !== "object") - throw TypeError(".treasurehunterx.BattleColliderInfo.strToVec2DListMap: object expected"); + throw TypeError(".protos.BattleColliderInfo.strToVec2DListMap: object expected"); message.strToVec2DListMap = {}; for (var keys = Object.keys(object.strToVec2DListMap), i = 0; i < keys.length; ++i) { if (typeof object.strToVec2DListMap[keys[i]] !== "object") - throw TypeError(".treasurehunterx.BattleColliderInfo.strToVec2DListMap: object expected"); - message.strToVec2DListMap[keys[i]] = $root.treasurehunterx.Vec2DList.fromObject(object.strToVec2DListMap[keys[i]]); + throw TypeError(".protos.BattleColliderInfo.strToVec2DListMap: object expected"); + message.strToVec2DListMap[keys[i]] = $root.protos.Vec2DList.fromObject(object.strToVec2DListMap[keys[i]]); } } if (object.strToPolygon2DListMap) { if (typeof object.strToPolygon2DListMap !== "object") - throw TypeError(".treasurehunterx.BattleColliderInfo.strToPolygon2DListMap: object expected"); + throw TypeError(".protos.BattleColliderInfo.strToPolygon2DListMap: object expected"); message.strToPolygon2DListMap = {}; for (var keys = Object.keys(object.strToPolygon2DListMap), i = 0; i < keys.length; ++i) { if (typeof object.strToPolygon2DListMap[keys[i]] !== "object") - throw TypeError(".treasurehunterx.BattleColliderInfo.strToPolygon2DListMap: object expected"); - message.strToPolygon2DListMap[keys[i]] = $root.treasurehunterx.Polygon2DList.fromObject(object.strToPolygon2DListMap[keys[i]]); + throw TypeError(".protos.BattleColliderInfo.strToPolygon2DListMap: object expected"); + message.strToPolygon2DListMap[keys[i]] = $root.protos.Polygon2DList.fromObject(object.strToPolygon2DListMap[keys[i]]); } } if (object.stageDiscreteW != null) @@ -1801,8 +614,6 @@ $root.treasurehunterx = (function() { message.maxChasingRenderFramesPerUpdate = object.maxChasingRenderFramesPerUpdate | 0; if (object.playerBattleState != null) message.playerBattleState = object.playerBattleState | 0; - if (object.rollbackEstimatedDt != null) - message.rollbackEstimatedDt = Number(object.rollbackEstimatedDt); if (object.rollbackEstimatedDtMillis != null) message.rollbackEstimatedDtMillis = Number(object.rollbackEstimatedDtMillis); if (object.rollbackEstimatedDtNanos != null) @@ -1814,15 +625,19 @@ $root.treasurehunterx = (function() { message.rollbackEstimatedDtNanos = object.rollbackEstimatedDtNanos; else if (typeof object.rollbackEstimatedDtNanos === "object") message.rollbackEstimatedDtNanos = new $util.LongBits(object.rollbackEstimatedDtNanos.low >>> 0, object.rollbackEstimatedDtNanos.high >>> 0).toNumber(); + if (object.worldToVirtualGridRatio != null) + message.worldToVirtualGridRatio = Number(object.worldToVirtualGridRatio); + if (object.virtualGridToWorldRatio != null) + message.virtualGridToWorldRatio = Number(object.virtualGridToWorldRatio); return message; }; /** * Creates a plain object from a BattleColliderInfo message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @static - * @param {treasurehunterx.BattleColliderInfo} message BattleColliderInfo + * @param {protos.BattleColliderInfo} message BattleColliderInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -1855,13 +670,14 @@ $root.treasurehunterx = (function() { object.inputFrameUpsyncDelayTolerance = 0; object.maxChasingRenderFramesPerUpdate = 0; object.playerBattleState = 0; - object.rollbackEstimatedDt = 0; object.rollbackEstimatedDtMillis = 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.rollbackEstimatedDtNanos = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.rollbackEstimatedDtNanos = options.longs === String ? "0" : 0; + object.worldToVirtualGridRatio = 0; + object.virtualGridToWorldRatio = 0; } if (message.stageName != null && message.hasOwnProperty("stageName")) object.stageName = message.stageName; @@ -1869,12 +685,12 @@ $root.treasurehunterx = (function() { if (message.strToVec2DListMap && (keys2 = Object.keys(message.strToVec2DListMap)).length) { object.strToVec2DListMap = {}; for (var j = 0; j < keys2.length; ++j) - object.strToVec2DListMap[keys2[j]] = $root.treasurehunterx.Vec2DList.toObject(message.strToVec2DListMap[keys2[j]], options); + object.strToVec2DListMap[keys2[j]] = $root.protos.Vec2DList.toObject(message.strToVec2DListMap[keys2[j]], options); } if (message.strToPolygon2DListMap && (keys2 = Object.keys(message.strToPolygon2DListMap)).length) { object.strToPolygon2DListMap = {}; for (var j = 0; j < keys2.length; ++j) - object.strToPolygon2DListMap[keys2[j]] = $root.treasurehunterx.Polygon2DList.toObject(message.strToPolygon2DListMap[keys2[j]], options); + object.strToPolygon2DListMap[keys2[j]] = $root.protos.Polygon2DList.toObject(message.strToPolygon2DListMap[keys2[j]], options); } if (message.stageDiscreteW != null && message.hasOwnProperty("stageDiscreteW")) object.stageDiscreteW = message.stageDiscreteW; @@ -1909,8 +725,6 @@ $root.treasurehunterx = (function() { object.maxChasingRenderFramesPerUpdate = message.maxChasingRenderFramesPerUpdate; if (message.playerBattleState != null && message.hasOwnProperty("playerBattleState")) object.playerBattleState = message.playerBattleState; - if (message.rollbackEstimatedDt != null && message.hasOwnProperty("rollbackEstimatedDt")) - object.rollbackEstimatedDt = options.json && !isFinite(message.rollbackEstimatedDt) ? String(message.rollbackEstimatedDt) : message.rollbackEstimatedDt; if (message.rollbackEstimatedDtMillis != null && message.hasOwnProperty("rollbackEstimatedDtMillis")) object.rollbackEstimatedDtMillis = options.json && !isFinite(message.rollbackEstimatedDtMillis) ? String(message.rollbackEstimatedDtMillis) : message.rollbackEstimatedDtMillis; if (message.rollbackEstimatedDtNanos != null && message.hasOwnProperty("rollbackEstimatedDtNanos")) @@ -1918,13 +732,17 @@ $root.treasurehunterx = (function() { object.rollbackEstimatedDtNanos = options.longs === String ? String(message.rollbackEstimatedDtNanos) : message.rollbackEstimatedDtNanos; else object.rollbackEstimatedDtNanos = options.longs === String ? $util.Long.prototype.toString.call(message.rollbackEstimatedDtNanos) : options.longs === Number ? new $util.LongBits(message.rollbackEstimatedDtNanos.low >>> 0, message.rollbackEstimatedDtNanos.high >>> 0).toNumber() : message.rollbackEstimatedDtNanos; + if (message.worldToVirtualGridRatio != null && message.hasOwnProperty("worldToVirtualGridRatio")) + object.worldToVirtualGridRatio = options.json && !isFinite(message.worldToVirtualGridRatio) ? String(message.worldToVirtualGridRatio) : message.worldToVirtualGridRatio; + if (message.virtualGridToWorldRatio != null && message.hasOwnProperty("virtualGridToWorldRatio")) + object.virtualGridToWorldRatio = options.json && !isFinite(message.virtualGridToWorldRatio) ? String(message.virtualGridToWorldRatio) : message.virtualGridToWorldRatio; return object; }; /** * Converts this BattleColliderInfo to JSON. * @function toJSON - * @memberof treasurehunterx.BattleColliderInfo + * @memberof protos.BattleColliderInfo * @instance * @returns {Object.} JSON object */ @@ -1932,34 +750,19 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for BattleColliderInfo - * @function getTypeUrl - * @memberof treasurehunterx.BattleColliderInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BattleColliderInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.BattleColliderInfo"; - }; - return BattleColliderInfo; })(); - treasurehunterx.Player = (function() { + protos.Player = (function() { /** * Properties of a Player. - * @memberof treasurehunterx + * @memberof protos * @interface IPlayer * @property {number|null} [id] Player id - * @property {number|null} [x] Player x - * @property {number|null} [y] Player y - * @property {treasurehunterx.Direction|null} [dir] Player dir + * @property {number|null} [virtualGridX] Player virtualGridX + * @property {number|null} [virtualGridY] Player virtualGridY + * @property {protos.Direction|null} [dir] Player dir * @property {number|null} [speed] Player speed * @property {number|null} [battleState] Player battleState * @property {number|null} [lastMoveGmtMillis] Player lastMoveGmtMillis @@ -1970,11 +773,11 @@ $root.treasurehunterx = (function() { /** * Constructs a new Player. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents a Player. * @implements IPlayer * @constructor - * @param {treasurehunterx.IPlayer=} [properties] Properties to set + * @param {protos.IPlayer=} [properties] Properties to set */ function Player(properties) { if (properties) @@ -1986,31 +789,31 @@ $root.treasurehunterx = (function() { /** * Player id. * @member {number} id - * @memberof treasurehunterx.Player + * @memberof protos.Player * @instance */ Player.prototype.id = 0; /** - * Player x. - * @member {number} x - * @memberof treasurehunterx.Player + * Player virtualGridX. + * @member {number} virtualGridX + * @memberof protos.Player * @instance */ - Player.prototype.x = 0; + Player.prototype.virtualGridX = 0; /** - * Player y. - * @member {number} y - * @memberof treasurehunterx.Player + * Player virtualGridY. + * @member {number} virtualGridY + * @memberof protos.Player * @instance */ - Player.prototype.y = 0; + Player.prototype.virtualGridY = 0; /** * Player dir. - * @member {treasurehunterx.Direction|null|undefined} dir - * @memberof treasurehunterx.Player + * @member {protos.Direction|null|undefined} dir + * @memberof protos.Player * @instance */ Player.prototype.dir = null; @@ -2018,7 +821,7 @@ $root.treasurehunterx = (function() { /** * Player speed. * @member {number} speed - * @memberof treasurehunterx.Player + * @memberof protos.Player * @instance */ Player.prototype.speed = 0; @@ -2026,7 +829,7 @@ $root.treasurehunterx = (function() { /** * Player battleState. * @member {number} battleState - * @memberof treasurehunterx.Player + * @memberof protos.Player * @instance */ Player.prototype.battleState = 0; @@ -2034,7 +837,7 @@ $root.treasurehunterx = (function() { /** * Player lastMoveGmtMillis. * @member {number} lastMoveGmtMillis - * @memberof treasurehunterx.Player + * @memberof protos.Player * @instance */ Player.prototype.lastMoveGmtMillis = 0; @@ -2042,7 +845,7 @@ $root.treasurehunterx = (function() { /** * Player score. * @member {number} score - * @memberof treasurehunterx.Player + * @memberof protos.Player * @instance */ Player.prototype.score = 0; @@ -2050,7 +853,7 @@ $root.treasurehunterx = (function() { /** * Player removed. * @member {boolean} removed - * @memberof treasurehunterx.Player + * @memberof protos.Player * @instance */ Player.prototype.removed = false; @@ -2058,7 +861,7 @@ $root.treasurehunterx = (function() { /** * Player joinIndex. * @member {number} joinIndex - * @memberof treasurehunterx.Player + * @memberof protos.Player * @instance */ Player.prototype.joinIndex = 0; @@ -2066,56 +869,56 @@ $root.treasurehunterx = (function() { /** * Creates a new Player instance using the specified properties. * @function create - * @memberof treasurehunterx.Player + * @memberof protos.Player * @static - * @param {treasurehunterx.IPlayer=} [properties] Properties to set - * @returns {treasurehunterx.Player} Player instance + * @param {protos.IPlayer=} [properties] Properties to set + * @returns {protos.Player} Player instance */ Player.create = function create(properties) { return new Player(properties); }; /** - * Encodes the specified Player message. Does not implicitly {@link treasurehunterx.Player.verify|verify} messages. + * Encodes the specified Player message. Does not implicitly {@link protos.Player.verify|verify} messages. * @function encode - * @memberof treasurehunterx.Player + * @memberof protos.Player * @static - * @param {treasurehunterx.Player} message Player message or plain object to encode + * @param {protos.Player} message Player message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Player.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (message.id != null && message.hasOwnProperty("id")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.y); - if (message.dir != null && Object.hasOwnProperty.call(message, "dir")) - $root.treasurehunterx.Direction.encode(message.dir, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.speed != null && Object.hasOwnProperty.call(message, "speed")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.speed); - if (message.battleState != null && Object.hasOwnProperty.call(message, "battleState")) + if (message.virtualGridX != null && message.hasOwnProperty("virtualGridX")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.virtualGridX); + if (message.virtualGridY != null && message.hasOwnProperty("virtualGridY")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.virtualGridY); + if (message.dir != null && message.hasOwnProperty("dir")) + $root.protos.Direction.encode(message.dir, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.speed != null && message.hasOwnProperty("speed")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speed); + if (message.battleState != null && message.hasOwnProperty("battleState")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.battleState); - if (message.lastMoveGmtMillis != null && Object.hasOwnProperty.call(message, "lastMoveGmtMillis")) + if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.lastMoveGmtMillis); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) + if (message.score != null && message.hasOwnProperty("score")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.score); - if (message.removed != null && Object.hasOwnProperty.call(message, "removed")) + if (message.removed != null && message.hasOwnProperty("removed")) writer.uint32(/* id 11, wireType 0 =*/88).bool(message.removed); - if (message.joinIndex != null && Object.hasOwnProperty.call(message, "joinIndex")) + if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.joinIndex); return writer; }; /** - * Encodes the specified Player message, length delimited. Does not implicitly {@link treasurehunterx.Player.verify|verify} messages. + * Encodes the specified Player message, length delimited. Does not implicitly {@link protos.Player.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.Player + * @memberof protos.Player * @static - * @param {treasurehunterx.Player} message Player message or plain object to encode + * @param {protos.Player} message Player message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2126,61 +929,51 @@ $root.treasurehunterx = (function() { /** * Decodes a Player message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.Player + * @memberof protos.Player * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.Player} Player + * @returns {protos.Player} Player * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Player.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.Player(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.Player(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.id = reader.int32(); - break; - } - case 2: { - message.x = reader.double(); - break; - } - case 3: { - message.y = reader.double(); - break; - } - case 4: { - message.dir = $root.treasurehunterx.Direction.decode(reader, reader.uint32()); - break; - } - case 5: { - message.speed = reader.double(); - break; - } - case 6: { - message.battleState = reader.int32(); - break; - } - case 7: { - message.lastMoveGmtMillis = reader.int32(); - break; - } - case 10: { - message.score = reader.int32(); - break; - } - case 11: { - message.removed = reader.bool(); - break; - } - case 12: { - message.joinIndex = reader.int32(); - break; - } + case 1: + message.id = reader.int32(); + break; + case 2: + message.virtualGridX = reader.int32(); + break; + case 3: + message.virtualGridY = reader.int32(); + break; + case 4: + message.dir = $root.protos.Direction.decode(reader, reader.uint32()); + break; + case 5: + message.speed = reader.int32(); + break; + case 6: + message.battleState = reader.int32(); + break; + case 7: + message.lastMoveGmtMillis = reader.int32(); + break; + case 10: + message.score = reader.int32(); + break; + case 11: + message.removed = reader.bool(); + break; + case 12: + message.joinIndex = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -2192,10 +985,10 @@ $root.treasurehunterx = (function() { /** * Decodes a Player message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.Player + * @memberof protos.Player * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.Player} Player + * @returns {protos.Player} Player * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -2208,7 +1001,7 @@ $root.treasurehunterx = (function() { /** * Verifies a Player message. * @function verify - * @memberof treasurehunterx.Player + * @memberof protos.Player * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -2219,20 +1012,20 @@ $root.treasurehunterx = (function() { if (message.id != null && message.hasOwnProperty("id")) if (!$util.isInteger(message.id)) return "id: 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.virtualGridX != null && message.hasOwnProperty("virtualGridX")) + if (!$util.isInteger(message.virtualGridX)) + return "virtualGridX: integer expected"; + if (message.virtualGridY != null && message.hasOwnProperty("virtualGridY")) + if (!$util.isInteger(message.virtualGridY)) + return "virtualGridY: integer expected"; if (message.dir != null && message.hasOwnProperty("dir")) { - var error = $root.treasurehunterx.Direction.verify(message.dir); + var error = $root.protos.Direction.verify(message.dir); if (error) return "dir." + error; } if (message.speed != null && message.hasOwnProperty("speed")) - if (typeof message.speed !== "number") - return "speed: number expected"; + if (!$util.isInteger(message.speed)) + return "speed: integer expected"; if (message.battleState != null && message.hasOwnProperty("battleState")) if (!$util.isInteger(message.battleState)) return "battleState: integer expected"; @@ -2254,28 +1047,28 @@ $root.treasurehunterx = (function() { /** * Creates a Player message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.Player + * @memberof protos.Player * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.Player} Player + * @returns {protos.Player} Player */ Player.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.Player) + if (object instanceof $root.protos.Player) return object; - var message = new $root.treasurehunterx.Player(); + var message = new $root.protos.Player(); if (object.id != null) message.id = object.id | 0; - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); + if (object.virtualGridX != null) + message.virtualGridX = object.virtualGridX | 0; + if (object.virtualGridY != null) + message.virtualGridY = object.virtualGridY | 0; if (object.dir != null) { if (typeof object.dir !== "object") - throw TypeError(".treasurehunterx.Player.dir: object expected"); - message.dir = $root.treasurehunterx.Direction.fromObject(object.dir); + throw TypeError(".protos.Player.dir: object expected"); + message.dir = $root.protos.Direction.fromObject(object.dir); } if (object.speed != null) - message.speed = Number(object.speed); + message.speed = object.speed | 0; if (object.battleState != null) message.battleState = object.battleState | 0; if (object.lastMoveGmtMillis != null) @@ -2292,9 +1085,9 @@ $root.treasurehunterx = (function() { /** * Creates a plain object from a Player message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.Player + * @memberof protos.Player * @static - * @param {treasurehunterx.Player} message Player + * @param {protos.Player} message Player * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -2304,8 +1097,8 @@ $root.treasurehunterx = (function() { var object = {}; if (options.defaults) { object.id = 0; - object.x = 0; - object.y = 0; + object.virtualGridX = 0; + object.virtualGridY = 0; object.dir = null; object.speed = 0; object.battleState = 0; @@ -2316,14 +1109,14 @@ $root.treasurehunterx = (function() { } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; - 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.virtualGridX != null && message.hasOwnProperty("virtualGridX")) + object.virtualGridX = message.virtualGridX; + if (message.virtualGridY != null && message.hasOwnProperty("virtualGridY")) + object.virtualGridY = message.virtualGridY; if (message.dir != null && message.hasOwnProperty("dir")) - object.dir = $root.treasurehunterx.Direction.toObject(message.dir, options); + object.dir = $root.protos.Direction.toObject(message.dir, options); if (message.speed != null && message.hasOwnProperty("speed")) - object.speed = options.json && !isFinite(message.speed) ? String(message.speed) : message.speed; + object.speed = message.speed; if (message.battleState != null && message.hasOwnProperty("battleState")) object.battleState = message.battleState; if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis")) @@ -2340,7 +1133,7 @@ $root.treasurehunterx = (function() { /** * Converts this Player to JSON. * @function toJSON - * @memberof treasurehunterx.Player + * @memberof protos.Player * @instance * @returns {Object.} JSON object */ @@ -2348,29 +1141,14 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for Player - * @function getTypeUrl - * @memberof treasurehunterx.Player - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Player.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.Player"; - }; - return Player; })(); - treasurehunterx.PlayerMeta = (function() { + protos.PlayerMeta = (function() { /** * Properties of a PlayerMeta. - * @memberof treasurehunterx + * @memberof protos * @interface IPlayerMeta * @property {number|null} [id] PlayerMeta id * @property {string|null} [name] PlayerMeta name @@ -2381,11 +1159,11 @@ $root.treasurehunterx = (function() { /** * Constructs a new PlayerMeta. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents a PlayerMeta. * @implements IPlayerMeta * @constructor - * @param {treasurehunterx.IPlayerMeta=} [properties] Properties to set + * @param {protos.IPlayerMeta=} [properties] Properties to set */ function PlayerMeta(properties) { if (properties) @@ -2397,7 +1175,7 @@ $root.treasurehunterx = (function() { /** * PlayerMeta id. * @member {number} id - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @instance */ PlayerMeta.prototype.id = 0; @@ -2405,7 +1183,7 @@ $root.treasurehunterx = (function() { /** * PlayerMeta name. * @member {string} name - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @instance */ PlayerMeta.prototype.name = ""; @@ -2413,7 +1191,7 @@ $root.treasurehunterx = (function() { /** * PlayerMeta displayName. * @member {string} displayName - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @instance */ PlayerMeta.prototype.displayName = ""; @@ -2421,7 +1199,7 @@ $root.treasurehunterx = (function() { /** * PlayerMeta avatar. * @member {string} avatar - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @instance */ PlayerMeta.prototype.avatar = ""; @@ -2429,7 +1207,7 @@ $root.treasurehunterx = (function() { /** * PlayerMeta joinIndex. * @member {number} joinIndex - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @instance */ PlayerMeta.prototype.joinIndex = 0; @@ -2437,46 +1215,46 @@ $root.treasurehunterx = (function() { /** * Creates a new PlayerMeta instance using the specified properties. * @function create - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @static - * @param {treasurehunterx.IPlayerMeta=} [properties] Properties to set - * @returns {treasurehunterx.PlayerMeta} PlayerMeta instance + * @param {protos.IPlayerMeta=} [properties] Properties to set + * @returns {protos.PlayerMeta} PlayerMeta instance */ PlayerMeta.create = function create(properties) { return new PlayerMeta(properties); }; /** - * Encodes the specified PlayerMeta message. Does not implicitly {@link treasurehunterx.PlayerMeta.verify|verify} messages. + * Encodes the specified PlayerMeta message. Does not implicitly {@link protos.PlayerMeta.verify|verify} messages. * @function encode - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @static - * @param {treasurehunterx.PlayerMeta} message PlayerMeta message or plain object to encode + * @param {protos.PlayerMeta} message PlayerMeta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PlayerMeta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (message.id != null && message.hasOwnProperty("id")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + if (message.displayName != null && message.hasOwnProperty("displayName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.avatar != null && Object.hasOwnProperty.call(message, "avatar")) + if (message.avatar != null && message.hasOwnProperty("avatar")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.avatar); - if (message.joinIndex != null && Object.hasOwnProperty.call(message, "joinIndex")) + if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.joinIndex); return writer; }; /** - * Encodes the specified PlayerMeta message, length delimited. Does not implicitly {@link treasurehunterx.PlayerMeta.verify|verify} messages. + * Encodes the specified PlayerMeta message, length delimited. Does not implicitly {@link protos.PlayerMeta.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @static - * @param {treasurehunterx.PlayerMeta} message PlayerMeta message or plain object to encode + * @param {protos.PlayerMeta} message PlayerMeta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2487,41 +1265,36 @@ $root.treasurehunterx = (function() { /** * Decodes a PlayerMeta message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.PlayerMeta} PlayerMeta + * @returns {protos.PlayerMeta} PlayerMeta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PlayerMeta.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.PlayerMeta(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.PlayerMeta(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.id = reader.int32(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - message.avatar = reader.string(); - break; - } - case 5: { - message.joinIndex = reader.int32(); - break; - } + case 1: + message.id = reader.int32(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.displayName = reader.string(); + break; + case 4: + message.avatar = reader.string(); + break; + case 5: + message.joinIndex = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -2533,10 +1306,10 @@ $root.treasurehunterx = (function() { /** * Decodes a PlayerMeta message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.PlayerMeta} PlayerMeta + * @returns {protos.PlayerMeta} PlayerMeta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -2549,7 +1322,7 @@ $root.treasurehunterx = (function() { /** * Verifies a PlayerMeta message. * @function verify - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -2578,15 +1351,15 @@ $root.treasurehunterx = (function() { /** * Creates a PlayerMeta message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.PlayerMeta} PlayerMeta + * @returns {protos.PlayerMeta} PlayerMeta */ PlayerMeta.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.PlayerMeta) + if (object instanceof $root.protos.PlayerMeta) return object; - var message = new $root.treasurehunterx.PlayerMeta(); + var message = new $root.protos.PlayerMeta(); if (object.id != null) message.id = object.id | 0; if (object.name != null) @@ -2603,9 +1376,9 @@ $root.treasurehunterx = (function() { /** * Creates a plain object from a PlayerMeta message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @static - * @param {treasurehunterx.PlayerMeta} message PlayerMeta + * @param {protos.PlayerMeta} message PlayerMeta * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -2636,7 +1409,7 @@ $root.treasurehunterx = (function() { /** * Converts this PlayerMeta to JSON. * @function toJSON - * @memberof treasurehunterx.PlayerMeta + * @memberof protos.PlayerMeta * @instance * @returns {Object.} JSON object */ @@ -2644,29 +1417,14 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for PlayerMeta - * @function getTypeUrl - * @memberof treasurehunterx.PlayerMeta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PlayerMeta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.PlayerMeta"; - }; - return PlayerMeta; })(); - treasurehunterx.InputFrameUpsync = (function() { + protos.InputFrameUpsync = (function() { /** * Properties of an InputFrameUpsync. - * @memberof treasurehunterx + * @memberof protos * @interface IInputFrameUpsync * @property {number|null} [inputFrameId] InputFrameUpsync inputFrameId * @property {number|null} [encodedDir] InputFrameUpsync encodedDir @@ -2674,11 +1432,11 @@ $root.treasurehunterx = (function() { /** * Constructs a new InputFrameUpsync. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents an InputFrameUpsync. * @implements IInputFrameUpsync * @constructor - * @param {treasurehunterx.IInputFrameUpsync=} [properties] Properties to set + * @param {protos.IInputFrameUpsync=} [properties] Properties to set */ function InputFrameUpsync(properties) { if (properties) @@ -2690,7 +1448,7 @@ $root.treasurehunterx = (function() { /** * InputFrameUpsync inputFrameId. * @member {number} inputFrameId - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @instance */ InputFrameUpsync.prototype.inputFrameId = 0; @@ -2698,7 +1456,7 @@ $root.treasurehunterx = (function() { /** * InputFrameUpsync encodedDir. * @member {number} encodedDir - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @instance */ InputFrameUpsync.prototype.encodedDir = 0; @@ -2706,40 +1464,40 @@ $root.treasurehunterx = (function() { /** * Creates a new InputFrameUpsync instance using the specified properties. * @function create - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @static - * @param {treasurehunterx.IInputFrameUpsync=} [properties] Properties to set - * @returns {treasurehunterx.InputFrameUpsync} InputFrameUpsync instance + * @param {protos.IInputFrameUpsync=} [properties] Properties to set + * @returns {protos.InputFrameUpsync} InputFrameUpsync instance */ InputFrameUpsync.create = function create(properties) { return new InputFrameUpsync(properties); }; /** - * Encodes the specified InputFrameUpsync message. Does not implicitly {@link treasurehunterx.InputFrameUpsync.verify|verify} messages. + * Encodes the specified InputFrameUpsync message. Does not implicitly {@link protos.InputFrameUpsync.verify|verify} messages. * @function encode - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @static - * @param {treasurehunterx.InputFrameUpsync} message InputFrameUpsync message or plain object to encode + * @param {protos.InputFrameUpsync} message InputFrameUpsync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ InputFrameUpsync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputFrameId != null && Object.hasOwnProperty.call(message, "inputFrameId")) + if (message.inputFrameId != null && message.hasOwnProperty("inputFrameId")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputFrameId); - if (message.encodedDir != null && Object.hasOwnProperty.call(message, "encodedDir")) + if (message.encodedDir != null && message.hasOwnProperty("encodedDir")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.encodedDir); return writer; }; /** - * Encodes the specified InputFrameUpsync message, length delimited. Does not implicitly {@link treasurehunterx.InputFrameUpsync.verify|verify} messages. + * Encodes the specified InputFrameUpsync message, length delimited. Does not implicitly {@link protos.InputFrameUpsync.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @static - * @param {treasurehunterx.InputFrameUpsync} message InputFrameUpsync message or plain object to encode + * @param {protos.InputFrameUpsync} message InputFrameUpsync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2750,29 +1508,27 @@ $root.treasurehunterx = (function() { /** * Decodes an InputFrameUpsync message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.InputFrameUpsync} InputFrameUpsync + * @returns {protos.InputFrameUpsync} InputFrameUpsync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ InputFrameUpsync.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.InputFrameUpsync(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.InputFrameUpsync(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.inputFrameId = reader.int32(); - break; - } - case 6: { - message.encodedDir = reader.int32(); - break; - } + case 1: + message.inputFrameId = reader.int32(); + break; + case 6: + message.encodedDir = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -2784,10 +1540,10 @@ $root.treasurehunterx = (function() { /** * Decodes an InputFrameUpsync message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.InputFrameUpsync} InputFrameUpsync + * @returns {protos.InputFrameUpsync} InputFrameUpsync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -2800,7 +1556,7 @@ $root.treasurehunterx = (function() { /** * Verifies an InputFrameUpsync message. * @function verify - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -2820,15 +1576,15 @@ $root.treasurehunterx = (function() { /** * Creates an InputFrameUpsync message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.InputFrameUpsync} InputFrameUpsync + * @returns {protos.InputFrameUpsync} InputFrameUpsync */ InputFrameUpsync.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.InputFrameUpsync) + if (object instanceof $root.protos.InputFrameUpsync) return object; - var message = new $root.treasurehunterx.InputFrameUpsync(); + var message = new $root.protos.InputFrameUpsync(); if (object.inputFrameId != null) message.inputFrameId = object.inputFrameId | 0; if (object.encodedDir != null) @@ -2839,9 +1595,9 @@ $root.treasurehunterx = (function() { /** * Creates a plain object from an InputFrameUpsync message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @static - * @param {treasurehunterx.InputFrameUpsync} message InputFrameUpsync + * @param {protos.InputFrameUpsync} message InputFrameUpsync * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -2863,7 +1619,7 @@ $root.treasurehunterx = (function() { /** * Converts this InputFrameUpsync to JSON. * @function toJSON - * @memberof treasurehunterx.InputFrameUpsync + * @memberof protos.InputFrameUpsync * @instance * @returns {Object.} JSON object */ @@ -2871,29 +1627,14 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for InputFrameUpsync - * @function getTypeUrl - * @memberof treasurehunterx.InputFrameUpsync - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InputFrameUpsync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.InputFrameUpsync"; - }; - return InputFrameUpsync; })(); - treasurehunterx.InputFrameDownsync = (function() { + protos.InputFrameDownsync = (function() { /** * Properties of an InputFrameDownsync. - * @memberof treasurehunterx + * @memberof protos * @interface IInputFrameDownsync * @property {number|null} [inputFrameId] InputFrameDownsync inputFrameId * @property {Array.|null} [inputList] InputFrameDownsync inputList @@ -2902,11 +1643,11 @@ $root.treasurehunterx = (function() { /** * Constructs a new InputFrameDownsync. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents an InputFrameDownsync. * @implements IInputFrameDownsync * @constructor - * @param {treasurehunterx.IInputFrameDownsync=} [properties] Properties to set + * @param {protos.IInputFrameDownsync=} [properties] Properties to set */ function InputFrameDownsync(properties) { this.inputList = []; @@ -2919,7 +1660,7 @@ $root.treasurehunterx = (function() { /** * InputFrameDownsync inputFrameId. * @member {number} inputFrameId - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @instance */ InputFrameDownsync.prototype.inputFrameId = 0; @@ -2927,7 +1668,7 @@ $root.treasurehunterx = (function() { /** * InputFrameDownsync inputList. * @member {Array.} inputList - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @instance */ InputFrameDownsync.prototype.inputList = $util.emptyArray; @@ -2935,7 +1676,7 @@ $root.treasurehunterx = (function() { /** * InputFrameDownsync confirmedList. * @member {number|Long} confirmedList - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @instance */ InputFrameDownsync.prototype.confirmedList = $util.Long ? $util.Long.fromBits(0,0,true) : 0; @@ -2943,28 +1684,28 @@ $root.treasurehunterx = (function() { /** * Creates a new InputFrameDownsync instance using the specified properties. * @function create - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @static - * @param {treasurehunterx.IInputFrameDownsync=} [properties] Properties to set - * @returns {treasurehunterx.InputFrameDownsync} InputFrameDownsync instance + * @param {protos.IInputFrameDownsync=} [properties] Properties to set + * @returns {protos.InputFrameDownsync} InputFrameDownsync instance */ InputFrameDownsync.create = function create(properties) { return new InputFrameDownsync(properties); }; /** - * Encodes the specified InputFrameDownsync message. Does not implicitly {@link treasurehunterx.InputFrameDownsync.verify|verify} messages. + * Encodes the specified InputFrameDownsync message. Does not implicitly {@link protos.InputFrameDownsync.verify|verify} messages. * @function encode - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @static - * @param {treasurehunterx.InputFrameDownsync} message InputFrameDownsync message or plain object to encode + * @param {protos.InputFrameDownsync} message InputFrameDownsync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ InputFrameDownsync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputFrameId != null && Object.hasOwnProperty.call(message, "inputFrameId")) + if (message.inputFrameId != null && message.hasOwnProperty("inputFrameId")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputFrameId); if (message.inputList != null && message.inputList.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); @@ -2972,17 +1713,17 @@ $root.treasurehunterx = (function() { writer.uint64(message.inputList[i]); writer.ldelim(); } - if (message.confirmedList != null && Object.hasOwnProperty.call(message, "confirmedList")) + if (message.confirmedList != null && message.hasOwnProperty("confirmedList")) writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.confirmedList); return writer; }; /** - * Encodes the specified InputFrameDownsync message, length delimited. Does not implicitly {@link treasurehunterx.InputFrameDownsync.verify|verify} messages. + * Encodes the specified InputFrameDownsync message, length delimited. Does not implicitly {@link protos.InputFrameDownsync.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @static - * @param {treasurehunterx.InputFrameDownsync} message InputFrameDownsync message or plain object to encode + * @param {protos.InputFrameDownsync} message InputFrameDownsync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -2993,40 +1734,37 @@ $root.treasurehunterx = (function() { /** * Decodes an InputFrameDownsync message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.InputFrameDownsync} InputFrameDownsync + * @returns {protos.InputFrameDownsync} InputFrameDownsync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ InputFrameDownsync.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.InputFrameDownsync(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.InputFrameDownsync(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.inputFrameId = reader.int32(); - break; - } - case 2: { - if (!(message.inputList && message.inputList.length)) - message.inputList = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.inputList.push(reader.uint64()); - } else + case 1: + message.inputFrameId = reader.int32(); + break; + case 2: + if (!(message.inputList && message.inputList.length)) + message.inputList = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) message.inputList.push(reader.uint64()); - break; - } - case 3: { - message.confirmedList = reader.uint64(); - break; - } + } else + message.inputList.push(reader.uint64()); + break; + case 3: + message.confirmedList = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -3038,10 +1776,10 @@ $root.treasurehunterx = (function() { /** * Decodes an InputFrameDownsync message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.InputFrameDownsync} InputFrameDownsync + * @returns {protos.InputFrameDownsync} InputFrameDownsync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -3054,7 +1792,7 @@ $root.treasurehunterx = (function() { /** * Verifies an InputFrameDownsync message. * @function verify - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -3081,20 +1819,20 @@ $root.treasurehunterx = (function() { /** * Creates an InputFrameDownsync message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.InputFrameDownsync} InputFrameDownsync + * @returns {protos.InputFrameDownsync} InputFrameDownsync */ InputFrameDownsync.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.InputFrameDownsync) + if (object instanceof $root.protos.InputFrameDownsync) return object; - var message = new $root.treasurehunterx.InputFrameDownsync(); + var message = new $root.protos.InputFrameDownsync(); if (object.inputFrameId != null) message.inputFrameId = object.inputFrameId | 0; if (object.inputList) { if (!Array.isArray(object.inputList)) - throw TypeError(".treasurehunterx.InputFrameDownsync.inputList: array expected"); + throw TypeError(".protos.InputFrameDownsync.inputList: array expected"); message.inputList = []; for (var i = 0; i < object.inputList.length; ++i) if ($util.Long) @@ -3121,9 +1859,9 @@ $root.treasurehunterx = (function() { /** * Creates a plain object from an InputFrameDownsync message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @static - * @param {treasurehunterx.InputFrameDownsync} message InputFrameDownsync + * @param {protos.InputFrameDownsync} message InputFrameDownsync * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -3162,7 +1900,7 @@ $root.treasurehunterx = (function() { /** * Converts this InputFrameDownsync to JSON. * @function toJSON - * @memberof treasurehunterx.InputFrameDownsync + * @memberof protos.InputFrameDownsync * @instance * @returns {Object.} JSON object */ @@ -3170,40 +1908,25 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for InputFrameDownsync - * @function getTypeUrl - * @memberof treasurehunterx.InputFrameDownsync - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InputFrameDownsync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.InputFrameDownsync"; - }; - return InputFrameDownsync; })(); - treasurehunterx.HeartbeatUpsync = (function() { + protos.HeartbeatUpsync = (function() { /** * Properties of a HeartbeatUpsync. - * @memberof treasurehunterx + * @memberof protos * @interface IHeartbeatUpsync * @property {number|Long|null} [clientTimestamp] HeartbeatUpsync clientTimestamp */ /** * Constructs a new HeartbeatUpsync. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents a HeartbeatUpsync. * @implements IHeartbeatUpsync * @constructor - * @param {treasurehunterx.IHeartbeatUpsync=} [properties] Properties to set + * @param {protos.IHeartbeatUpsync=} [properties] Properties to set */ function HeartbeatUpsync(properties) { if (properties) @@ -3215,7 +1938,7 @@ $root.treasurehunterx = (function() { /** * HeartbeatUpsync clientTimestamp. * @member {number|Long} clientTimestamp - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @instance */ HeartbeatUpsync.prototype.clientTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; @@ -3223,38 +1946,38 @@ $root.treasurehunterx = (function() { /** * Creates a new HeartbeatUpsync instance using the specified properties. * @function create - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @static - * @param {treasurehunterx.IHeartbeatUpsync=} [properties] Properties to set - * @returns {treasurehunterx.HeartbeatUpsync} HeartbeatUpsync instance + * @param {protos.IHeartbeatUpsync=} [properties] Properties to set + * @returns {protos.HeartbeatUpsync} HeartbeatUpsync instance */ HeartbeatUpsync.create = function create(properties) { return new HeartbeatUpsync(properties); }; /** - * Encodes the specified HeartbeatUpsync message. Does not implicitly {@link treasurehunterx.HeartbeatUpsync.verify|verify} messages. + * Encodes the specified HeartbeatUpsync message. Does not implicitly {@link protos.HeartbeatUpsync.verify|verify} messages. * @function encode - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @static - * @param {treasurehunterx.HeartbeatUpsync} message HeartbeatUpsync message or plain object to encode + * @param {protos.HeartbeatUpsync} message HeartbeatUpsync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HeartbeatUpsync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.clientTimestamp != null && Object.hasOwnProperty.call(message, "clientTimestamp")) + if (message.clientTimestamp != null && message.hasOwnProperty("clientTimestamp")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.clientTimestamp); return writer; }; /** - * Encodes the specified HeartbeatUpsync message, length delimited. Does not implicitly {@link treasurehunterx.HeartbeatUpsync.verify|verify} messages. + * Encodes the specified HeartbeatUpsync message, length delimited. Does not implicitly {@link protos.HeartbeatUpsync.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @static - * @param {treasurehunterx.HeartbeatUpsync} message HeartbeatUpsync message or plain object to encode + * @param {protos.HeartbeatUpsync} message HeartbeatUpsync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3265,25 +1988,24 @@ $root.treasurehunterx = (function() { /** * Decodes a HeartbeatUpsync message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.HeartbeatUpsync} HeartbeatUpsync + * @returns {protos.HeartbeatUpsync} HeartbeatUpsync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HeartbeatUpsync.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.HeartbeatUpsync(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.HeartbeatUpsync(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.clientTimestamp = reader.int64(); - break; - } + case 1: + message.clientTimestamp = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -3295,10 +2017,10 @@ $root.treasurehunterx = (function() { /** * Decodes a HeartbeatUpsync message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.HeartbeatUpsync} HeartbeatUpsync + * @returns {protos.HeartbeatUpsync} HeartbeatUpsync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -3311,7 +2033,7 @@ $root.treasurehunterx = (function() { /** * Verifies a HeartbeatUpsync message. * @function verify - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -3328,15 +2050,15 @@ $root.treasurehunterx = (function() { /** * Creates a HeartbeatUpsync message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.HeartbeatUpsync} HeartbeatUpsync + * @returns {protos.HeartbeatUpsync} HeartbeatUpsync */ HeartbeatUpsync.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.HeartbeatUpsync) + if (object instanceof $root.protos.HeartbeatUpsync) return object; - var message = new $root.treasurehunterx.HeartbeatUpsync(); + var message = new $root.protos.HeartbeatUpsync(); if (object.clientTimestamp != null) if ($util.Long) (message.clientTimestamp = $util.Long.fromValue(object.clientTimestamp)).unsigned = false; @@ -3352,9 +2074,9 @@ $root.treasurehunterx = (function() { /** * Creates a plain object from a HeartbeatUpsync message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @static - * @param {treasurehunterx.HeartbeatUpsync} message HeartbeatUpsync + * @param {protos.HeartbeatUpsync} message HeartbeatUpsync * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -3379,7 +2101,7 @@ $root.treasurehunterx = (function() { /** * Converts this HeartbeatUpsync to JSON. * @function toJSON - * @memberof treasurehunterx.HeartbeatUpsync + * @memberof protos.HeartbeatUpsync * @instance * @returns {Object.} JSON object */ @@ -3387,43 +2109,28 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for HeartbeatUpsync - * @function getTypeUrl - * @memberof treasurehunterx.HeartbeatUpsync - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HeartbeatUpsync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.HeartbeatUpsync"; - }; - return HeartbeatUpsync; })(); - treasurehunterx.RoomDownsyncFrame = (function() { + protos.RoomDownsyncFrame = (function() { /** * Properties of a RoomDownsyncFrame. - * @memberof treasurehunterx + * @memberof protos * @interface IRoomDownsyncFrame * @property {number|null} [id] RoomDownsyncFrame id - * @property {Object.|null} [players] RoomDownsyncFrame players + * @property {Object.|null} [players] RoomDownsyncFrame players * @property {number|Long|null} [countdownNanos] RoomDownsyncFrame countdownNanos - * @property {Object.|null} [playerMetas] RoomDownsyncFrame playerMetas + * @property {Object.|null} [playerMetas] RoomDownsyncFrame playerMetas */ /** * Constructs a new RoomDownsyncFrame. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents a RoomDownsyncFrame. * @implements IRoomDownsyncFrame * @constructor - * @param {treasurehunterx.IRoomDownsyncFrame=} [properties] Properties to set + * @param {protos.IRoomDownsyncFrame=} [properties] Properties to set */ function RoomDownsyncFrame(properties) { this.players = {}; @@ -3437,15 +2144,15 @@ $root.treasurehunterx = (function() { /** * RoomDownsyncFrame id. * @member {number} id - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @instance */ RoomDownsyncFrame.prototype.id = 0; /** * RoomDownsyncFrame players. - * @member {Object.} players - * @memberof treasurehunterx.RoomDownsyncFrame + * @member {Object.} players + * @memberof protos.RoomDownsyncFrame * @instance */ RoomDownsyncFrame.prototype.players = $util.emptyObject; @@ -3453,15 +2160,15 @@ $root.treasurehunterx = (function() { /** * RoomDownsyncFrame countdownNanos. * @member {number|Long} countdownNanos - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @instance */ RoomDownsyncFrame.prototype.countdownNanos = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * RoomDownsyncFrame playerMetas. - * @member {Object.} playerMetas - * @memberof treasurehunterx.RoomDownsyncFrame + * @member {Object.} playerMetas + * @memberof protos.RoomDownsyncFrame * @instance */ RoomDownsyncFrame.prototype.playerMetas = $util.emptyObject; @@ -3469,50 +2176,50 @@ $root.treasurehunterx = (function() { /** * Creates a new RoomDownsyncFrame instance using the specified properties. * @function create - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @static - * @param {treasurehunterx.IRoomDownsyncFrame=} [properties] Properties to set - * @returns {treasurehunterx.RoomDownsyncFrame} RoomDownsyncFrame instance + * @param {protos.IRoomDownsyncFrame=} [properties] Properties to set + * @returns {protos.RoomDownsyncFrame} RoomDownsyncFrame instance */ RoomDownsyncFrame.create = function create(properties) { return new RoomDownsyncFrame(properties); }; /** - * Encodes the specified RoomDownsyncFrame message. Does not implicitly {@link treasurehunterx.RoomDownsyncFrame.verify|verify} messages. + * Encodes the specified RoomDownsyncFrame message. Does not implicitly {@link protos.RoomDownsyncFrame.verify|verify} messages. * @function encode - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @static - * @param {treasurehunterx.RoomDownsyncFrame} message RoomDownsyncFrame message or plain object to encode + * @param {protos.RoomDownsyncFrame} message RoomDownsyncFrame message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ RoomDownsyncFrame.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (message.id != null && message.hasOwnProperty("id")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id); - if (message.players != null && Object.hasOwnProperty.call(message, "players")) + if (message.players != null && message.hasOwnProperty("players")) for (var keys = Object.keys(message.players), i = 0; i < keys.length; ++i) { writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.treasurehunterx.Player.encode(message.players[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.protos.Player.encode(message.players[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.countdownNanos != null && Object.hasOwnProperty.call(message, "countdownNanos")) + if (message.countdownNanos != null && message.hasOwnProperty("countdownNanos")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.countdownNanos); - if (message.playerMetas != null && Object.hasOwnProperty.call(message, "playerMetas")) + if (message.playerMetas != null && message.hasOwnProperty("playerMetas")) for (var keys = Object.keys(message.playerMetas), i = 0; i < keys.length; ++i) { writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.treasurehunterx.PlayerMeta.encode(message.playerMetas[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.protos.PlayerMeta.encode(message.playerMetas[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } return writer; }; /** - * Encodes the specified RoomDownsyncFrame message, length delimited. Does not implicitly {@link treasurehunterx.RoomDownsyncFrame.verify|verify} messages. + * Encodes the specified RoomDownsyncFrame message, length delimited. Does not implicitly {@link protos.RoomDownsyncFrame.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @static - * @param {treasurehunterx.RoomDownsyncFrame} message RoomDownsyncFrame message or plain object to encode + * @param {protos.RoomDownsyncFrame} message RoomDownsyncFrame message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3523,75 +2230,43 @@ $root.treasurehunterx = (function() { /** * Decodes a RoomDownsyncFrame message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.RoomDownsyncFrame} RoomDownsyncFrame + * @returns {protos.RoomDownsyncFrame} RoomDownsyncFrame * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RoomDownsyncFrame.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.treasurehunterx.RoomDownsyncFrame(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.RoomDownsyncFrame(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.id = reader.int32(); - break; - } - case 2: { - if (message.players === $util.emptyObject) - message.players = {}; - var end2 = reader.uint32() + reader.pos; - key = 0; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.int32(); - break; - case 2: - value = $root.treasurehunterx.Player.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.players[key] = value; - break; - } - case 3: { - message.countdownNanos = reader.int64(); - break; - } - case 4: { - if (message.playerMetas === $util.emptyObject) - message.playerMetas = {}; - 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.PlayerMeta.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.playerMetas[key] = value; - break; - } + case 1: + message.id = reader.int32(); + break; + case 2: + reader.skip().pos++; + if (message.players === $util.emptyObject) + message.players = {}; + key = reader.int32(); + reader.pos++; + message.players[key] = $root.protos.Player.decode(reader, reader.uint32()); + break; + case 3: + message.countdownNanos = reader.int64(); + break; + case 4: + reader.skip().pos++; + if (message.playerMetas === $util.emptyObject) + message.playerMetas = {}; + key = reader.int32(); + reader.pos++; + message.playerMetas[key] = $root.protos.PlayerMeta.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -3603,10 +2278,10 @@ $root.treasurehunterx = (function() { /** * Decodes a RoomDownsyncFrame message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.RoomDownsyncFrame} RoomDownsyncFrame + * @returns {protos.RoomDownsyncFrame} RoomDownsyncFrame * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -3619,7 +2294,7 @@ $root.treasurehunterx = (function() { /** * Verifies a RoomDownsyncFrame message. * @function verify - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -3638,7 +2313,7 @@ $root.treasurehunterx = (function() { if (!$util.key32Re.test(key[i])) return "players: integer key{k:int32} expected"; { - var error = $root.treasurehunterx.Player.verify(message.players[key[i]]); + var error = $root.protos.Player.verify(message.players[key[i]]); if (error) return "players." + error; } @@ -3655,7 +2330,7 @@ $root.treasurehunterx = (function() { if (!$util.key32Re.test(key[i])) return "playerMetas: integer key{k:int32} expected"; { - var error = $root.treasurehunterx.PlayerMeta.verify(message.playerMetas[key[i]]); + var error = $root.protos.PlayerMeta.verify(message.playerMetas[key[i]]); if (error) return "playerMetas." + error; } @@ -3667,25 +2342,25 @@ $root.treasurehunterx = (function() { /** * Creates a RoomDownsyncFrame message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.RoomDownsyncFrame} RoomDownsyncFrame + * @returns {protos.RoomDownsyncFrame} RoomDownsyncFrame */ RoomDownsyncFrame.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.RoomDownsyncFrame) + if (object instanceof $root.protos.RoomDownsyncFrame) return object; - var message = new $root.treasurehunterx.RoomDownsyncFrame(); + var message = new $root.protos.RoomDownsyncFrame(); if (object.id != null) message.id = object.id | 0; if (object.players) { if (typeof object.players !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.players: object expected"); + throw TypeError(".protos.RoomDownsyncFrame.players: object expected"); message.players = {}; for (var keys = Object.keys(object.players), i = 0; i < keys.length; ++i) { if (typeof object.players[keys[i]] !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.players: object expected"); - message.players[keys[i]] = $root.treasurehunterx.Player.fromObject(object.players[keys[i]]); + throw TypeError(".protos.RoomDownsyncFrame.players: object expected"); + message.players[keys[i]] = $root.protos.Player.fromObject(object.players[keys[i]]); } } if (object.countdownNanos != null) @@ -3699,12 +2374,12 @@ $root.treasurehunterx = (function() { message.countdownNanos = new $util.LongBits(object.countdownNanos.low >>> 0, object.countdownNanos.high >>> 0).toNumber(); if (object.playerMetas) { if (typeof object.playerMetas !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.playerMetas: object expected"); + throw TypeError(".protos.RoomDownsyncFrame.playerMetas: object expected"); message.playerMetas = {}; for (var keys = Object.keys(object.playerMetas), i = 0; i < keys.length; ++i) { if (typeof object.playerMetas[keys[i]] !== "object") - throw TypeError(".treasurehunterx.RoomDownsyncFrame.playerMetas: object expected"); - message.playerMetas[keys[i]] = $root.treasurehunterx.PlayerMeta.fromObject(object.playerMetas[keys[i]]); + throw TypeError(".protos.RoomDownsyncFrame.playerMetas: object expected"); + message.playerMetas[keys[i]] = $root.protos.PlayerMeta.fromObject(object.playerMetas[keys[i]]); } } return message; @@ -3713,9 +2388,9 @@ $root.treasurehunterx = (function() { /** * Creates a plain object from a RoomDownsyncFrame message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @static - * @param {treasurehunterx.RoomDownsyncFrame} message RoomDownsyncFrame + * @param {protos.RoomDownsyncFrame} message RoomDownsyncFrame * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -3741,7 +2416,7 @@ $root.treasurehunterx = (function() { if (message.players && (keys2 = Object.keys(message.players)).length) { object.players = {}; for (var j = 0; j < keys2.length; ++j) - object.players[keys2[j]] = $root.treasurehunterx.Player.toObject(message.players[keys2[j]], options); + object.players[keys2[j]] = $root.protos.Player.toObject(message.players[keys2[j]], options); } if (message.countdownNanos != null && message.hasOwnProperty("countdownNanos")) if (typeof message.countdownNanos === "number") @@ -3751,7 +2426,7 @@ $root.treasurehunterx = (function() { if (message.playerMetas && (keys2 = Object.keys(message.playerMetas)).length) { object.playerMetas = {}; for (var j = 0; j < keys2.length; ++j) - object.playerMetas[keys2[j]] = $root.treasurehunterx.PlayerMeta.toObject(message.playerMetas[keys2[j]], options); + object.playerMetas[keys2[j]] = $root.protos.PlayerMeta.toObject(message.playerMetas[keys2[j]], options); } return object; }; @@ -3759,7 +2434,7 @@ $root.treasurehunterx = (function() { /** * Converts this RoomDownsyncFrame to JSON. * @function toJSON - * @memberof treasurehunterx.RoomDownsyncFrame + * @memberof protos.RoomDownsyncFrame * @instance * @returns {Object.} JSON object */ @@ -3767,29 +2442,14 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for RoomDownsyncFrame - * @function getTypeUrl - * @memberof treasurehunterx.RoomDownsyncFrame - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoomDownsyncFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.RoomDownsyncFrame"; - }; - return RoomDownsyncFrame; })(); - treasurehunterx.WsReq = (function() { + protos.WsReq = (function() { /** * Properties of a WsReq. - * @memberof treasurehunterx + * @memberof protos * @interface IWsReq * @property {number|null} [msgId] WsReq msgId * @property {number|null} [playerId] WsReq playerId @@ -3797,17 +2457,17 @@ $root.treasurehunterx = (function() { * @property {number|null} [joinIndex] WsReq joinIndex * @property {number|null} [ackingFrameId] WsReq ackingFrameId * @property {number|null} [ackingInputFrameId] WsReq ackingInputFrameId - * @property {Array.|null} [inputFrameUpsyncBatch] WsReq inputFrameUpsyncBatch - * @property {treasurehunterx.HeartbeatUpsync|null} [hb] WsReq hb + * @property {Array.|null} [inputFrameUpsyncBatch] WsReq inputFrameUpsyncBatch + * @property {protos.HeartbeatUpsync|null} [hb] WsReq hb */ /** * Constructs a new WsReq. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents a WsReq. * @implements IWsReq * @constructor - * @param {treasurehunterx.IWsReq=} [properties] Properties to set + * @param {protos.IWsReq=} [properties] Properties to set */ function WsReq(properties) { this.inputFrameUpsyncBatch = []; @@ -3820,7 +2480,7 @@ $root.treasurehunterx = (function() { /** * WsReq msgId. * @member {number} msgId - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @instance */ WsReq.prototype.msgId = 0; @@ -3828,7 +2488,7 @@ $root.treasurehunterx = (function() { /** * WsReq playerId. * @member {number} playerId - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @instance */ WsReq.prototype.playerId = 0; @@ -3836,7 +2496,7 @@ $root.treasurehunterx = (function() { /** * WsReq act. * @member {number} act - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @instance */ WsReq.prototype.act = 0; @@ -3844,7 +2504,7 @@ $root.treasurehunterx = (function() { /** * WsReq joinIndex. * @member {number} joinIndex - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @instance */ WsReq.prototype.joinIndex = 0; @@ -3852,7 +2512,7 @@ $root.treasurehunterx = (function() { /** * WsReq ackingFrameId. * @member {number} ackingFrameId - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @instance */ WsReq.prototype.ackingFrameId = 0; @@ -3860,23 +2520,23 @@ $root.treasurehunterx = (function() { /** * WsReq ackingInputFrameId. * @member {number} ackingInputFrameId - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @instance */ WsReq.prototype.ackingInputFrameId = 0; /** * WsReq inputFrameUpsyncBatch. - * @member {Array.} inputFrameUpsyncBatch - * @memberof treasurehunterx.WsReq + * @member {Array.} inputFrameUpsyncBatch + * @memberof protos.WsReq * @instance */ WsReq.prototype.inputFrameUpsyncBatch = $util.emptyArray; /** * WsReq hb. - * @member {treasurehunterx.HeartbeatUpsync|null|undefined} hb - * @memberof treasurehunterx.WsReq + * @member {protos.HeartbeatUpsync|null|undefined} hb + * @memberof protos.WsReq * @instance */ WsReq.prototype.hb = null; @@ -3884,53 +2544,53 @@ $root.treasurehunterx = (function() { /** * Creates a new WsReq instance using the specified properties. * @function create - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @static - * @param {treasurehunterx.IWsReq=} [properties] Properties to set - * @returns {treasurehunterx.WsReq} WsReq instance + * @param {protos.IWsReq=} [properties] Properties to set + * @returns {protos.WsReq} WsReq instance */ WsReq.create = function create(properties) { return new WsReq(properties); }; /** - * Encodes the specified WsReq message. Does not implicitly {@link treasurehunterx.WsReq.verify|verify} messages. + * Encodes the specified WsReq message. Does not implicitly {@link protos.WsReq.verify|verify} messages. * @function encode - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @static - * @param {treasurehunterx.WsReq} message WsReq message or plain object to encode + * @param {protos.WsReq} message WsReq message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WsReq.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.msgId != null && Object.hasOwnProperty.call(message, "msgId")) + if (message.msgId != null && message.hasOwnProperty("msgId")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.msgId); - if (message.playerId != null && Object.hasOwnProperty.call(message, "playerId")) + if (message.playerId != null && message.hasOwnProperty("playerId")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.playerId); - if (message.act != null && Object.hasOwnProperty.call(message, "act")) + if (message.act != null && message.hasOwnProperty("act")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.act); - if (message.joinIndex != null && Object.hasOwnProperty.call(message, "joinIndex")) + if (message.joinIndex != null && message.hasOwnProperty("joinIndex")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.joinIndex); - if (message.ackingFrameId != null && Object.hasOwnProperty.call(message, "ackingFrameId")) + if (message.ackingFrameId != null && message.hasOwnProperty("ackingFrameId")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ackingFrameId); - if (message.ackingInputFrameId != null && Object.hasOwnProperty.call(message, "ackingInputFrameId")) + if (message.ackingInputFrameId != null && message.hasOwnProperty("ackingInputFrameId")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.ackingInputFrameId); if (message.inputFrameUpsyncBatch != null && message.inputFrameUpsyncBatch.length) for (var i = 0; i < message.inputFrameUpsyncBatch.length; ++i) - $root.treasurehunterx.InputFrameUpsync.encode(message.inputFrameUpsyncBatch[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.hb != null && Object.hasOwnProperty.call(message, "hb")) - $root.treasurehunterx.HeartbeatUpsync.encode(message.hb, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.protos.InputFrameUpsync.encode(message.inputFrameUpsyncBatch[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.hb != null && message.hasOwnProperty("hb")) + $root.protos.HeartbeatUpsync.encode(message.hb, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified WsReq message, length delimited. Does not implicitly {@link treasurehunterx.WsReq.verify|verify} messages. + * Encodes the specified WsReq message, length delimited. Does not implicitly {@link protos.WsReq.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @static - * @param {treasurehunterx.WsReq} message WsReq message or plain object to encode + * @param {protos.WsReq} message WsReq message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -3941,55 +2601,47 @@ $root.treasurehunterx = (function() { /** * Decodes a WsReq message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.WsReq} WsReq + * @returns {protos.WsReq} WsReq * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WsReq.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.WsReq(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.WsReq(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.msgId = reader.int32(); - break; - } - case 2: { - message.playerId = reader.int32(); - break; - } - case 3: { - message.act = reader.int32(); - break; - } - case 4: { - message.joinIndex = reader.int32(); - break; - } - case 5: { - message.ackingFrameId = reader.int32(); - break; - } - case 6: { - message.ackingInputFrameId = reader.int32(); - break; - } - case 7: { - if (!(message.inputFrameUpsyncBatch && message.inputFrameUpsyncBatch.length)) - message.inputFrameUpsyncBatch = []; - message.inputFrameUpsyncBatch.push($root.treasurehunterx.InputFrameUpsync.decode(reader, reader.uint32())); - break; - } - case 8: { - message.hb = $root.treasurehunterx.HeartbeatUpsync.decode(reader, reader.uint32()); - break; - } + case 1: + message.msgId = reader.int32(); + break; + case 2: + message.playerId = reader.int32(); + break; + case 3: + message.act = reader.int32(); + break; + case 4: + message.joinIndex = reader.int32(); + break; + case 5: + message.ackingFrameId = reader.int32(); + break; + case 6: + message.ackingInputFrameId = reader.int32(); + break; + case 7: + if (!(message.inputFrameUpsyncBatch && message.inputFrameUpsyncBatch.length)) + message.inputFrameUpsyncBatch = []; + message.inputFrameUpsyncBatch.push($root.protos.InputFrameUpsync.decode(reader, reader.uint32())); + break; + case 8: + message.hb = $root.protos.HeartbeatUpsync.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -4001,10 +2653,10 @@ $root.treasurehunterx = (function() { /** * Decodes a WsReq message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.WsReq} WsReq + * @returns {protos.WsReq} WsReq * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -4017,7 +2669,7 @@ $root.treasurehunterx = (function() { /** * Verifies a WsReq message. * @function verify - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -4047,13 +2699,13 @@ $root.treasurehunterx = (function() { if (!Array.isArray(message.inputFrameUpsyncBatch)) return "inputFrameUpsyncBatch: array expected"; for (var i = 0; i < message.inputFrameUpsyncBatch.length; ++i) { - var error = $root.treasurehunterx.InputFrameUpsync.verify(message.inputFrameUpsyncBatch[i]); + var error = $root.protos.InputFrameUpsync.verify(message.inputFrameUpsyncBatch[i]); if (error) return "inputFrameUpsyncBatch." + error; } } if (message.hb != null && message.hasOwnProperty("hb")) { - var error = $root.treasurehunterx.HeartbeatUpsync.verify(message.hb); + var error = $root.protos.HeartbeatUpsync.verify(message.hb); if (error) return "hb." + error; } @@ -4063,15 +2715,15 @@ $root.treasurehunterx = (function() { /** * Creates a WsReq message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.WsReq} WsReq + * @returns {protos.WsReq} WsReq */ WsReq.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.WsReq) + if (object instanceof $root.protos.WsReq) return object; - var message = new $root.treasurehunterx.WsReq(); + var message = new $root.protos.WsReq(); if (object.msgId != null) message.msgId = object.msgId | 0; if (object.playerId != null) @@ -4086,18 +2738,18 @@ $root.treasurehunterx = (function() { message.ackingInputFrameId = object.ackingInputFrameId | 0; if (object.inputFrameUpsyncBatch) { if (!Array.isArray(object.inputFrameUpsyncBatch)) - throw TypeError(".treasurehunterx.WsReq.inputFrameUpsyncBatch: array expected"); + throw TypeError(".protos.WsReq.inputFrameUpsyncBatch: array expected"); message.inputFrameUpsyncBatch = []; for (var i = 0; i < object.inputFrameUpsyncBatch.length; ++i) { if (typeof object.inputFrameUpsyncBatch[i] !== "object") - throw TypeError(".treasurehunterx.WsReq.inputFrameUpsyncBatch: object expected"); - message.inputFrameUpsyncBatch[i] = $root.treasurehunterx.InputFrameUpsync.fromObject(object.inputFrameUpsyncBatch[i]); + throw TypeError(".protos.WsReq.inputFrameUpsyncBatch: object expected"); + message.inputFrameUpsyncBatch[i] = $root.protos.InputFrameUpsync.fromObject(object.inputFrameUpsyncBatch[i]); } } if (object.hb != null) { if (typeof object.hb !== "object") - throw TypeError(".treasurehunterx.WsReq.hb: object expected"); - message.hb = $root.treasurehunterx.HeartbeatUpsync.fromObject(object.hb); + throw TypeError(".protos.WsReq.hb: object expected"); + message.hb = $root.protos.HeartbeatUpsync.fromObject(object.hb); } return message; }; @@ -4105,9 +2757,9 @@ $root.treasurehunterx = (function() { /** * Creates a plain object from a WsReq message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @static - * @param {treasurehunterx.WsReq} message WsReq + * @param {protos.WsReq} message WsReq * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4141,17 +2793,17 @@ $root.treasurehunterx = (function() { if (message.inputFrameUpsyncBatch && message.inputFrameUpsyncBatch.length) { object.inputFrameUpsyncBatch = []; for (var j = 0; j < message.inputFrameUpsyncBatch.length; ++j) - object.inputFrameUpsyncBatch[j] = $root.treasurehunterx.InputFrameUpsync.toObject(message.inputFrameUpsyncBatch[j], options); + object.inputFrameUpsyncBatch[j] = $root.protos.InputFrameUpsync.toObject(message.inputFrameUpsyncBatch[j], options); } if (message.hb != null && message.hasOwnProperty("hb")) - object.hb = $root.treasurehunterx.HeartbeatUpsync.toObject(message.hb, options); + object.hb = $root.protos.HeartbeatUpsync.toObject(message.hb, options); return object; }; /** * Converts this WsReq to JSON. * @function toJSON - * @memberof treasurehunterx.WsReq + * @memberof protos.WsReq * @instance * @returns {Object.} JSON object */ @@ -4159,45 +2811,30 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for WsReq - * @function getTypeUrl - * @memberof treasurehunterx.WsReq - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WsReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.WsReq"; - }; - return WsReq; })(); - treasurehunterx.WsResp = (function() { + protos.WsResp = (function() { /** * Properties of a WsResp. - * @memberof treasurehunterx + * @memberof protos * @interface IWsResp * @property {number|null} [ret] WsResp ret * @property {number|null} [echoedMsgId] WsResp echoedMsgId * @property {number|null} [act] WsResp act - * @property {treasurehunterx.RoomDownsyncFrame|null} [rdf] WsResp rdf - * @property {Array.|null} [inputFrameDownsyncBatch] WsResp inputFrameDownsyncBatch - * @property {treasurehunterx.BattleColliderInfo|null} [bciFrame] WsResp bciFrame + * @property {protos.RoomDownsyncFrame|null} [rdf] WsResp rdf + * @property {Array.|null} [inputFrameDownsyncBatch] WsResp inputFrameDownsyncBatch + * @property {protos.BattleColliderInfo|null} [bciFrame] WsResp bciFrame */ /** * Constructs a new WsResp. - * @memberof treasurehunterx + * @memberof protos * @classdesc Represents a WsResp. * @implements IWsResp * @constructor - * @param {treasurehunterx.IWsResp=} [properties] Properties to set + * @param {protos.IWsResp=} [properties] Properties to set */ function WsResp(properties) { this.inputFrameDownsyncBatch = []; @@ -4210,7 +2847,7 @@ $root.treasurehunterx = (function() { /** * WsResp ret. * @member {number} ret - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @instance */ WsResp.prototype.ret = 0; @@ -4218,7 +2855,7 @@ $root.treasurehunterx = (function() { /** * WsResp echoedMsgId. * @member {number} echoedMsgId - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @instance */ WsResp.prototype.echoedMsgId = 0; @@ -4226,31 +2863,31 @@ $root.treasurehunterx = (function() { /** * WsResp act. * @member {number} act - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @instance */ WsResp.prototype.act = 0; /** * WsResp rdf. - * @member {treasurehunterx.RoomDownsyncFrame|null|undefined} rdf - * @memberof treasurehunterx.WsResp + * @member {protos.RoomDownsyncFrame|null|undefined} rdf + * @memberof protos.WsResp * @instance */ WsResp.prototype.rdf = null; /** * WsResp inputFrameDownsyncBatch. - * @member {Array.} inputFrameDownsyncBatch - * @memberof treasurehunterx.WsResp + * @member {Array.} inputFrameDownsyncBatch + * @memberof protos.WsResp * @instance */ WsResp.prototype.inputFrameDownsyncBatch = $util.emptyArray; /** * WsResp bciFrame. - * @member {treasurehunterx.BattleColliderInfo|null|undefined} bciFrame - * @memberof treasurehunterx.WsResp + * @member {protos.BattleColliderInfo|null|undefined} bciFrame + * @memberof protos.WsResp * @instance */ WsResp.prototype.bciFrame = null; @@ -4258,49 +2895,49 @@ $root.treasurehunterx = (function() { /** * Creates a new WsResp instance using the specified properties. * @function create - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @static - * @param {treasurehunterx.IWsResp=} [properties] Properties to set - * @returns {treasurehunterx.WsResp} WsResp instance + * @param {protos.IWsResp=} [properties] Properties to set + * @returns {protos.WsResp} WsResp instance */ WsResp.create = function create(properties) { return new WsResp(properties); }; /** - * Encodes the specified WsResp message. Does not implicitly {@link treasurehunterx.WsResp.verify|verify} messages. + * Encodes the specified WsResp message. Does not implicitly {@link protos.WsResp.verify|verify} messages. * @function encode - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @static - * @param {treasurehunterx.WsResp} message WsResp message or plain object to encode + * @param {protos.WsResp} message WsResp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WsResp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ret != null && Object.hasOwnProperty.call(message, "ret")) + if (message.ret != null && message.hasOwnProperty("ret")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ret); - if (message.echoedMsgId != null && Object.hasOwnProperty.call(message, "echoedMsgId")) + if (message.echoedMsgId != null && message.hasOwnProperty("echoedMsgId")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.echoedMsgId); - if (message.act != null && Object.hasOwnProperty.call(message, "act")) + if (message.act != null && message.hasOwnProperty("act")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.act); - if (message.rdf != null && Object.hasOwnProperty.call(message, "rdf")) - $root.treasurehunterx.RoomDownsyncFrame.encode(message.rdf, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rdf != null && message.hasOwnProperty("rdf")) + $root.protos.RoomDownsyncFrame.encode(message.rdf, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.inputFrameDownsyncBatch != null && message.inputFrameDownsyncBatch.length) for (var i = 0; i < message.inputFrameDownsyncBatch.length; ++i) - $root.treasurehunterx.InputFrameDownsync.encode(message.inputFrameDownsyncBatch[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.bciFrame != null && Object.hasOwnProperty.call(message, "bciFrame")) - $root.treasurehunterx.BattleColliderInfo.encode(message.bciFrame, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.protos.InputFrameDownsync.encode(message.inputFrameDownsyncBatch[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.bciFrame != null && message.hasOwnProperty("bciFrame")) + $root.protos.BattleColliderInfo.encode(message.bciFrame, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified WsResp message, length delimited. Does not implicitly {@link treasurehunterx.WsResp.verify|verify} messages. + * Encodes the specified WsResp message, length delimited. Does not implicitly {@link protos.WsResp.verify|verify} messages. * @function encodeDelimited - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @static - * @param {treasurehunterx.WsResp} message WsResp message or plain object to encode + * @param {protos.WsResp} message WsResp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4311,47 +2948,41 @@ $root.treasurehunterx = (function() { /** * Decodes a WsResp message from the specified reader or buffer. * @function decode - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {treasurehunterx.WsResp} WsResp + * @returns {protos.WsResp} WsResp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WsResp.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.WsResp(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.WsResp(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.ret = reader.int32(); - break; - } - case 2: { - message.echoedMsgId = reader.int32(); - break; - } - case 3: { - message.act = reader.int32(); - break; - } - case 4: { - message.rdf = $root.treasurehunterx.RoomDownsyncFrame.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.inputFrameDownsyncBatch && message.inputFrameDownsyncBatch.length)) - message.inputFrameDownsyncBatch = []; - message.inputFrameDownsyncBatch.push($root.treasurehunterx.InputFrameDownsync.decode(reader, reader.uint32())); - break; - } - case 6: { - message.bciFrame = $root.treasurehunterx.BattleColliderInfo.decode(reader, reader.uint32()); - break; - } + case 1: + message.ret = reader.int32(); + break; + case 2: + message.echoedMsgId = reader.int32(); + break; + case 3: + message.act = reader.int32(); + break; + case 4: + message.rdf = $root.protos.RoomDownsyncFrame.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.inputFrameDownsyncBatch && message.inputFrameDownsyncBatch.length)) + message.inputFrameDownsyncBatch = []; + message.inputFrameDownsyncBatch.push($root.protos.InputFrameDownsync.decode(reader, reader.uint32())); + break; + case 6: + message.bciFrame = $root.protos.BattleColliderInfo.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -4363,10 +2994,10 @@ $root.treasurehunterx = (function() { /** * Decodes a WsResp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {treasurehunterx.WsResp} WsResp + * @returns {protos.WsResp} WsResp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -4379,7 +3010,7 @@ $root.treasurehunterx = (function() { /** * Verifies a WsResp message. * @function verify - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -4397,7 +3028,7 @@ $root.treasurehunterx = (function() { if (!$util.isInteger(message.act)) return "act: integer expected"; if (message.rdf != null && message.hasOwnProperty("rdf")) { - var error = $root.treasurehunterx.RoomDownsyncFrame.verify(message.rdf); + var error = $root.protos.RoomDownsyncFrame.verify(message.rdf); if (error) return "rdf." + error; } @@ -4405,13 +3036,13 @@ $root.treasurehunterx = (function() { if (!Array.isArray(message.inputFrameDownsyncBatch)) return "inputFrameDownsyncBatch: array expected"; for (var i = 0; i < message.inputFrameDownsyncBatch.length; ++i) { - var error = $root.treasurehunterx.InputFrameDownsync.verify(message.inputFrameDownsyncBatch[i]); + var error = $root.protos.InputFrameDownsync.verify(message.inputFrameDownsyncBatch[i]); if (error) return "inputFrameDownsyncBatch." + error; } } if (message.bciFrame != null && message.hasOwnProperty("bciFrame")) { - var error = $root.treasurehunterx.BattleColliderInfo.verify(message.bciFrame); + var error = $root.protos.BattleColliderInfo.verify(message.bciFrame); if (error) return "bciFrame." + error; } @@ -4421,15 +3052,15 @@ $root.treasurehunterx = (function() { /** * Creates a WsResp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @static * @param {Object.} object Plain object - * @returns {treasurehunterx.WsResp} WsResp + * @returns {protos.WsResp} WsResp */ WsResp.fromObject = function fromObject(object) { - if (object instanceof $root.treasurehunterx.WsResp) + if (object instanceof $root.protos.WsResp) return object; - var message = new $root.treasurehunterx.WsResp(); + var message = new $root.protos.WsResp(); if (object.ret != null) message.ret = object.ret | 0; if (object.echoedMsgId != null) @@ -4438,23 +3069,23 @@ $root.treasurehunterx = (function() { message.act = object.act | 0; if (object.rdf != null) { if (typeof object.rdf !== "object") - throw TypeError(".treasurehunterx.WsResp.rdf: object expected"); - message.rdf = $root.treasurehunterx.RoomDownsyncFrame.fromObject(object.rdf); + throw TypeError(".protos.WsResp.rdf: object expected"); + message.rdf = $root.protos.RoomDownsyncFrame.fromObject(object.rdf); } if (object.inputFrameDownsyncBatch) { if (!Array.isArray(object.inputFrameDownsyncBatch)) - throw TypeError(".treasurehunterx.WsResp.inputFrameDownsyncBatch: array expected"); + throw TypeError(".protos.WsResp.inputFrameDownsyncBatch: array expected"); message.inputFrameDownsyncBatch = []; for (var i = 0; i < object.inputFrameDownsyncBatch.length; ++i) { if (typeof object.inputFrameDownsyncBatch[i] !== "object") - throw TypeError(".treasurehunterx.WsResp.inputFrameDownsyncBatch: object expected"); - message.inputFrameDownsyncBatch[i] = $root.treasurehunterx.InputFrameDownsync.fromObject(object.inputFrameDownsyncBatch[i]); + throw TypeError(".protos.WsResp.inputFrameDownsyncBatch: object expected"); + message.inputFrameDownsyncBatch[i] = $root.protos.InputFrameDownsync.fromObject(object.inputFrameDownsyncBatch[i]); } } if (object.bciFrame != null) { if (typeof object.bciFrame !== "object") - throw TypeError(".treasurehunterx.WsResp.bciFrame: object expected"); - message.bciFrame = $root.treasurehunterx.BattleColliderInfo.fromObject(object.bciFrame); + throw TypeError(".protos.WsResp.bciFrame: object expected"); + message.bciFrame = $root.protos.BattleColliderInfo.fromObject(object.bciFrame); } return message; }; @@ -4462,9 +3093,9 @@ $root.treasurehunterx = (function() { /** * Creates a plain object from a WsResp message. Also converts values to other types if specified. * @function toObject - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @static - * @param {treasurehunterx.WsResp} message WsResp + * @param {protos.WsResp} message WsResp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4488,21 +3119,21 @@ $root.treasurehunterx = (function() { if (message.act != null && message.hasOwnProperty("act")) object.act = message.act; if (message.rdf != null && message.hasOwnProperty("rdf")) - object.rdf = $root.treasurehunterx.RoomDownsyncFrame.toObject(message.rdf, options); + object.rdf = $root.protos.RoomDownsyncFrame.toObject(message.rdf, options); if (message.inputFrameDownsyncBatch && message.inputFrameDownsyncBatch.length) { object.inputFrameDownsyncBatch = []; for (var j = 0; j < message.inputFrameDownsyncBatch.length; ++j) - object.inputFrameDownsyncBatch[j] = $root.treasurehunterx.InputFrameDownsync.toObject(message.inputFrameDownsyncBatch[j], options); + object.inputFrameDownsyncBatch[j] = $root.protos.InputFrameDownsync.toObject(message.inputFrameDownsyncBatch[j], options); } if (message.bciFrame != null && message.hasOwnProperty("bciFrame")) - object.bciFrame = $root.treasurehunterx.BattleColliderInfo.toObject(message.bciFrame, options); + object.bciFrame = $root.protos.BattleColliderInfo.toObject(message.bciFrame, options); return object; }; /** * Converts this WsResp to JSON. * @function toJSON - * @memberof treasurehunterx.WsResp + * @memberof protos.WsResp * @instance * @returns {Object.} JSON object */ @@ -4510,25 +3141,1082 @@ $root.treasurehunterx = (function() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for WsResp - * @function getTypeUrl - * @memberof treasurehunterx.WsResp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WsResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/treasurehunterx.WsResp"; - }; - return WsResp; })(); - return treasurehunterx; + protos.Direction = (function() { + + /** + * Properties of a Direction. + * @memberof protos + * @interface IDirection + * @property {number|null} [dx] Direction dx + * @property {number|null} [dy] Direction dy + */ + + /** + * Constructs a new Direction. + * @memberof protos + * @classdesc Represents a Direction. + * @implements IDirection + * @constructor + * @param {protos.IDirection=} [properties] Properties to set + */ + function Direction(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]]; + } + + /** + * Direction dx. + * @member {number} dx + * @memberof protos.Direction + * @instance + */ + Direction.prototype.dx = 0; + + /** + * Direction dy. + * @member {number} dy + * @memberof protos.Direction + * @instance + */ + Direction.prototype.dy = 0; + + /** + * Creates a new Direction instance using the specified properties. + * @function create + * @memberof protos.Direction + * @static + * @param {protos.IDirection=} [properties] Properties to set + * @returns {protos.Direction} Direction instance + */ + Direction.create = function create(properties) { + return new Direction(properties); + }; + + /** + * Encodes the specified Direction message. Does not implicitly {@link protos.Direction.verify|verify} messages. + * @function encode + * @memberof protos.Direction + * @static + * @param {protos.Direction} message Direction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Direction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dx != null && message.hasOwnProperty("dx")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dx); + if (message.dy != null && message.hasOwnProperty("dy")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dy); + return writer; + }; + + /** + * Encodes the specified Direction message, length delimited. Does not implicitly {@link protos.Direction.verify|verify} messages. + * @function encodeDelimited + * @memberof protos.Direction + * @static + * @param {protos.Direction} message Direction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Direction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Direction message from the specified reader or buffer. + * @function decode + * @memberof protos.Direction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {protos.Direction} Direction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Direction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.Direction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dx = reader.int32(); + break; + case 2: + message.dy = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Direction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof protos.Direction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {protos.Direction} Direction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Direction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Direction message. + * @function verify + * @memberof protos.Direction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Direction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dx != null && message.hasOwnProperty("dx")) + if (!$util.isInteger(message.dx)) + return "dx: integer expected"; + if (message.dy != null && message.hasOwnProperty("dy")) + if (!$util.isInteger(message.dy)) + return "dy: integer expected"; + return null; + }; + + /** + * Creates a Direction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof protos.Direction + * @static + * @param {Object.} object Plain object + * @returns {protos.Direction} Direction + */ + Direction.fromObject = function fromObject(object) { + if (object instanceof $root.protos.Direction) + return object; + var message = new $root.protos.Direction(); + if (object.dx != null) + message.dx = object.dx | 0; + if (object.dy != null) + message.dy = object.dy | 0; + return message; + }; + + /** + * Creates a plain object from a Direction message. Also converts values to other types if specified. + * @function toObject + * @memberof protos.Direction + * @static + * @param {protos.Direction} message Direction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Direction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dx = 0; + object.dy = 0; + } + if (message.dx != null && message.hasOwnProperty("dx")) + object.dx = message.dx; + if (message.dy != null && message.hasOwnProperty("dy")) + object.dy = message.dy; + return object; + }; + + /** + * Converts this Direction to JSON. + * @function toJSON + * @memberof protos.Direction + * @instance + * @returns {Object.} JSON object + */ + Direction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Direction; + })(); + + protos.Vec2D = (function() { + + /** + * Properties of a Vec2D. + * @memberof protos + * @interface IVec2D + * @property {number|null} [x] Vec2D x + * @property {number|null} [y] Vec2D y + */ + + /** + * Constructs a new Vec2D. + * @memberof protos + * @classdesc Represents a Vec2D. + * @implements IVec2D + * @constructor + * @param {protos.IVec2D=} [properties] Properties to set + */ + function Vec2D(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]]; + } + + /** + * Vec2D x. + * @member {number} x + * @memberof protos.Vec2D + * @instance + */ + Vec2D.prototype.x = 0; + + /** + * Vec2D y. + * @member {number} y + * @memberof protos.Vec2D + * @instance + */ + Vec2D.prototype.y = 0; + + /** + * Creates a new Vec2D instance using the specified properties. + * @function create + * @memberof protos.Vec2D + * @static + * @param {protos.IVec2D=} [properties] Properties to set + * @returns {protos.Vec2D} Vec2D instance + */ + Vec2D.create = function create(properties) { + return new Vec2D(properties); + }; + + /** + * Encodes the specified Vec2D message. Does not implicitly {@link protos.Vec2D.verify|verify} messages. + * @function encode + * @memberof protos.Vec2D + * @static + * @param {protos.Vec2D} message Vec2D message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vec2D.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && message.hasOwnProperty("x")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.x); + if (message.y != null && message.hasOwnProperty("y")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.y); + return writer; + }; + + /** + * Encodes the specified Vec2D message, length delimited. Does not implicitly {@link protos.Vec2D.verify|verify} messages. + * @function encodeDelimited + * @memberof protos.Vec2D + * @static + * @param {protos.Vec2D} message Vec2D message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vec2D.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vec2D message from the specified reader or buffer. + * @function decode + * @memberof protos.Vec2D + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {protos.Vec2D} Vec2D + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vec2D.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.Vec2D(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = reader.double(); + break; + case 2: + message.y = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vec2D message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof protos.Vec2D + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {protos.Vec2D} Vec2D + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vec2D.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vec2D message. + * @function verify + * @memberof protos.Vec2D + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vec2D.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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"; + return null; + }; + + /** + * Creates a Vec2D message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof protos.Vec2D + * @static + * @param {Object.} object Plain object + * @returns {protos.Vec2D} Vec2D + */ + Vec2D.fromObject = function fromObject(object) { + if (object instanceof $root.protos.Vec2D) + return object; + var message = new $root.protos.Vec2D(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; + + /** + * Creates a plain object from a Vec2D message. Also converts values to other types if specified. + * @function toObject + * @memberof protos.Vec2D + * @static + * @param {protos.Vec2D} message Vec2D + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vec2D.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + 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; + return object; + }; + + /** + * Converts this Vec2D to JSON. + * @function toJSON + * @memberof protos.Vec2D + * @instance + * @returns {Object.} JSON object + */ + Vec2D.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vec2D; + })(); + + protos.Polygon2D = (function() { + + /** + * Properties of a Polygon2D. + * @memberof protos + * @interface IPolygon2D + * @property {protos.Vec2D|null} [anchor] Polygon2D anchor + * @property {Array.|null} [points] Polygon2D points + */ + + /** + * Constructs a new Polygon2D. + * @memberof protos + * @classdesc Represents a Polygon2D. + * @implements IPolygon2D + * @constructor + * @param {protos.IPolygon2D=} [properties] Properties to set + */ + function Polygon2D(properties) { + this.points = []; + 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]]; + } + + /** + * Polygon2D anchor. + * @member {protos.Vec2D|null|undefined} anchor + * @memberof protos.Polygon2D + * @instance + */ + Polygon2D.prototype.anchor = null; + + /** + * Polygon2D points. + * @member {Array.} points + * @memberof protos.Polygon2D + * @instance + */ + Polygon2D.prototype.points = $util.emptyArray; + + /** + * Creates a new Polygon2D instance using the specified properties. + * @function create + * @memberof protos.Polygon2D + * @static + * @param {protos.IPolygon2D=} [properties] Properties to set + * @returns {protos.Polygon2D} Polygon2D instance + */ + Polygon2D.create = function create(properties) { + return new Polygon2D(properties); + }; + + /** + * Encodes the specified Polygon2D message. Does not implicitly {@link protos.Polygon2D.verify|verify} messages. + * @function encode + * @memberof protos.Polygon2D + * @static + * @param {protos.Polygon2D} message Polygon2D message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polygon2D.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.anchor != null && message.hasOwnProperty("anchor")) + $root.protos.Vec2D.encode(message.anchor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.points != null && message.points.length) + for (var i = 0; i < message.points.length; ++i) + $root.protos.Vec2D.encode(message.points[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Polygon2D message, length delimited. Does not implicitly {@link protos.Polygon2D.verify|verify} messages. + * @function encodeDelimited + * @memberof protos.Polygon2D + * @static + * @param {protos.Polygon2D} message Polygon2D message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polygon2D.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Polygon2D message from the specified reader or buffer. + * @function decode + * @memberof protos.Polygon2D + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {protos.Polygon2D} Polygon2D + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polygon2D.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.Polygon2D(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.anchor = $root.protos.Vec2D.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.points && message.points.length)) + message.points = []; + message.points.push($root.protos.Vec2D.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Polygon2D message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof protos.Polygon2D + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {protos.Polygon2D} Polygon2D + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polygon2D.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Polygon2D message. + * @function verify + * @memberof protos.Polygon2D + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Polygon2D.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.anchor != null && message.hasOwnProperty("anchor")) { + var error = $root.protos.Vec2D.verify(message.anchor); + if (error) + return "anchor." + error; + } + if (message.points != null && message.hasOwnProperty("points")) { + if (!Array.isArray(message.points)) + return "points: array expected"; + for (var i = 0; i < message.points.length; ++i) { + var error = $root.protos.Vec2D.verify(message.points[i]); + if (error) + return "points." + error; + } + } + return null; + }; + + /** + * Creates a Polygon2D message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof protos.Polygon2D + * @static + * @param {Object.} object Plain object + * @returns {protos.Polygon2D} Polygon2D + */ + Polygon2D.fromObject = function fromObject(object) { + if (object instanceof $root.protos.Polygon2D) + return object; + var message = new $root.protos.Polygon2D(); + if (object.anchor != null) { + if (typeof object.anchor !== "object") + throw TypeError(".protos.Polygon2D.anchor: object expected"); + message.anchor = $root.protos.Vec2D.fromObject(object.anchor); + } + if (object.points) { + if (!Array.isArray(object.points)) + throw TypeError(".protos.Polygon2D.points: array expected"); + message.points = []; + for (var i = 0; i < object.points.length; ++i) { + if (typeof object.points[i] !== "object") + throw TypeError(".protos.Polygon2D.points: object expected"); + message.points[i] = $root.protos.Vec2D.fromObject(object.points[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Polygon2D message. Also converts values to other types if specified. + * @function toObject + * @memberof protos.Polygon2D + * @static + * @param {protos.Polygon2D} message Polygon2D + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Polygon2D.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.points = []; + if (options.defaults) + object.anchor = null; + if (message.anchor != null && message.hasOwnProperty("anchor")) + object.anchor = $root.protos.Vec2D.toObject(message.anchor, options); + if (message.points && message.points.length) { + object.points = []; + for (var j = 0; j < message.points.length; ++j) + object.points[j] = $root.protos.Vec2D.toObject(message.points[j], options); + } + return object; + }; + + /** + * Converts this Polygon2D to JSON. + * @function toJSON + * @memberof protos.Polygon2D + * @instance + * @returns {Object.} JSON object + */ + Polygon2D.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Polygon2D; + })(); + + protos.Vec2DList = (function() { + + /** + * Properties of a Vec2DList. + * @memberof protos + * @interface IVec2DList + * @property {Array.|null} [eles] Vec2DList eles + */ + + /** + * Constructs a new Vec2DList. + * @memberof protos + * @classdesc Represents a Vec2DList. + * @implements IVec2DList + * @constructor + * @param {protos.IVec2DList=} [properties] Properties to set + */ + function Vec2DList(properties) { + this.eles = []; + 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]]; + } + + /** + * Vec2DList eles. + * @member {Array.} eles + * @memberof protos.Vec2DList + * @instance + */ + Vec2DList.prototype.eles = $util.emptyArray; + + /** + * Creates a new Vec2DList instance using the specified properties. + * @function create + * @memberof protos.Vec2DList + * @static + * @param {protos.IVec2DList=} [properties] Properties to set + * @returns {protos.Vec2DList} Vec2DList instance + */ + Vec2DList.create = function create(properties) { + return new Vec2DList(properties); + }; + + /** + * Encodes the specified Vec2DList message. Does not implicitly {@link protos.Vec2DList.verify|verify} messages. + * @function encode + * @memberof protos.Vec2DList + * @static + * @param {protos.Vec2DList} message Vec2DList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vec2DList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eles != null && message.eles.length) + for (var i = 0; i < message.eles.length; ++i) + $root.protos.Vec2D.encode(message.eles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Vec2DList message, length delimited. Does not implicitly {@link protos.Vec2DList.verify|verify} messages. + * @function encodeDelimited + * @memberof protos.Vec2DList + * @static + * @param {protos.Vec2DList} message Vec2DList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vec2DList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vec2DList message from the specified reader or buffer. + * @function decode + * @memberof protos.Vec2DList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {protos.Vec2DList} Vec2DList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vec2DList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.Vec2DList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.eles && message.eles.length)) + message.eles = []; + message.eles.push($root.protos.Vec2D.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vec2DList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof protos.Vec2DList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {protos.Vec2DList} Vec2DList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vec2DList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vec2DList message. + * @function verify + * @memberof protos.Vec2DList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vec2DList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eles != null && message.hasOwnProperty("eles")) { + if (!Array.isArray(message.eles)) + return "eles: array expected"; + for (var i = 0; i < message.eles.length; ++i) { + var error = $root.protos.Vec2D.verify(message.eles[i]); + if (error) + return "eles." + error; + } + } + return null; + }; + + /** + * Creates a Vec2DList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof protos.Vec2DList + * @static + * @param {Object.} object Plain object + * @returns {protos.Vec2DList} Vec2DList + */ + Vec2DList.fromObject = function fromObject(object) { + if (object instanceof $root.protos.Vec2DList) + return object; + var message = new $root.protos.Vec2DList(); + if (object.eles) { + if (!Array.isArray(object.eles)) + throw TypeError(".protos.Vec2DList.eles: array expected"); + message.eles = []; + for (var i = 0; i < object.eles.length; ++i) { + if (typeof object.eles[i] !== "object") + throw TypeError(".protos.Vec2DList.eles: object expected"); + message.eles[i] = $root.protos.Vec2D.fromObject(object.eles[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Vec2DList message. Also converts values to other types if specified. + * @function toObject + * @memberof protos.Vec2DList + * @static + * @param {protos.Vec2DList} message Vec2DList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vec2DList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.eles = []; + if (message.eles && message.eles.length) { + object.eles = []; + for (var j = 0; j < message.eles.length; ++j) + object.eles[j] = $root.protos.Vec2D.toObject(message.eles[j], options); + } + return object; + }; + + /** + * Converts this Vec2DList to JSON. + * @function toJSON + * @memberof protos.Vec2DList + * @instance + * @returns {Object.} JSON object + */ + Vec2DList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vec2DList; + })(); + + protos.Polygon2DList = (function() { + + /** + * Properties of a Polygon2DList. + * @memberof protos + * @interface IPolygon2DList + * @property {Array.|null} [eles] Polygon2DList eles + */ + + /** + * Constructs a new Polygon2DList. + * @memberof protos + * @classdesc Represents a Polygon2DList. + * @implements IPolygon2DList + * @constructor + * @param {protos.IPolygon2DList=} [properties] Properties to set + */ + function Polygon2DList(properties) { + this.eles = []; + 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]]; + } + + /** + * Polygon2DList eles. + * @member {Array.} eles + * @memberof protos.Polygon2DList + * @instance + */ + Polygon2DList.prototype.eles = $util.emptyArray; + + /** + * Creates a new Polygon2DList instance using the specified properties. + * @function create + * @memberof protos.Polygon2DList + * @static + * @param {protos.IPolygon2DList=} [properties] Properties to set + * @returns {protos.Polygon2DList} Polygon2DList instance + */ + Polygon2DList.create = function create(properties) { + return new Polygon2DList(properties); + }; + + /** + * Encodes the specified Polygon2DList message. Does not implicitly {@link protos.Polygon2DList.verify|verify} messages. + * @function encode + * @memberof protos.Polygon2DList + * @static + * @param {protos.Polygon2DList} message Polygon2DList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polygon2DList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eles != null && message.eles.length) + for (var i = 0; i < message.eles.length; ++i) + $root.protos.Polygon2D.encode(message.eles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Polygon2DList message, length delimited. Does not implicitly {@link protos.Polygon2DList.verify|verify} messages. + * @function encodeDelimited + * @memberof protos.Polygon2DList + * @static + * @param {protos.Polygon2DList} message Polygon2DList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polygon2DList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Polygon2DList message from the specified reader or buffer. + * @function decode + * @memberof protos.Polygon2DList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {protos.Polygon2DList} Polygon2DList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polygon2DList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.Polygon2DList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.eles && message.eles.length)) + message.eles = []; + message.eles.push($root.protos.Polygon2D.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Polygon2DList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof protos.Polygon2DList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {protos.Polygon2DList} Polygon2DList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polygon2DList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Polygon2DList message. + * @function verify + * @memberof protos.Polygon2DList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Polygon2DList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.eles != null && message.hasOwnProperty("eles")) { + if (!Array.isArray(message.eles)) + return "eles: array expected"; + for (var i = 0; i < message.eles.length; ++i) { + var error = $root.protos.Polygon2D.verify(message.eles[i]); + if (error) + return "eles." + error; + } + } + return null; + }; + + /** + * Creates a Polygon2DList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof protos.Polygon2DList + * @static + * @param {Object.} object Plain object + * @returns {protos.Polygon2DList} Polygon2DList + */ + Polygon2DList.fromObject = function fromObject(object) { + if (object instanceof $root.protos.Polygon2DList) + return object; + var message = new $root.protos.Polygon2DList(); + if (object.eles) { + if (!Array.isArray(object.eles)) + throw TypeError(".protos.Polygon2DList.eles: array expected"); + message.eles = []; + for (var i = 0; i < object.eles.length; ++i) { + if (typeof object.eles[i] !== "object") + throw TypeError(".protos.Polygon2DList.eles: object expected"); + message.eles[i] = $root.protos.Polygon2D.fromObject(object.eles[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Polygon2DList message. Also converts values to other types if specified. + * @function toObject + * @memberof protos.Polygon2DList + * @static + * @param {protos.Polygon2DList} message Polygon2DList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Polygon2DList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.eles = []; + if (message.eles && message.eles.length) { + object.eles = []; + for (var j = 0; j < message.eles.length; ++j) + object.eles[j] = $root.protos.Polygon2D.toObject(message.eles[j], options); + } + return object; + }; + + /** + * Converts this Polygon2DList to JSON. + * @function toJSON + * @memberof protos.Polygon2DList + * @instance + * @returns {Object.} JSON object + */ + Polygon2DList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Polygon2DList; + })(); + + return protos; })(); module.exports = $root; diff --git a/proto_gen_shortcut.sh b/proto_gen_shortcut.sh index 1b50446..a6b52ec 100644 --- a/proto_gen_shortcut.sh +++ b/proto_gen_shortcut.sh @@ -2,11 +2,16 @@ # GOLANG part # You have to download the OS binary "protoc" from `https://developers.google.com/protocol-buffers/docs/downloads` and set it to $PATH appropriately. -# You have to install `proto-gen-go` by `go get -u github.com/golang/protobuf/protoc-gen-go` as instructed in https://developers.google.com/protocol-buffers/docs/gotutorial too. +# You have to install `proto-gen-go` by `go install google.golang.org/protobuf/cmd/protoc-gen-go@latest` as instructed in https://developers.google.com/protocol-buffers/docs/gotutorial#compiling-your-protocol-buffers too. -golang_basedir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/battle_srv -mkdir -p $golang_basedir/pb_output -protoc -I=$golang_basedir/../frontend/assets/resources/pbfiles/ --go_out=$golang_basedir/pb_output room_downsync_frame.proto +golang_basedir_1=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/dnmshared +protoc -I=$golang_basedir_1/../frontend/assets/resources/pbfiles/ --go_out=. geometry.proto +echo "GOLANG part 1 done" + +# [WARNING] The following "room_downsync_frame.proto" is generated in another Go package than "geometry.proto", but the generated Go codes are also required to work with imports correctly! +golang_basedir_2=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/battle_srv +protoc -I=$golang_basedir_2/../frontend/assets/resources/pbfiles/ --go_out=. room_downsync_frame.proto +echo "GOLANG part 2 done" # JS part js_basedir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/frontend @@ -19,4 +24,4 @@ js_outdir=$js_basedir/assets/scripts/modules # The specific filename is respected by "frontend/build-templates/wechatgame/game.js". pbjs -t static-module -w commonjs --keep-case --force-message -o $js_outdir/room_downsync_frame_proto_bundle.forcemsg.js $js_basedir/assets/resources/pbfiles/room_downsync_frame.proto -sed -i 's#require("protobufjs/minimal")#require("./protobuf-with-floating-num-decoding-endianess-toggle")#g' $js_outdir/room_downsync_frame_proto_bundle.forcemsg.js +echo "JavaScript part done"