diff --git a/battle_srv/models/pb_type_convert.go b/battle_srv/models/pb_type_convert.go index a5576dd..439c5b8 100644 --- a/battle_srv/models/pb_type_convert.go +++ b/battle_srv/models/pb_type_convert.go @@ -10,12 +10,13 @@ func toPbRoomDownsyncFrame(rdf *battle.RoomDownsyncFrame) *pb.RoomDownsyncFrame return nil } ret := &pb.RoomDownsyncFrame{ - Id: rdf.Id, - PlayersArr: make([]*pb.PlayerDownsync, len(rdf.PlayersArr), len(rdf.PlayersArr)), - MeleeBullets: make([]*pb.MeleeBullet, len(rdf.MeleeBullets), len(rdf.MeleeBullets)), - CountdownNanos: rdf.CountdownNanos, - BackendUnconfirmedMask: rdf.BackendUnconfirmedMask, - ShouldForceResync: rdf.ShouldForceResync, + Id: rdf.Id, + PlayersArr: make([]*pb.PlayerDownsync, len(rdf.PlayersArr), len(rdf.PlayersArr)), + MeleeBullets: make([]*pb.MeleeBullet, len(rdf.MeleeBullets), len(rdf.MeleeBullets)), + CountdownNanos: rdf.CountdownNanos, + BackendUnconfirmedMask: rdf.BackendUnconfirmedMask, + ShouldForceResync: rdf.ShouldForceResync, + PlayerOpPatternToSkillId: make(map[int32]int32), } for i, last := range rdf.PlayersArr { @@ -65,6 +66,10 @@ func toPbRoomDownsyncFrame(rdf *battle.RoomDownsyncFrame) *pb.RoomDownsyncFrame ret.MeleeBullets[i] = pbBullet } + for i, last := range rdf.PlayerOpPatternToSkillId { + ret.PlayerOpPatternToSkillId[int32(i)] = int32(last) + } + return ret } diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index 38bc947..c5aa3a3 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -88,14 +88,15 @@ func calRoomScore(inRoomPlayerCount int32, roomPlayerCnt int, currentRoomBattleS } type Room struct { - Id int32 - Capacity int - collisionSpaceOffsetX float64 - collisionSpaceOffsetY float64 - Players map[int32]*Player - PlayersArr []*Player // ordered by joinIndex - Space *resolv.Space - CollisionSysMap map[int32]*resolv.Object + Id int32 + Capacity int + collisionSpaceOffsetX float64 + collisionSpaceOffsetY float64 + playerOpPatternToSkillId map[int]int + Players map[int32]*Player + PlayersArr []*Player // ordered by joinIndex + Space *resolv.Space + CollisionSysMap map[int32]*resolv.Object /** * The following `PlayerDownsyncSessionDict` is NOT individually put * under `type Player struct` for a reason. @@ -125,9 +126,9 @@ type Room struct { CurDynamicsRenderFrameId int32 // [WARNING] The dynamics of backend is ALWAYS MOVING FORWARD BY ALL-CONFIRMED INPUTFRAMES (either by upsync or forced), i.e. no rollback; Moreover when "true == BackendDynamicsEnabled" we always have "Room.CurDynamicsRenderFrameId >= Room.RenderFrameId" because each "all-confirmed inputFrame" is applied on "all applicable renderFrames" in one-go hence often sees a future "renderFrame" earlier EffectivePlayerCount int32 DismissalWaitGroup sync.WaitGroup - InputsBuffer *RingBuffer // Indices are STRICTLY consecutive - InputsBufferLock sync.Mutex // Guards [InputsBuffer, LatestPlayerUpsyncedInputFrameId, LastAllConfirmedInputFrameId, LastAllConfirmedInputList, LastAllConfirmedInputFrameIdWithChange] - RenderFrameBuffer *RingBuffer // Indices are STRICTLY consecutive + InputsBuffer *battle.RingBuffer // Indices are STRICTLY consecutive + InputsBufferLock sync.Mutex // Guards [InputsBuffer, LatestPlayerUpsyncedInputFrameId, LastAllConfirmedInputFrameId, LastAllConfirmedInputList, LastAllConfirmedInputFrameIdWithChange] + RenderFrameBuffer *battle.RingBuffer // Indices are STRICTLY consecutive LatestPlayerUpsyncedInputFrameId int32 LastAllConfirmedInputFrameId int32 LastAllConfirmedInputFrameIdWithChange int32 @@ -396,12 +397,19 @@ func (pR *Room) StartBattle() { pR.RenderFrameId = 0 + // [WARNING] Only since battle starts do we have all players bound to certain joinIndexes. + for _, player := range pR.Players { + opJoinIndexPrefix := (int(player.JoinIndex) << uint(8)) + pR.playerOpPatternToSkillId[opJoinIndexPrefix+0] = 1 // Hardcoded for now + } + // Initialize the "collisionSys" as well as "RenderFrameBuffer" pR.CurDynamicsRenderFrameId = 0 kickoffFrameJs := &battle.RoomDownsyncFrame{ - Id: pR.RenderFrameId, - PlayersArr: toJsPlayers(pR.Players), - CountdownNanos: pR.BattleDurationNanos, + Id: pR.RenderFrameId, + PlayersArr: toJsPlayers(pR.Players), + PlayerOpPatternToSkillId: pR.playerOpPatternToSkillId, + CountdownNanos: pR.BattleDurationNanos, } pR.RenderFrameBuffer.Put(kickoffFrameJs) @@ -597,7 +605,7 @@ func (pR *Room) OnBattleCmdReceived(pReq *pb.WsReq) { } } -func (pR *Room) onInputFrameDownsyncAllConfirmed(inputFrameDownsync *pb.InputFrameDownsync, playerId int32) { +func (pR *Room) onInputFrameDownsyncAllConfirmed(inputFrameDownsync *battle.InputFrameDownsync, playerId int32) { // [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked! inputFrameId := inputFrameDownsync.InputFrameId if -1 == pR.LastAllConfirmedInputFrameIdWithChange || false == pR.equalInputLists(inputFrameDownsync.InputList, pR.LastAllConfirmedInputList) { @@ -741,6 +749,7 @@ func (pR *Room) OnDismissed() { pR.SpAtkLookupFrames = 5 pR.PlayerDefaultSpeed = int32(float64(1) * pR.WorldToVirtualGridRatio) // in virtual grids per frame pR.CollisionMinStep = (int32(float64(pR.PlayerDefaultSpeed)*pR.VirtualGridToWorldRatio) << 3) // the approx minimum distance a player can move per frame in world coordinate + pR.playerOpPatternToSkillId = make(map[int]int) pR.Players = make(map[int32]*Player) pR.PlayersArr = make([]*Player, pR.Capacity) pR.CollisionSysMap = make(map[int32]*resolv.Object) @@ -756,8 +765,8 @@ func (pR *Room) OnDismissed() { pR.PlayerSignalToCloseDict = make(map[int32]SignalToCloseConnCbType) pR.JoinIndexBooleanArr = make([]bool, pR.Capacity) pR.RenderCacheSize = 1024 - pR.RenderFrameBuffer = NewRingBuffer(pR.RenderCacheSize) - pR.InputsBuffer = NewRingBuffer((pR.RenderCacheSize >> 1) + 1) + pR.RenderFrameBuffer = battle.NewRingBuffer(pR.RenderCacheSize) + pR.InputsBuffer = battle.NewRingBuffer((pR.RenderCacheSize >> 1) + 1) pR.rdfIdToActuallyUsedInput = make(map[int32]*pb.InputFrameDownsync) pR.LatestPlayerUpsyncedInputFrameId = -1 @@ -782,30 +791,6 @@ func (pR *Room) OnDismissed() { pR.BackendDynamicsEnabled = true // [WARNING] When "false", recovery upon reconnection wouldn't work! pR.ForceAllResyncOnAnyActiveSlowTicker = true // See tradeoff discussion in "downsyncToAllPlayers" - punchSkillId := int32(1) - pR.MeleeSkillConfig = make(map[int32]*pb.MeleeBullet, 0) - pR.MeleeSkillConfig[punchSkillId] = &pb.MeleeBullet{ - // for offender - StartupFrames: int32(10), - ActiveFrames: int32(10), - RecoveryFrames: int32(34), - RecoveryFramesOnBlock: int32(34), - RecoveryFramesOnHit: int32(34), - HitboxOffset: float64(12.0), // should be about the radius of the PlayerCollider - - // for defender - HitStunFrames: int32(18), - BlockStunFrames: int32(9), - Pushback: float64(8.0), - ReleaseTriggerType: int32(1), // 1: rising-edge, 2: falling-edge - Damage: int32(5), - - SelfMoveforwardX: 0, - SelfMoveforwardY: 0, - HitboxSizeX: 24.0, - HitboxSizeY: 32.0, - } - pR.SnapIntoPlatformOverlap = float64(0.1) pR.SnapIntoPlatformThreshold = float64(0.5) pR.JumpingInitVelY = int32(float64(7) * pR.WorldToVirtualGridRatio) @@ -1067,7 +1052,7 @@ func (pR *Room) shouldPrefabInputFrameDownsync(prevRenderFrameId int32, renderFr return false, -1 } -func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *pb.InputFrameDownsync { +func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *battle.InputFrameDownsync { /* [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked. @@ -1076,12 +1061,12 @@ func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *pb.InputFrame - OR there's no change w.r.t. to its prev cmd. */ - var currInputFrameDownsync *pb.InputFrameDownsync = nil + var currInputFrameDownsync *battle.InputFrameDownsync = nil tmp1 := pR.InputsBuffer.GetByFrameId(inputFrameId) // Would be nil if "pR.InputsBuffer.EdFrameId <= inputFrameId", else if "pR.InputsBuffer.EdFrameId > inputFrameId" is already met, then by now we can just return "tmp1.(*InputFrameDownsync)" if nil == tmp1 { for pR.InputsBuffer.EdFrameId <= inputFrameId { j := pR.InputsBuffer.EdFrameId - currInputFrameDownsync = &pb.InputFrameDownsync{ + currInputFrameDownsync = &battle.InputFrameDownsync{ InputFrameId: j, InputList: make([]uint64, pR.Capacity), ConfirmedList: uint64(0), @@ -1093,7 +1078,7 @@ func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *pb.InputFrame } tmp2 := pR.InputsBuffer.GetByFrameId(j2) if nil != tmp2 { - prevInputFrameDownsync := tmp2.(*pb.InputFrameDownsync) + prevInputFrameDownsync := tmp2.(*battle.InputFrameDownsync) for i, _ := range currInputFrameDownsync.InputList { currInputFrameDownsync.InputList[i] = (prevInputFrameDownsync.InputList[i] & uint64(15)) // Don't predict attack input! } @@ -1102,7 +1087,7 @@ func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *pb.InputFrame pR.InputsBuffer.Put(currInputFrameDownsync) } } else { - currInputFrameDownsync = tmp1.(*pb.InputFrameDownsync) + currInputFrameDownsync = tmp1.(*battle.InputFrameDownsync) } return currInputFrameDownsync @@ -1148,7 +1133,7 @@ func (pR *Room) markConfirmationIfApplicable(inputFrameUpsyncBatch []*pb.InputFr panic(fmt.Sprintf("inputFrameId=%v doesn't exist for roomId=%v! InputsBuffer=%v", inputFrameId, pR.Id, pR.InputsBufferString(false))) } shouldBreakConfirmation := false - inputFrameDownsync := tmp.(*pb.InputFrameDownsync) + inputFrameDownsync := tmp.(*battle.InputFrameDownsync) if allConfirmedMask != inputFrameDownsync.ConfirmedList { for _, player := range pR.PlayersArr { @@ -1207,7 +1192,7 @@ func (pR *Room) forceConfirmationIfApplicable(prevRenderFrameId int32) uint64 { if nil == tmp { panic(fmt.Sprintf("inputFrameId=%v doesn't exist for roomId=%v! InputsBuffer=%v", j, pR.Id, pR.InputsBufferString(false))) } - inputFrameDownsync := tmp.(*pb.InputFrameDownsync) + inputFrameDownsync := tmp.(*battle.InputFrameDownsync) unconfirmedMask |= (allConfirmedMask ^ inputFrameDownsync.ConfirmedList) inputFrameDownsync.ConfirmedList = allConfirmedMask pR.onInputFrameDownsyncAllConfirmed(inputFrameDownsync, -1) @@ -1265,8 +1250,6 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende } currRenderFrame := currRenderFrameTmp.(*battle.RoomDownsyncFrame) delayedInputFrameId := pR.ConvertToInputFrameId(collisionSysRenderFrameId, pR.InputDelayFrames) - var delayedInputList *[]uint64 = nil - var delayedInputListForPrevRenderFrame *[]uint64 = nil if 0 <= delayedInputFrameId { if delayedInputFrameId > pR.LastAllConfirmedInputFrameId { panic(fmt.Sprintf("delayedInputFrameId=%v is not yet all-confirmed for roomId=%v, this is abnormal because it's to be used for applying dynamics to [fromRenderFrameId:%v, toRenderFrameId:%v) @ collisionSysRenderFrameId=%v! InputsBuffer=%v", delayedInputFrameId, pR.Id, fromRenderFrameId, toRenderFrameId, collisionSysRenderFrameId, pR.InputsBufferString(false))) @@ -1275,21 +1258,11 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende if nil == tmp { panic(fmt.Sprintf("delayedInputFrameId=%v doesn't exist for roomId=%v, this is abnormal because it's to be used for applying dynamics to [fromRenderFrameId:%v, toRenderFrameId:%v) @ collisionSysRenderFrameId=%v! InputsBuffer=%v", delayedInputFrameId, pR.Id, fromRenderFrameId, toRenderFrameId, collisionSysRenderFrameId, pR.InputsBufferString(false))) } - delayedInputFrame := tmp.(*pb.InputFrameDownsync) - delayedInputList = &delayedInputFrame.InputList - delayedInputFrameIdForPrevRenderFrame := pR.ConvertToInputFrameId(collisionSysRenderFrameId-1, pR.InputDelayFrames) - if 0 <= delayedInputFrameIdForPrevRenderFrame { - tmp = pR.InputsBuffer.GetByFrameId(delayedInputFrameIdForPrevRenderFrame) - if nil == tmp { - panic(fmt.Sprintf("delayedInputFrameIdForPrevRenderFrame=%v doesn't exist for roomId=%v, this is abnormal because it's to be used for applying dynamics to [fromRenderFrameId:%v, toRenderFrameId:%v) @ collisionSysRenderFrameId-1=%v! InputsBuffer=%v", delayedInputFrameIdForPrevRenderFrame, pR.Id, fromRenderFrameId, toRenderFrameId, collisionSysRenderFrameId-1, pR.InputsBufferString(false))) - } - delayedInputFrameForPrevRenderFrame := tmp.(*pb.InputFrameDownsync) - delayedInputListForPrevRenderFrame = &delayedInputFrameForPrevRenderFrame.InputList - } if pR.FrameDataLoggingEnabled { - actuallyUsedInputClone := make([]uint64, len(*delayedInputList), len(*delayedInputList)) - for i, v := range *delayedInputList { + delayedInputFrame := tmp.(*battle.InputFrameDownsync) + actuallyUsedInputClone := make([]uint64, len(delayedInputFrame.InputList), len(delayedInputFrame.InputList)) + for i, v := range delayedInputFrame.InputList { actuallyUsedInputClone[i] = v } pR.rdfIdToActuallyUsedInput[currRenderFrame.Id] = &pb.InputFrameDownsync{ @@ -1300,7 +1273,7 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende } } - nextRenderFrame := battle.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(*delayedInputList, *delayedInputListForPrevRenderFrame, currRenderFrame, pR.Space, pR.CollisionSysMap, pR.GravityX, pR.GravityY, pR.JumpingInitVelY, pR.InputDelayFrames, pR.InputScaleFrames, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, pR.SnapIntoPlatformOverlap, pR.SnapIntoPlatformThreshold, pR.WorldToVirtualGridRatio, pR.VirtualGridToWorldRatio) + nextRenderFrame := battle.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(pR.InputsBuffer, currRenderFrame, pR.Space, pR.CollisionSysMap, pR.GravityX, pR.GravityY, pR.JumpingInitVelY, pR.InputDelayFrames, pR.InputScaleFrames, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, pR.SnapIntoPlatformOverlap, pR.SnapIntoPlatformThreshold, pR.WorldToVirtualGridRatio, pR.VirtualGridToWorldRatio, pR.playerOpPatternToSkillId) pR.RenderFrameBuffer.Put(nextRenderFrame) pR.CurDynamicsRenderFrameId++ } @@ -1497,6 +1470,7 @@ func (pR *Room) downsyncToSinglePlayer(playerId int32, player *Player, refRender } refRenderFrame := tmp.(*battle.RoomDownsyncFrame) + refRenderFrame.PlayerOpPatternToSkillId = pR.playerOpPatternToSkillId for i, player := range pR.PlayersArr { refRenderFrame.PlayersArr[i].ColliderRadius = player.ColliderRadius // hardcoded for now } @@ -1534,7 +1508,7 @@ func (pR *Room) cloneInputsBuffer(stFrameId, edFrameId int32) []*pb.InputFrameDo } } prevFrameFound = true - foo := tmp.(*pb.InputFrameDownsync) + foo := tmp.(*battle.InputFrameDownsync) bar := &pb.InputFrameDownsync{ InputFrameId: foo.InputFrameId, diff --git a/battle_srv/protos/room_downsync_frame.pb.go b/battle_srv/protos/room_downsync_frame.pb.go index 8cf0f22..bab51dc 100644 --- a/battle_srv/protos/room_downsync_frame.pb.go +++ b/battle_srv/protos/room_downsync_frame.pb.go @@ -931,37 +931,36 @@ type BattleColliderInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StageName string `protobuf:"bytes,1,opt,name=stageName,proto3" json:"stageName,omitempty"` - StageDiscreteW int32 `protobuf:"varint,2,opt,name=stageDiscreteW,proto3" json:"stageDiscreteW,omitempty"` - StageDiscreteH int32 `protobuf:"varint,3,opt,name=stageDiscreteH,proto3" json:"stageDiscreteH,omitempty"` - StageTileW int32 `protobuf:"varint,4,opt,name=stageTileW,proto3" json:"stageTileW,omitempty"` - StageTileH int32 `protobuf:"varint,5,opt,name=stageTileH,proto3" json:"stageTileH,omitempty"` - IntervalToPing int32 `protobuf:"varint,6,opt,name=intervalToPing,proto3" json:"intervalToPing,omitempty"` - WillKickIfInactiveFor int32 `protobuf:"varint,7,opt,name=willKickIfInactiveFor,proto3" json:"willKickIfInactiveFor,omitempty"` - BoundRoomId int32 `protobuf:"varint,8,opt,name=boundRoomId,proto3" json:"boundRoomId,omitempty"` - BattleDurationFrames int32 `protobuf:"varint,9,opt,name=battleDurationFrames,proto3" json:"battleDurationFrames,omitempty"` - BattleDurationNanos int64 `protobuf:"varint,10,opt,name=battleDurationNanos,proto3" json:"battleDurationNanos,omitempty"` - ServerFps int32 `protobuf:"varint,11,opt,name=serverFps,proto3" json:"serverFps,omitempty"` - InputDelayFrames int32 `protobuf:"varint,12,opt,name=inputDelayFrames,proto3" json:"inputDelayFrames,omitempty"` // in the count of render frames - InputScaleFrames uint32 `protobuf:"varint,13,opt,name=inputScaleFrames,proto3" json:"inputScaleFrames,omitempty"` // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames) - NstDelayFrames int32 `protobuf:"varint,14,opt,name=nstDelayFrames,proto3" json:"nstDelayFrames,omitempty"` // 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" - InputFrameUpsyncDelayTolerance int32 `protobuf:"varint,15,opt,name=inputFrameUpsyncDelayTolerance,proto3" json:"inputFrameUpsyncDelayTolerance,omitempty"` - MaxChasingRenderFramesPerUpdate int32 `protobuf:"varint,16,opt,name=maxChasingRenderFramesPerUpdate,proto3" json:"maxChasingRenderFramesPerUpdate,omitempty"` - PlayerBattleState int32 `protobuf:"varint,17,opt,name=playerBattleState,proto3" json:"playerBattleState,omitempty"` - RollbackEstimatedDtMillis float64 `protobuf:"fixed64,18,opt,name=rollbackEstimatedDtMillis,proto3" json:"rollbackEstimatedDtMillis,omitempty"` - RollbackEstimatedDtNanos int64 `protobuf:"varint,19,opt,name=rollbackEstimatedDtNanos,proto3" json:"rollbackEstimatedDtNanos,omitempty"` - WorldToVirtualGridRatio float64 `protobuf:"fixed64,20,opt,name=worldToVirtualGridRatio,proto3" json:"worldToVirtualGridRatio,omitempty"` - VirtualGridToWorldRatio float64 `protobuf:"fixed64,21,opt,name=virtualGridToWorldRatio,proto3" json:"virtualGridToWorldRatio,omitempty"` - SpAtkLookupFrames int32 `protobuf:"varint,22,opt,name=spAtkLookupFrames,proto3" json:"spAtkLookupFrames,omitempty"` - RenderCacheSize int32 `protobuf:"varint,23,opt,name=renderCacheSize,proto3" json:"renderCacheSize,omitempty"` - MeleeSkillConfig map[int32]*MeleeBullet `protobuf:"bytes,24,rep,name=meleeSkillConfig,proto3" json:"meleeSkillConfig,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // skillId -> skill - SnapIntoPlatformOverlap float64 `protobuf:"fixed64,25,opt,name=snapIntoPlatformOverlap,proto3" json:"snapIntoPlatformOverlap,omitempty"` - SnapIntoPlatformThreshold float64 `protobuf:"fixed64,26,opt,name=snapIntoPlatformThreshold,proto3" json:"snapIntoPlatformThreshold,omitempty"` - JumpingInitVelY int32 `protobuf:"varint,27,opt,name=jumpingInitVelY,proto3" json:"jumpingInitVelY,omitempty"` - GravityX int32 `protobuf:"varint,28,opt,name=gravityX,proto3" json:"gravityX,omitempty"` - GravityY int32 `protobuf:"varint,29,opt,name=gravityY,proto3" json:"gravityY,omitempty"` - CollisionMinStep int32 `protobuf:"varint,30,opt,name=collisionMinStep,proto3" json:"collisionMinStep,omitempty"` - FrameDataLoggingEnabled bool `protobuf:"varint,999,opt,name=frameDataLoggingEnabled,proto3" json:"frameDataLoggingEnabled,omitempty"` + StageName string `protobuf:"bytes,1,opt,name=stageName,proto3" json:"stageName,omitempty"` + StageDiscreteW int32 `protobuf:"varint,2,opt,name=stageDiscreteW,proto3" json:"stageDiscreteW,omitempty"` + StageDiscreteH int32 `protobuf:"varint,3,opt,name=stageDiscreteH,proto3" json:"stageDiscreteH,omitempty"` + StageTileW int32 `protobuf:"varint,4,opt,name=stageTileW,proto3" json:"stageTileW,omitempty"` + StageTileH int32 `protobuf:"varint,5,opt,name=stageTileH,proto3" json:"stageTileH,omitempty"` + IntervalToPing int32 `protobuf:"varint,6,opt,name=intervalToPing,proto3" json:"intervalToPing,omitempty"` + WillKickIfInactiveFor int32 `protobuf:"varint,7,opt,name=willKickIfInactiveFor,proto3" json:"willKickIfInactiveFor,omitempty"` + BoundRoomId int32 `protobuf:"varint,8,opt,name=boundRoomId,proto3" json:"boundRoomId,omitempty"` + BattleDurationFrames int32 `protobuf:"varint,9,opt,name=battleDurationFrames,proto3" json:"battleDurationFrames,omitempty"` + BattleDurationNanos int64 `protobuf:"varint,10,opt,name=battleDurationNanos,proto3" json:"battleDurationNanos,omitempty"` + ServerFps int32 `protobuf:"varint,11,opt,name=serverFps,proto3" json:"serverFps,omitempty"` + InputDelayFrames int32 `protobuf:"varint,12,opt,name=inputDelayFrames,proto3" json:"inputDelayFrames,omitempty"` // in the count of render frames + InputScaleFrames uint32 `protobuf:"varint,13,opt,name=inputScaleFrames,proto3" json:"inputScaleFrames,omitempty"` // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames) + NstDelayFrames int32 `protobuf:"varint,14,opt,name=nstDelayFrames,proto3" json:"nstDelayFrames,omitempty"` // 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" + InputFrameUpsyncDelayTolerance int32 `protobuf:"varint,15,opt,name=inputFrameUpsyncDelayTolerance,proto3" json:"inputFrameUpsyncDelayTolerance,omitempty"` + MaxChasingRenderFramesPerUpdate int32 `protobuf:"varint,16,opt,name=maxChasingRenderFramesPerUpdate,proto3" json:"maxChasingRenderFramesPerUpdate,omitempty"` + PlayerBattleState int32 `protobuf:"varint,17,opt,name=playerBattleState,proto3" json:"playerBattleState,omitempty"` + RollbackEstimatedDtMillis float64 `protobuf:"fixed64,18,opt,name=rollbackEstimatedDtMillis,proto3" json:"rollbackEstimatedDtMillis,omitempty"` + RollbackEstimatedDtNanos int64 `protobuf:"varint,19,opt,name=rollbackEstimatedDtNanos,proto3" json:"rollbackEstimatedDtNanos,omitempty"` + WorldToVirtualGridRatio float64 `protobuf:"fixed64,20,opt,name=worldToVirtualGridRatio,proto3" json:"worldToVirtualGridRatio,omitempty"` + VirtualGridToWorldRatio float64 `protobuf:"fixed64,21,opt,name=virtualGridToWorldRatio,proto3" json:"virtualGridToWorldRatio,omitempty"` + SpAtkLookupFrames int32 `protobuf:"varint,22,opt,name=spAtkLookupFrames,proto3" json:"spAtkLookupFrames,omitempty"` + RenderCacheSize int32 `protobuf:"varint,23,opt,name=renderCacheSize,proto3" json:"renderCacheSize,omitempty"` + SnapIntoPlatformOverlap float64 `protobuf:"fixed64,24,opt,name=snapIntoPlatformOverlap,proto3" json:"snapIntoPlatformOverlap,omitempty"` + SnapIntoPlatformThreshold float64 `protobuf:"fixed64,25,opt,name=snapIntoPlatformThreshold,proto3" json:"snapIntoPlatformThreshold,omitempty"` + JumpingInitVelY int32 `protobuf:"varint,26,opt,name=jumpingInitVelY,proto3" json:"jumpingInitVelY,omitempty"` + GravityX int32 `protobuf:"varint,27,opt,name=gravityX,proto3" json:"gravityX,omitempty"` + GravityY int32 `protobuf:"varint,28,opt,name=gravityY,proto3" json:"gravityY,omitempty"` + CollisionMinStep int32 `protobuf:"varint,29,opt,name=collisionMinStep,proto3" json:"collisionMinStep,omitempty"` + FrameDataLoggingEnabled bool `protobuf:"varint,999,opt,name=frameDataLoggingEnabled,proto3" json:"frameDataLoggingEnabled,omitempty"` } func (x *BattleColliderInfo) Reset() { @@ -1157,13 +1156,6 @@ func (x *BattleColliderInfo) GetRenderCacheSize() int32 { return 0 } -func (x *BattleColliderInfo) GetMeleeSkillConfig() map[int32]*MeleeBullet { - if x != nil { - return x.MeleeSkillConfig - } - return nil -} - func (x *BattleColliderInfo) GetSnapIntoPlatformOverlap() float64 { if x != nil { return x.SnapIntoPlatformOverlap @@ -1218,12 +1210,13 @@ type RoomDownsyncFrame struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - PlayersArr []*PlayerDownsync `protobuf:"bytes,2,rep,name=playersArr,proto3" json:"playersArr,omitempty"` - CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"` - MeleeBullets []*MeleeBullet `protobuf:"bytes,4,rep,name=meleeBullets,proto3" json:"meleeBullets,omitempty"` // I don't know how to mimic inheritance/composition in protobuf by far, thus using an array for each type of bullet as a compromise - BackendUnconfirmedMask uint64 `protobuf:"varint,5,opt,name=backendUnconfirmedMask,proto3" json:"backendUnconfirmedMask,omitempty"` // Indexed by "joinIndex", same compression concern as stated in InputFrameDownsync - ShouldForceResync bool `protobuf:"varint,6,opt,name=shouldForceResync,proto3" json:"shouldForceResync,omitempty"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + PlayersArr []*PlayerDownsync `protobuf:"bytes,2,rep,name=playersArr,proto3" json:"playersArr,omitempty"` + CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"` + MeleeBullets []*MeleeBullet `protobuf:"bytes,4,rep,name=meleeBullets,proto3" json:"meleeBullets,omitempty"` // I don't know how to mimic inheritance/composition in protobuf by far, thus using an array for each type of bullet as a compromise + BackendUnconfirmedMask uint64 `protobuf:"varint,5,opt,name=backendUnconfirmedMask,proto3" json:"backendUnconfirmedMask,omitempty"` // Indexed by "joinIndex", same compression concern as stated in InputFrameDownsync + ShouldForceResync bool `protobuf:"varint,6,opt,name=shouldForceResync,proto3" json:"shouldForceResync,omitempty"` + PlayerOpPatternToSkillId map[int32]int32 `protobuf:"bytes,7,rep,name=playerOpPatternToSkillId,proto3" json:"playerOpPatternToSkillId,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` } func (x *RoomDownsyncFrame) Reset() { @@ -1300,6 +1293,13 @@ func (x *RoomDownsyncFrame) GetShouldForceResync() bool { return false } +func (x *RoomDownsyncFrame) GetPlayerOpPatternToSkillId() map[int32]int32 { + if x != nil { + return x.PlayerOpPatternToSkillId + } + return nil +} + var File_room_downsync_frame_proto protoreflect.FileDescriptor var file_room_downsync_frame_proto_rawDesc = []byte{ @@ -1470,7 +1470,7 @@ var file_room_downsync_frame_proto_rawDesc = []byte{ 0x6c, 0x66, 0x4d, 0x6f, 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x58, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x65, 0x6c, 0x66, 0x4d, 0x6f, 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x59, 0x18, 0x13, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x73, 0x65, 0x6c, 0x66, 0x4d, 0x6f, - 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x59, 0x22, 0xc5, 0x0c, 0x0a, 0x12, 0x42, + 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x59, 0x22, 0x8d, 0x0b, 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, @@ -1539,59 +1539,59 @@ var file_room_downsync_frame_proto_rawDesc = []byte{ 0x41, 0x74, 0x6b, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x5c, 0x0a, 0x10, 0x6d, 0x65, 0x6c, - 0x65, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x18, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x30, 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, - 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x6d, 0x65, 0x6c, 0x65, 0x65, 0x53, 0x6b, 0x69, 0x6c, - 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x38, 0x0a, 0x17, 0x73, 0x6e, 0x61, 0x70, 0x49, - 0x6e, 0x74, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4f, 0x76, 0x65, 0x72, 0x6c, - 0x61, 0x70, 0x18, 0x19, 0x20, 0x01, 0x28, 0x01, 0x52, 0x17, 0x73, 0x6e, 0x61, 0x70, 0x49, 0x6e, - 0x74, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, - 0x70, 0x12, 0x3c, 0x0a, 0x19, 0x73, 0x6e, 0x61, 0x70, 0x49, 0x6e, 0x74, 0x6f, 0x50, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x1a, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x19, 0x73, 0x6e, 0x61, 0x70, 0x49, 0x6e, 0x74, 0x6f, 0x50, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, - 0x28, 0x0a, 0x0f, 0x6a, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x56, 0x65, - 0x6c, 0x59, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x6a, 0x75, 0x6d, 0x70, 0x69, 0x6e, - 0x67, 0x49, 0x6e, 0x69, 0x74, 0x56, 0x65, 0x6c, 0x59, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x61, - 0x76, 0x69, 0x74, 0x79, 0x58, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x72, 0x61, - 0x76, 0x69, 0x74, 0x79, 0x58, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, - 0x59, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, - 0x59, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x69, - 0x6e, 0x53, 0x74, 0x65, 0x70, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x63, 0x6f, 0x6c, - 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x12, 0x39, 0x0a, - 0x17, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, - 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0xe7, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x17, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, - 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x58, 0x0a, 0x15, 0x4d, 0x65, 0x6c, 0x65, - 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x6c, 0x65, - 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x22, 0xa2, 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, 0x36, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, - 0x73, 0x79, 0x6e, 0x63, 0x52, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, - 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, 0x37, 0x0a, 0x0c, 0x6d, 0x65, 0x6c, 0x65, - 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, - 0x6c, 0x65, 0x74, 0x52, 0x0c, 0x6d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, - 0x73, 0x12, 0x36, 0x0a, 0x16, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x16, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x68, 0x6f, - 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 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, + 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x38, 0x0a, 0x17, 0x73, 0x6e, 0x61, + 0x70, 0x49, 0x6e, 0x74, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4f, 0x76, 0x65, + 0x72, 0x6c, 0x61, 0x70, 0x18, 0x18, 0x20, 0x01, 0x28, 0x01, 0x52, 0x17, 0x73, 0x6e, 0x61, 0x70, + 0x49, 0x6e, 0x74, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4f, 0x76, 0x65, 0x72, + 0x6c, 0x61, 0x70, 0x12, 0x3c, 0x0a, 0x19, 0x73, 0x6e, 0x61, 0x70, 0x49, 0x6e, 0x74, 0x6f, 0x50, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x18, 0x19, 0x20, 0x01, 0x28, 0x01, 0x52, 0x19, 0x73, 0x6e, 0x61, 0x70, 0x49, 0x6e, 0x74, 0x6f, + 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, + 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6a, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x69, 0x74, + 0x56, 0x65, 0x6c, 0x59, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x6a, 0x75, 0x6d, 0x70, + 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x56, 0x65, 0x6c, 0x59, 0x12, 0x1a, 0x0a, 0x08, 0x67, + 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x58, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, + 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x58, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x76, 0x69, + 0x74, 0x79, 0x59, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x72, 0x61, 0x76, 0x69, + 0x74, 0x79, 0x59, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x4d, 0x69, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x63, + 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x12, + 0x39, 0x0a, 0x17, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x6f, 0x67, 0x67, + 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0xe7, 0x07, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x17, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x6f, 0x67, 0x67, + 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xe4, 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, 0x36, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x0a, 0x70, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, 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, 0x37, 0x0a, 0x0c, 0x6d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x0c, 0x6d, 0x65, 0x6c, + 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x16, 0x62, 0x61, 0x63, + 0x6b, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x62, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, 0x73, + 0x6b, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x68, + 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x12, + 0x73, 0x0a, 0x18, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, + 0x72, 0x6e, 0x54, 0x6f, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x37, 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, 0x4f, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x54, 0x6f, 0x53, 0x6b, + 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x18, 0x70, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x4f, 0x70, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x54, 0x6f, 0x53, 0x6b, 0x69, + 0x6c, 0x6c, 0x49, 0x64, 0x1a, 0x4b, 0x0a, 0x1d, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, + 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x54, 0x6f, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x64, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 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 ( @@ -1619,7 +1619,7 @@ var file_room_downsync_frame_proto_goTypes = []interface{}{ (*MeleeBullet)(nil), // 8: protos.MeleeBullet (*BattleColliderInfo)(nil), // 9: protos.BattleColliderInfo (*RoomDownsyncFrame)(nil), // 10: protos.RoomDownsyncFrame - nil, // 11: protos.BattleColliderInfo.MeleeSkillConfigEntry + nil, // 11: protos.RoomDownsyncFrame.PlayerOpPatternToSkillIdEntry } var file_room_downsync_frame_proto_depIdxs = []int32{ 2, // 0: protos.WsReq.inputFrameUpsyncBatch:type_name -> protos.InputFrameUpsync @@ -1628,15 +1628,14 @@ var file_room_downsync_frame_proto_depIdxs = []int32{ 3, // 3: protos.WsResp.inputFrameDownsyncBatch:type_name -> protos.InputFrameDownsync 9, // 4: protos.WsResp.bciFrame:type_name -> protos.BattleColliderInfo 3, // 5: protos.InputsBufferSnapshot.toSendInputFrameDownsyncs:type_name -> protos.InputFrameDownsync - 11, // 6: protos.BattleColliderInfo.meleeSkillConfig:type_name -> protos.BattleColliderInfo.MeleeSkillConfigEntry - 0, // 7: protos.RoomDownsyncFrame.playersArr:type_name -> protos.PlayerDownsync - 8, // 8: protos.RoomDownsyncFrame.meleeBullets:type_name -> protos.MeleeBullet - 8, // 9: protos.BattleColliderInfo.MeleeSkillConfigEntry.value:type_name -> protos.MeleeBullet - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 0, // 6: protos.RoomDownsyncFrame.playersArr:type_name -> protos.PlayerDownsync + 8, // 7: protos.RoomDownsyncFrame.meleeBullets:type_name -> protos.MeleeBullet + 11, // 8: protos.RoomDownsyncFrame.playerOpPatternToSkillId:type_name -> protos.RoomDownsyncFrame.PlayerOpPatternToSkillIdEntry + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_room_downsync_frame_proto_init() } diff --git a/battle_srv/ws/serve.go b/battle_srv/ws/serve.go index 06cb3c8..b6f6215 100644 --- a/battle_srv/ws/serve.go +++ b/battle_srv/ws/serve.go @@ -265,7 +265,6 @@ func Serve(c *gin.Context) { SpAtkLookupFrames: pRoom.SpAtkLookupFrames, RenderCacheSize: pRoom.RenderCacheSize, - MeleeSkillConfig: pRoom.MeleeSkillConfig, SnapIntoPlatformOverlap: pRoom.SnapIntoPlatformOverlap, SnapIntoPlatformThreshold: pRoom.SnapIntoPlatformThreshold, JumpingInitVelY: pRoom.JumpingInitVelY, diff --git a/frontend/assets/plugin_scripts/jsexport.js b/frontend/assets/plugin_scripts/jsexport.js index b6d5635..08d5805 100644 --- a/frontend/assets/plugin_scripts/jsexport.js +++ b/frontend/assets/plugin_scripts/jsexport.js @@ -4724,7 +4724,7 @@ $packages["resolv"] = (function() { return $pkg; })(); $packages["jsexport/battle"] = (function() { - var $pkg = {}, $init, math, resolv, Vec2D, Polygon2D, PlayerDownsync, InputFrameDecoded, Barrier, Bullet, MeleeBullet, FireballBullet, RoomDownsyncFrame, InputFrameDownsync, RingBuffer, SatResult, sliceType, sliceType$1, sliceType$2, ptrType, sliceType$3, sliceType$4, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, sliceType$5, sliceType$6, sliceType$7, sliceType$8, ptrType$7, sliceType$9, ptrType$8, sliceType$10, sliceType$11, ptrType$9, sliceType$12, ptrType$10, ptrType$11, skillIdToBullet, NewRingBuffer, ConvertToInputFrameId, decodeInput, CalcPushbacks, isPolygonPairOverlapped, isPolygonPairSeparatedByDir, WorldToVirtualGridPos, VirtualGridToWorldPos, WorldToPolygonColliderBLPos, PolygonColliderBLToWorldPos, PolygonColliderBLToVirtualGridPos, VirtualGridToPolygonColliderBLPos, calcHardPushbacksNorms, deriveOpPattern, ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame, GenerateRectCollider, generateRectColliderInCollisionSpace, GenerateConvexPolygonCollider, AlignPolygon2DToBoundingBox; + var $pkg = {}, $init, math, resolv, Vec2D, Polygon2D, PlayerDownsync, InputFrameDecoded, Barrier, Bullet, MeleeBullet, FireballBullet, RoomDownsyncFrame, InputFrameDownsync, RingBuffer, SatResult, sliceType, sliceType$1, sliceType$2, ptrType, sliceType$3, sliceType$4, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, sliceType$5, sliceType$6, sliceType$7, sliceType$8, ptrType$7, sliceType$9, ptrType$8, sliceType$10, sliceType$11, ptrType$9, sliceType$12, ptrType$10, mapType, ptrType$11, skillIdToBullet, NewRingBuffer, ConvertToInputFrameId, decodeInput, CalcPushbacks, isPolygonPairOverlapped, isPolygonPairSeparatedByDir, WorldToVirtualGridPos, VirtualGridToWorldPos, WorldToPolygonColliderBLPos, PolygonColliderBLToWorldPos, PolygonColliderBLToVirtualGridPos, VirtualGridToPolygonColliderBLPos, calcHardPushbacksNorms, deriveOpPattern, ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame, GenerateRectCollider, generateRectColliderInCollisionSpace, GenerateConvexPolygonCollider, AlignPolygon2DToBoundingBox; math = $packages["math"]; resolv = $packages["resolv"]; Vec2D = $pkg.Vec2D = $newType(0, $kindStruct, "battle.Vec2D", true, "jsexport/battle", true, function(X_, Y_) { @@ -4887,7 +4887,7 @@ $packages["jsexport/battle"] = (function() { this.Speed = Speed_; this.Bullet = Bullet_; }); - RoomDownsyncFrame = $pkg.RoomDownsyncFrame = $newType(0, $kindStruct, "battle.RoomDownsyncFrame", true, "jsexport/battle", true, function(Id_, PlayersArr_, CountdownNanos_, MeleeBullets_, FireballBullets_, BackendUnconfirmedMask_, ShouldForceResync_) { + RoomDownsyncFrame = $pkg.RoomDownsyncFrame = $newType(0, $kindStruct, "battle.RoomDownsyncFrame", true, "jsexport/battle", true, function(Id_, PlayersArr_, CountdownNanos_, MeleeBullets_, FireballBullets_, BackendUnconfirmedMask_, ShouldForceResync_, PlayerOpPatternToSkillId_) { this.$val = this; if (arguments.length === 0) { this.Id = 0; @@ -4897,6 +4897,7 @@ $packages["jsexport/battle"] = (function() { this.FireballBullets = sliceType$10.nil; this.BackendUnconfirmedMask = new $Uint64(0, 0); this.ShouldForceResync = false; + this.PlayerOpPatternToSkillId = false; return; } this.Id = Id_; @@ -4906,6 +4907,7 @@ $packages["jsexport/battle"] = (function() { this.FireballBullets = FireballBullets_; this.BackendUnconfirmedMask = BackendUnconfirmedMask_; this.ShouldForceResync = ShouldForceResync_; + this.PlayerOpPatternToSkillId = PlayerOpPatternToSkillId_; }); InputFrameDownsync = $pkg.InputFrameDownsync = $newType(0, $kindStruct, "battle.InputFrameDownsync", true, "jsexport/battle", true, function(InputFrameId_, InputList_, ConfirmedList_) { this.$val = this; @@ -4981,6 +4983,7 @@ $packages["jsexport/battle"] = (function() { ptrType$9 = $ptrType(Vec2D); sliceType$12 = $sliceType(ptrType$9); ptrType$10 = $ptrType(Polygon2D); + mapType = $mapType($Int, $Int); ptrType$11 = $ptrType(RingBuffer); NewRingBuffer = function(n) { var n; @@ -5752,7 +5755,7 @@ $packages["jsexport/battle"] = (function() { thatPlayerInNextFrame$3.VirtualGridY = _tuple$6[1]; _i$10++; } - $s = -1; return new RoomDownsyncFrame.ptr(currRenderFrame.Id + 1 >> 0, nextRenderFramePlayers, new $Int64(0, 0), nextRenderFrameMeleeBullets, sliceType$10.nil, new $Uint64(0, 0), false); + $s = -1; return new RoomDownsyncFrame.ptr(currRenderFrame.Id + 1 >> 0, nextRenderFramePlayers, new $Int64(0, 0), nextRenderFrameMeleeBullets, sliceType$10.nil, new $Uint64(0, 0), false, false); /* */ } return; } var $f = {$blk: ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame, $c: true, $r, _1, _entry, _entry$1, _entry$2, _entry$3, _entry$4, _i, _i$1, _i$10, _i$2, _i$3, _i$4, _i$5, _i$6, _i$7, _i$8, _i$9, _index, _index$1, _index$2, _index$3, _r, _r$1, _r$2, _r$3, _ref, _ref$1, _ref$10, _ref$11, _ref$12, _ref$2, _ref$3, _ref$4, _ref$5, _ref$6, _ref$7, _ref$8, _ref$9, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, atkedPlayerInCurFrame, atkedPlayerInNextFrame, bShape, bulletCollider, bulletColliders, bulletShape, bulletWx, bulletWy, collision, collision$1, collisionPlayerIndex, collisionPlayerIndex$1, collisionPlayerIndex$2, collisionSpaceOffsetX, collisionSpaceOffsetY, collisionSys, collisionSysMap, currPlayerDownsync, currPlayerDownsync$1, currPlayerDownsync$2, currPlayerDownsync$3, currPlayerDownsync$4, currRenderFrame, defenderShape, effDx, effDy, effPushbacks, existent, gravityX, gravityY, hardPushbackNorm, hardPushbackNorm$1, hardPushbackNorms, i, i$1, i$2, i$3, i$4, inputDelayFrames, inputScaleFrames, inputsBuffer, isAnotherPlayer, isBarrier, isBullet, joinIndex, joinIndex$1, joinIndex$2, joinIndex$3, joinIndex$4, jumpedOrNot, jumpingInitVelY, landedOnGravityPushback, meleeBullet, meleeBullet$1, newBulletCollider, newMeleeBullet, newVx, newVy, nextRenderFrameMeleeBullets, nextRenderFramePlayers, normAlignmentWithGravity, obj, obj$1, offender, offender$1, offenderWx, offenderWy, oldFramesToRecover, oldNextCharacterState, overlapResult, overlapped, overlapped$1, patternId, playerCollider, playerCollider$1, playerCollider$2, playerOpPatternToSkillId, playerShape, projectedMagnitude, projectedMagnitude$1, pushbackX, pushbackX$1, pushbackY, pushbackY$1, roomCapacity, skillConfig, skillId, snapIntoPlatformOverlap, snapIntoPlatformThreshold, t, t$1, thatPlayerInNextFrame, thatPlayerInNextFrame$1, thatPlayerInNextFrame$2, thatPlayerInNextFrame$3, virtualGridToWorldRatio, worldToVirtualGridRatio, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, xfac, xfac$1, $s};return $f; }; $pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame = ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame; @@ -5865,7 +5868,7 @@ $packages["jsexport/battle"] = (function() { Bullet.init("", [{prop: "BattleLocalId", name: "BattleLocalId", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "StartupFrames", name: "StartupFrames", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "ActiveFrames", name: "ActiveFrames", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "RecoveryFrames", name: "RecoveryFrames", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "RecoveryFramesOnBlock", name: "RecoveryFramesOnBlock", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "RecoveryFramesOnHit", name: "RecoveryFramesOnHit", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "HitboxOffset", name: "HitboxOffset", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "OriginatedRenderFrameId", name: "OriginatedRenderFrameId", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "HitStunFrames", name: "HitStunFrames", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "BlockStunFrames", name: "BlockStunFrames", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Pushback", name: "Pushback", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "ReleaseTriggerType", name: "ReleaseTriggerType", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Damage", name: "Damage", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "OffenderJoinIndex", name: "OffenderJoinIndex", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "OffenderPlayerId", name: "OffenderPlayerId", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "SelfMoveforwardX", name: "SelfMoveforwardX", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "SelfMoveforwardY", name: "SelfMoveforwardY", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "HitboxSizeX", name: "HitboxSizeX", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "HitboxSizeY", name: "HitboxSizeY", embedded: false, exported: true, typ: $Float64, tag: ""}]); MeleeBullet.init("", [{prop: "Bullet", name: "Bullet", embedded: true, exported: true, typ: Bullet, tag: ""}]); FireballBullet.init("", [{prop: "VirtualGridX", name: "VirtualGridX", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "VirtualGridY", name: "VirtualGridY", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "DirX", name: "DirX", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "DirY", name: "DirY", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "VelX", name: "VelX", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "VelY", name: "VelY", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Speed", name: "Speed", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Bullet", name: "Bullet", embedded: true, exported: true, typ: Bullet, tag: ""}]); - RoomDownsyncFrame.init("", [{prop: "Id", name: "Id", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "PlayersArr", name: "PlayersArr", embedded: false, exported: true, typ: sliceType$6, tag: ""}, {prop: "CountdownNanos", name: "CountdownNanos", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "MeleeBullets", name: "MeleeBullets", embedded: false, exported: true, typ: sliceType$7, tag: ""}, {prop: "FireballBullets", name: "FireballBullets", embedded: false, exported: true, typ: sliceType$10, tag: ""}, {prop: "BackendUnconfirmedMask", name: "BackendUnconfirmedMask", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "ShouldForceResync", name: "ShouldForceResync", embedded: false, exported: true, typ: $Bool, tag: ""}]); + RoomDownsyncFrame.init("", [{prop: "Id", name: "Id", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "PlayersArr", name: "PlayersArr", embedded: false, exported: true, typ: sliceType$6, tag: ""}, {prop: "CountdownNanos", name: "CountdownNanos", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "MeleeBullets", name: "MeleeBullets", embedded: false, exported: true, typ: sliceType$7, tag: ""}, {prop: "FireballBullets", name: "FireballBullets", embedded: false, exported: true, typ: sliceType$10, tag: ""}, {prop: "BackendUnconfirmedMask", name: "BackendUnconfirmedMask", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "ShouldForceResync", name: "ShouldForceResync", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "PlayerOpPatternToSkillId", name: "PlayerOpPatternToSkillId", embedded: false, exported: true, typ: mapType, tag: ""}]); InputFrameDownsync.init("", [{prop: "InputFrameId", name: "InputFrameId", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "InputList", name: "InputList", embedded: false, exported: true, typ: sliceType$5, tag: ""}, {prop: "ConfirmedList", name: "ConfirmedList", embedded: false, exported: true, typ: $Uint64, tag: ""}]); RingBuffer.init("", [{prop: "Ed", name: "Ed", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "St", name: "St", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "EdFrameId", name: "EdFrameId", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "StFrameId", name: "StFrameId", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "N", name: "N", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Cnt", name: "Cnt", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Eles", name: "Eles", embedded: false, exported: true, typ: sliceType$2, tag: ""}]); SatResult.init("", [{prop: "Overlap", name: "Overlap", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "OverlapX", name: "OverlapX", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "OverlapY", name: "OverlapY", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "AContainedInB", name: "AContainedInB", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "BContainedInA", name: "BContainedInA", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Axis", name: "Axis", embedded: false, exported: true, typ: resolv.Vector, tag: ""}]); @@ -5882,7 +5885,7 @@ $packages["jsexport/battle"] = (function() { return $pkg; })(); $packages["jsexport"] = (function() { - var $pkg = {}, $init, js, battle, resolv, sliceType, ptrType, sliceType$1, ptrType$1, ptrType$2, sliceType$2, ptrType$3, sliceType$3, ptrType$4, sliceType$4, ptrType$5, sliceType$5, funcType, funcType$1, funcType$2, funcType$3, funcType$4, funcType$5, funcType$6, funcType$7, funcType$8, funcType$9, ptrType$6, funcType$10, ptrType$7, ptrType$8, ptrType$9, mapType, mapType$1, funcType$11, funcType$12, mapType$2, NewInputFrameDownsync, NewRingBufferJs, NewCollisionSpaceJs, NewVec2DJs, NewPolygon2DJs, NewBarrierJs, NewPlayerDownsyncJs, NewRoomDownsyncFrameJs, GetCollisionSpaceObjsJs, GenerateRectColliderJs, GenerateConvexPolygonColliderJs, ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs, main; + var $pkg = {}, $init, js, battle, resolv, sliceType, ptrType, sliceType$1, ptrType$1, ptrType$2, sliceType$2, ptrType$3, sliceType$3, ptrType$4, sliceType$4, ptrType$5, sliceType$5, funcType, funcType$1, funcType$2, funcType$3, funcType$4, funcType$5, funcType$6, funcType$7, funcType$8, funcType$9, funcType$10, ptrType$6, funcType$11, ptrType$7, ptrType$8, ptrType$9, mapType, mapType$1, funcType$12, funcType$13, mapType$2, NewInputFrameDownsync, NewRingBufferJs, NewCollisionSpaceJs, NewVec2DJs, NewPolygon2DJs, NewBarrierJs, NewPlayerDownsyncJs, NewMeleeBulletJs, NewRoomDownsyncFrameJs, GetCollisionSpaceObjsJs, GenerateRectColliderJs, GenerateConvexPolygonColliderJs, ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs, main; js = $packages["github.com/gopherjs/gopherjs/js"]; battle = $packages["jsexport/battle"]; resolv = $packages["resolv"]; @@ -5902,21 +5905,22 @@ $packages["jsexport"] = (function() { funcType$1 = $funcType([ptrType, sliceType$1], [ptrType$5], false); funcType$2 = $funcType([ptrType$1], [ptrType$5], false); funcType$3 = $funcType([$Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Bool, $Float64], [ptrType$5], false); - funcType$4 = $funcType([$Int32, sliceType$2, sliceType$3], [ptrType$5], false); - funcType$5 = $funcType([$Int, $Int, $Int, $Int], [ptrType$5], false); - funcType$6 = $funcType([$Int32, sliceType, $Uint64], [ptrType$5], false); - funcType$7 = $funcType([$Int32], [ptrType$5], false); - funcType$8 = $funcType([$Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $emptyInterface, $String], [ptrType$5], false); - funcType$9 = $funcType([ptrType$1, $Float64, $Float64, $emptyInterface, $String], [ptrType$5], false); + funcType$4 = $funcType([$Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Int32, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64], [ptrType$5], false); + funcType$5 = $funcType([$Int32, sliceType$2, sliceType$3], [ptrType$5], false); + funcType$6 = $funcType([$Int, $Int, $Int, $Int], [ptrType$5], false); + funcType$7 = $funcType([$Int32, sliceType, $Uint64], [ptrType$5], false); + funcType$8 = $funcType([$Int32], [ptrType$5], false); + funcType$9 = $funcType([$Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $emptyInterface, $String], [ptrType$5], false); + funcType$10 = $funcType([ptrType$1, $Float64, $Float64, $emptyInterface, $String], [ptrType$5], false); ptrType$6 = $ptrType(resolv.Space); - funcType$10 = $funcType([ptrType$6], [sliceType$5], false); + funcType$11 = $funcType([ptrType$6], [sliceType$5], false); ptrType$7 = $ptrType(battle.RingBuffer); ptrType$8 = $ptrType(battle.RoomDownsyncFrame); ptrType$9 = $ptrType(resolv.Object); mapType = $mapType($Int32, ptrType$9); mapType$1 = $mapType($Int, $Int); - funcType$11 = $funcType([ptrType$7, ptrType$8, ptrType$6, mapType, $Int32, $Int32, $Int32, $Int32, $Uint32, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, mapType$1], [ptrType$5], false); - funcType$12 = $funcType([$Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64], [$Float64, $Float64], false); + funcType$12 = $funcType([ptrType$7, ptrType$8, ptrType$6, mapType, $Int32, $Int32, $Int32, $Int32, $Uint32, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, mapType$1], [ptrType$5], false); + funcType$13 = $funcType([$Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64, $Float64], [$Float64, $Float64], false); mapType$2 = $mapType($String, $emptyInterface); NewInputFrameDownsync = function(inputFrameId, inputList, confirmedList) { var {$24r, _r, confirmedList, inputFrameId, inputList, $s, $r, $c} = $restore(this, {inputFrameId, inputList, confirmedList}); @@ -5969,10 +5973,15 @@ $packages["jsexport"] = (function() { return js.MakeWrapper(new battle.PlayerDownsync.ptr(id, virtualGridX, virtualGridY, dirX, dirY, velX, velY, speed, battleState, joinIndex, colliderRadius, false, 0, 0, 0, hp, maxHp, characterState, inAir)); }; $pkg.NewPlayerDownsyncJs = NewPlayerDownsyncJs; + NewMeleeBulletJs = function(battleLocalId, startupFrames, activeFrames, recoveryFrames, recoveryFramesOnBlock, recoveryFramesOnHit, hitStunFrames, blockStunFrames, releaseTriggerType, damage, offenderJoinIndex, offenderPlayerId, pushback, hitboxOffset, selfMoveforwardX, selfMoveforwardY, hitboxSizeX, hitboxSizeY) { + var activeFrames, battleLocalId, blockStunFrames, damage, hitStunFrames, hitboxOffset, hitboxSizeX, hitboxSizeY, offenderJoinIndex, offenderPlayerId, pushback, recoveryFrames, recoveryFramesOnBlock, recoveryFramesOnHit, releaseTriggerType, selfMoveforwardX, selfMoveforwardY, startupFrames; + return js.MakeWrapper(new battle.MeleeBullet.ptr(new battle.Bullet.ptr(battleLocalId, startupFrames, activeFrames, recoveryFrames, recoveryFramesOnBlock, recoveryFramesOnHit, hitboxOffset, 0, hitStunFrames, blockStunFrames, pushback, releaseTriggerType, damage, offenderJoinIndex, offenderPlayerId, selfMoveforwardX, selfMoveforwardY, hitboxSizeX, hitboxSizeY))); + }; + $pkg.NewMeleeBulletJs = NewMeleeBulletJs; NewRoomDownsyncFrameJs = function(id, playersArr, meleeBullets) { var {$24r, _r, id, meleeBullets, playersArr, $s, $r, $c} = $restore(this, {id, playersArr, meleeBullets}); /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0: - _r = js.MakeFullWrapper(new battle.RoomDownsyncFrame.ptr(id, playersArr, new $Int64(0, 0), meleeBullets, sliceType$4.nil, new $Uint64(0, 0), false)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r = js.MakeFullWrapper(new battle.RoomDownsyncFrame.ptr(id, playersArr, new $Int64(0, 0), meleeBullets, sliceType$4.nil, new $Uint64(0, 0), false, false)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $24r = _r; $s = 2; case 2: return $24r; /* */ } return; } var $f = {$blk: NewRoomDownsyncFrameJs, $c: true, $r, $24r, _r, id, meleeBullets, playersArr, $s};return $f; @@ -6028,7 +6037,7 @@ $packages["jsexport"] = (function() { }; $pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs = ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs; main = function() { - $global.gopkgs = $externalize($makeMap($String.keyFor, [{ k: "NewVec2DJs", v: new funcType(NewVec2DJs) }, { k: "NewPolygon2DJs", v: new funcType$1(NewPolygon2DJs) }, { k: "NewBarrierJs", v: new funcType$2(NewBarrierJs) }, { k: "NewPlayerDownsyncJs", v: new funcType$3(NewPlayerDownsyncJs) }, { k: "NewRoomDownsyncFrameJs", v: new funcType$4(NewRoomDownsyncFrameJs) }, { k: "NewCollisionSpaceJs", v: new funcType$5(NewCollisionSpaceJs) }, { k: "NewInputFrameDownsync", v: new funcType$6(NewInputFrameDownsync) }, { k: "NewRingBufferJs", v: new funcType$7(NewRingBufferJs) }, { k: "GenerateRectColliderJs", v: new funcType$8(GenerateRectColliderJs) }, { k: "GenerateConvexPolygonColliderJs", v: new funcType$9(GenerateConvexPolygonColliderJs) }, { k: "GetCollisionSpaceObjsJs", v: new funcType$10(GetCollisionSpaceObjsJs) }, { k: "ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs", v: new funcType$11(ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs) }, { k: "WorldToPolygonColliderBLPos", v: new funcType$12(battle.WorldToPolygonColliderBLPos) }, { k: "PolygonColliderBLToWorldPos", v: new funcType$12(battle.PolygonColliderBLToWorldPos) }]), mapType$2); + $global.gopkgs = $externalize($makeMap($String.keyFor, [{ k: "NewVec2DJs", v: new funcType(NewVec2DJs) }, { k: "NewPolygon2DJs", v: new funcType$1(NewPolygon2DJs) }, { k: "NewBarrierJs", v: new funcType$2(NewBarrierJs) }, { k: "NewPlayerDownsyncJs", v: new funcType$3(NewPlayerDownsyncJs) }, { k: "NewMeleeBulletJs", v: new funcType$4(NewMeleeBulletJs) }, { k: "NewRoomDownsyncFrameJs", v: new funcType$5(NewRoomDownsyncFrameJs) }, { k: "NewCollisionSpaceJs", v: new funcType$6(NewCollisionSpaceJs) }, { k: "NewInputFrameDownsync", v: new funcType$7(NewInputFrameDownsync) }, { k: "NewRingBufferJs", v: new funcType$8(NewRingBufferJs) }, { k: "GenerateRectColliderJs", v: new funcType$9(GenerateRectColliderJs) }, { k: "GenerateConvexPolygonColliderJs", v: new funcType$10(GenerateConvexPolygonColliderJs) }, { k: "GetCollisionSpaceObjsJs", v: new funcType$11(GetCollisionSpaceObjsJs) }, { k: "ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs", v: new funcType$12(ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs) }, { k: "WorldToPolygonColliderBLPos", v: new funcType$13(battle.WorldToPolygonColliderBLPos) }, { k: "PolygonColliderBLToWorldPos", v: new funcType$13(battle.PolygonColliderBLToWorldPos) }]), mapType$2); }; $init = function() { $pkg.$init = function() {}; diff --git a/frontend/assets/resources/pbfiles/room_downsync_frame.proto b/frontend/assets/resources/pbfiles/room_downsync_frame.proto index 1f0340c..f8cc68c 100644 --- a/frontend/assets/resources/pbfiles/room_downsync_frame.proto +++ b/frontend/assets/resources/pbfiles/room_downsync_frame.proto @@ -156,4 +156,5 @@ message RoomDownsyncFrame { repeated MeleeBullet meleeBullets = 4; // I don't know how to mimic inheritance/composition in protobuf by far, thus using an array for each type of bullet as a compromise uint64 backendUnconfirmedMask = 5; // Indexed by "joinIndex", same compression concern as stated in InputFrameDownsync bool shouldForceResync = 6; + map playerOpPatternToSkillId = 7; } diff --git a/frontend/assets/scenes/login.fire b/frontend/assets/scenes/login.fire index b6db529..76a6bfa 100644 --- a/frontend/assets/scenes/login.fire +++ b/frontend/assets/scenes/login.fire @@ -440,7 +440,7 @@ "array": [ 0, 0, - 210.2224973754617, + 216.50635094610968, 0, 0, 0, diff --git a/frontend/assets/scripts/Map.js b/frontend/assets/scripts/Map.js index aa52cee..f2c1d3f 100644 --- a/frontend/assets/scripts/Map.js +++ b/frontend/assets/scripts/Map.js @@ -403,7 +403,6 @@ cc.Class({ console.log(`Received parsedBattleColliderInfo via ws`); // TODO: Upon reconnection, the backend might have already been sending down data that'd trigger "onRoomDownsyncFrame & onInputFrameDownsyncBatch", but frontend could reject those data due to "battleState != PlayerBattleState.ACTIVE". Object.assign(self, parsedBattleColliderInfo); - self.gravityX = parsedBattleColliderInfo.gravityX; // to avoid integer default value 0 accidentally becoming null in "Object.assign(...)" self.tooFastDtIntervalMillis = 0.5 * self.rollbackEstimatedDtMillis; const tiledMapIns = self.node.getComponent(cc.TiledMap); @@ -504,7 +503,7 @@ cc.Class({ } self.selfPlayerInfo = JSON.parse(cc.sys.localStorage.getItem('selfPlayer')); Object.assign(self.selfPlayerInfo, { - id: self.selfPlayerInfo.playerId + Id: self.selfPlayerInfo.playerId }); const reqData = window.pb.protos.WsReq.encode({ @@ -627,6 +626,7 @@ cc.Class({ } // The logic below applies to (window.MAGIC_ROOM_DOWNSYNC_FRAME_ID.BATTLE_START == rdf.id || window.RING_BUFF_NON_CONSECUTIVE_SET == dumpRenderCacheRet) + self.playerOpPatternToSkillId = pbRdf.playerOpPatternToSkillId; self._initPlayerRichInfoDict(rdf.PlayersArr); // Show the top status indicators for IN_BATTLE @@ -744,14 +744,14 @@ cc.Class({ && null == firstPredictedYetIncorrectInputFrameId && - !self.equalInputLists(localInputFrame.inputList, inputFrameDownsync.inputList) + !self.equalInputLists(localInputFrame.InputList, inputFrameDownsync.inputList) ) { firstPredictedYetIncorrectInputFrameId = inputFrameDownsyncId; } inputFrameDownsync.confirmedList = (1 << self.playerRichInfoDict.size) - 1; - inputFrameDownsyncLocal = gopkgs.NewInputFrameDownsync(inputFrameDownsync.inputFrameId, inputFrameDownsync.inputList, inputFrameDownsync.confirmedList); // "battle.InputFrameDownsync" in "jsexport" + const inputFrameDownsyncLocal = gopkgs.NewInputFrameDownsync(inputFrameDownsync.inputFrameId, inputFrameDownsync.inputList, inputFrameDownsync.confirmedList); // "battle.InputFrameDownsync" in "jsexport" //console.log(`Confirmed inputFrameId=${inputFrameDownsync.inputFrameId}`); - const [ret, oldStFrameId, oldEdFrameId] = self.recentInputCache.SetByFrameId(inputFrameDownsync, inputFrameDownsync.inputFrameId); + const [ret, oldStFrameId, oldEdFrameId] = self.recentInputCache.SetByFrameId(inputFrameDownsyncLocal, inputFrameDownsync.inputFrameId); if (window.RING_BUFF_FAILED_TO_SET == ret) { throw `Failed to dump input cache (maybe recentInputCache too small)! inputFrameDownsync.inputFrameId=${inputFrameDownsync.inputFrameId}, lastAllConfirmedInputFrameId=${self.lastAllConfirmedInputFrameId}; recentRenderCache=${self._stringifyRecentRenderCache(false)}, recentInputCache=${self._stringifyRecentInputCache(false)}`; } 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 c757a40..80d2474 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 @@ -4601,7 +4601,6 @@ $root.protos = (function() { * @property {number|null} [virtualGridToWorldRatio] BattleColliderInfo virtualGridToWorldRatio * @property {number|null} [spAtkLookupFrames] BattleColliderInfo spAtkLookupFrames * @property {number|null} [renderCacheSize] BattleColliderInfo renderCacheSize - * @property {Object.|null} [meleeSkillConfig] BattleColliderInfo meleeSkillConfig * @property {number|null} [snapIntoPlatformOverlap] BattleColliderInfo snapIntoPlatformOverlap * @property {number|null} [snapIntoPlatformThreshold] BattleColliderInfo snapIntoPlatformThreshold * @property {number|null} [jumpingInitVelY] BattleColliderInfo jumpingInitVelY @@ -4620,7 +4619,6 @@ $root.protos = (function() { * @param {protos.IBattleColliderInfo=} [properties] Properties to set */ function BattleColliderInfo(properties) { - this.meleeSkillConfig = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4811,14 +4809,6 @@ $root.protos = (function() { */ BattleColliderInfo.prototype.renderCacheSize = 0; - /** - * BattleColliderInfo meleeSkillConfig. - * @member {Object.} meleeSkillConfig - * @memberof protos.BattleColliderInfo - * @instance - */ - BattleColliderInfo.prototype.meleeSkillConfig = $util.emptyObject; - /** * BattleColliderInfo snapIntoPlatformOverlap. * @member {number} snapIntoPlatformOverlap @@ -4945,23 +4935,18 @@ $root.protos = (function() { writer.uint32(/* id 22, wireType 0 =*/176).int32(message.spAtkLookupFrames); if (message.renderCacheSize != null && Object.hasOwnProperty.call(message, "renderCacheSize")) writer.uint32(/* id 23, wireType 0 =*/184).int32(message.renderCacheSize); - if (message.meleeSkillConfig != null && Object.hasOwnProperty.call(message, "meleeSkillConfig")) - for (var keys = Object.keys(message.meleeSkillConfig), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 24, wireType 2 =*/194).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); - $root.protos.MeleeBullet.encode(message.meleeSkillConfig[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } if (message.snapIntoPlatformOverlap != null && Object.hasOwnProperty.call(message, "snapIntoPlatformOverlap")) - writer.uint32(/* id 25, wireType 1 =*/201).double(message.snapIntoPlatformOverlap); + writer.uint32(/* id 24, wireType 1 =*/193).double(message.snapIntoPlatformOverlap); if (message.snapIntoPlatformThreshold != null && Object.hasOwnProperty.call(message, "snapIntoPlatformThreshold")) - writer.uint32(/* id 26, wireType 1 =*/209).double(message.snapIntoPlatformThreshold); + writer.uint32(/* id 25, wireType 1 =*/201).double(message.snapIntoPlatformThreshold); if (message.jumpingInitVelY != null && Object.hasOwnProperty.call(message, "jumpingInitVelY")) - writer.uint32(/* id 27, wireType 0 =*/216).int32(message.jumpingInitVelY); + writer.uint32(/* id 26, wireType 0 =*/208).int32(message.jumpingInitVelY); if (message.gravityX != null && Object.hasOwnProperty.call(message, "gravityX")) - writer.uint32(/* id 28, wireType 0 =*/224).int32(message.gravityX); + writer.uint32(/* id 27, wireType 0 =*/216).int32(message.gravityX); if (message.gravityY != null && Object.hasOwnProperty.call(message, "gravityY")) - writer.uint32(/* id 29, wireType 0 =*/232).int32(message.gravityY); + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.gravityY); if (message.collisionMinStep != null && Object.hasOwnProperty.call(message, "collisionMinStep")) - writer.uint32(/* id 30, wireType 0 =*/240).int32(message.collisionMinStep); + writer.uint32(/* id 29, wireType 0 =*/232).int32(message.collisionMinStep); if (message.frameDataLoggingEnabled != null && Object.hasOwnProperty.call(message, "frameDataLoggingEnabled")) writer.uint32(/* id 999, wireType 0 =*/7992).bool(message.frameDataLoggingEnabled); return writer; @@ -4994,7 +4979,7 @@ $root.protos = (function() { BattleColliderInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.BattleColliderInfo(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.BattleColliderInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5091,49 +5076,26 @@ $root.protos = (function() { break; } case 24: { - if (message.meleeSkillConfig === $util.emptyObject) - message.meleeSkillConfig = {}; - var end2 = reader.uint32() + reader.pos; - key = 0; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.int32(); - break; - case 2: - value = $root.protos.MeleeBullet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.meleeSkillConfig[key] = value; - break; - } - case 25: { message.snapIntoPlatformOverlap = reader.double(); break; } - case 26: { + case 25: { message.snapIntoPlatformThreshold = reader.double(); break; } - case 27: { + case 26: { message.jumpingInitVelY = reader.int32(); break; } - case 28: { + case 27: { message.gravityX = reader.int32(); break; } - case 29: { + case 28: { message.gravityY = reader.int32(); break; } - case 30: { + case 29: { message.collisionMinStep = reader.int32(); break; } @@ -5245,20 +5207,6 @@ $root.protos = (function() { if (message.renderCacheSize != null && message.hasOwnProperty("renderCacheSize")) if (!$util.isInteger(message.renderCacheSize)) return "renderCacheSize: integer expected"; - if (message.meleeSkillConfig != null && message.hasOwnProperty("meleeSkillConfig")) { - if (!$util.isObject(message.meleeSkillConfig)) - return "meleeSkillConfig: object expected"; - var key = Object.keys(message.meleeSkillConfig); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "meleeSkillConfig: integer key{k:int32} expected"; - { - var error = $root.protos.MeleeBullet.verify(message.meleeSkillConfig[key[i]]); - if (error) - return "meleeSkillConfig." + error; - } - } - } if (message.snapIntoPlatformOverlap != null && message.hasOwnProperty("snapIntoPlatformOverlap")) if (typeof message.snapIntoPlatformOverlap !== "number") return "snapIntoPlatformOverlap: number expected"; @@ -5355,16 +5303,6 @@ $root.protos = (function() { message.spAtkLookupFrames = object.spAtkLookupFrames | 0; if (object.renderCacheSize != null) message.renderCacheSize = object.renderCacheSize | 0; - if (object.meleeSkillConfig) { - if (typeof object.meleeSkillConfig !== "object") - throw TypeError(".protos.BattleColliderInfo.meleeSkillConfig: object expected"); - message.meleeSkillConfig = {}; - for (var keys = Object.keys(object.meleeSkillConfig), i = 0; i < keys.length; ++i) { - if (typeof object.meleeSkillConfig[keys[i]] !== "object") - throw TypeError(".protos.BattleColliderInfo.meleeSkillConfig: object expected"); - message.meleeSkillConfig[keys[i]] = $root.protos.MeleeBullet.fromObject(object.meleeSkillConfig[keys[i]]); - } - } if (object.snapIntoPlatformOverlap != null) message.snapIntoPlatformOverlap = Number(object.snapIntoPlatformOverlap); if (object.snapIntoPlatformThreshold != null) @@ -5395,8 +5333,6 @@ $root.protos = (function() { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.meleeSkillConfig = {}; if (options.defaults) { object.stageName = ""; object.stageDiscreteW = 0; @@ -5489,12 +5425,6 @@ $root.protos = (function() { object.spAtkLookupFrames = message.spAtkLookupFrames; if (message.renderCacheSize != null && message.hasOwnProperty("renderCacheSize")) object.renderCacheSize = message.renderCacheSize; - var keys2; - if (message.meleeSkillConfig && (keys2 = Object.keys(message.meleeSkillConfig)).length) { - object.meleeSkillConfig = {}; - for (var j = 0; j < keys2.length; ++j) - object.meleeSkillConfig[keys2[j]] = $root.protos.MeleeBullet.toObject(message.meleeSkillConfig[keys2[j]], options); - } if (message.snapIntoPlatformOverlap != null && message.hasOwnProperty("snapIntoPlatformOverlap")) object.snapIntoPlatformOverlap = options.json && !isFinite(message.snapIntoPlatformOverlap) ? String(message.snapIntoPlatformOverlap) : message.snapIntoPlatformOverlap; if (message.snapIntoPlatformThreshold != null && message.hasOwnProperty("snapIntoPlatformThreshold")) @@ -5553,6 +5483,7 @@ $root.protos = (function() { * @property {Array.|null} [meleeBullets] RoomDownsyncFrame meleeBullets * @property {number|Long|null} [backendUnconfirmedMask] RoomDownsyncFrame backendUnconfirmedMask * @property {boolean|null} [shouldForceResync] RoomDownsyncFrame shouldForceResync + * @property {Object.|null} [playerOpPatternToSkillId] RoomDownsyncFrame playerOpPatternToSkillId */ /** @@ -5566,6 +5497,7 @@ $root.protos = (function() { function RoomDownsyncFrame(properties) { this.playersArr = []; this.meleeBullets = []; + this.playerOpPatternToSkillId = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5620,6 +5552,14 @@ $root.protos = (function() { */ RoomDownsyncFrame.prototype.shouldForceResync = false; + /** + * RoomDownsyncFrame playerOpPatternToSkillId. + * @member {Object.} playerOpPatternToSkillId + * @memberof protos.RoomDownsyncFrame + * @instance + */ + RoomDownsyncFrame.prototype.playerOpPatternToSkillId = $util.emptyObject; + /** * Creates a new RoomDownsyncFrame instance using the specified properties. * @function create @@ -5658,6 +5598,9 @@ $root.protos = (function() { writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.backendUnconfirmedMask); if (message.shouldForceResync != null && Object.hasOwnProperty.call(message, "shouldForceResync")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.shouldForceResync); + if (message.playerOpPatternToSkillId != null && Object.hasOwnProperty.call(message, "playerOpPatternToSkillId")) + for (var keys = Object.keys(message.playerOpPatternToSkillId), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.playerOpPatternToSkillId[keys[i]]).ldelim(); return writer; }; @@ -5688,7 +5631,7 @@ $root.protos = (function() { RoomDownsyncFrame.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.RoomDownsyncFrame(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.RoomDownsyncFrame(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5720,6 +5663,29 @@ $root.protos = (function() { message.shouldForceResync = reader.bool(); break; } + case 7: { + if (message.playerOpPatternToSkillId === $util.emptyObject) + message.playerOpPatternToSkillId = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.int32(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.playerOpPatternToSkillId[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -5785,6 +5751,17 @@ $root.protos = (function() { if (message.shouldForceResync != null && message.hasOwnProperty("shouldForceResync")) if (typeof message.shouldForceResync !== "boolean") return "shouldForceResync: boolean expected"; + if (message.playerOpPatternToSkillId != null && message.hasOwnProperty("playerOpPatternToSkillId")) { + if (!$util.isObject(message.playerOpPatternToSkillId)) + return "playerOpPatternToSkillId: object expected"; + var key = Object.keys(message.playerOpPatternToSkillId); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "playerOpPatternToSkillId: integer key{k:int32} expected"; + if (!$util.isInteger(message.playerOpPatternToSkillId[key[i]])) + return "playerOpPatternToSkillId: integer{k:int32} expected"; + } + } return null; }; @@ -5842,6 +5819,13 @@ $root.protos = (function() { message.backendUnconfirmedMask = new $util.LongBits(object.backendUnconfirmedMask.low >>> 0, object.backendUnconfirmedMask.high >>> 0).toNumber(true); if (object.shouldForceResync != null) message.shouldForceResync = Boolean(object.shouldForceResync); + if (object.playerOpPatternToSkillId) { + if (typeof object.playerOpPatternToSkillId !== "object") + throw TypeError(".protos.RoomDownsyncFrame.playerOpPatternToSkillId: object expected"); + message.playerOpPatternToSkillId = {}; + for (var keys = Object.keys(object.playerOpPatternToSkillId), i = 0; i < keys.length; ++i) + message.playerOpPatternToSkillId[keys[i]] = object.playerOpPatternToSkillId[keys[i]] | 0; + } return message; }; @@ -5862,6 +5846,8 @@ $root.protos = (function() { object.playersArr = []; object.meleeBullets = []; } + if (options.objects || options.defaults) + object.playerOpPatternToSkillId = {}; if (options.defaults) { object.id = 0; if ($util.Long) { @@ -5900,6 +5886,12 @@ $root.protos = (function() { object.backendUnconfirmedMask = options.longs === String ? $util.Long.prototype.toString.call(message.backendUnconfirmedMask) : options.longs === Number ? new $util.LongBits(message.backendUnconfirmedMask.low >>> 0, message.backendUnconfirmedMask.high >>> 0).toNumber(true) : message.backendUnconfirmedMask; if (message.shouldForceResync != null && message.hasOwnProperty("shouldForceResync")) object.shouldForceResync = message.shouldForceResync; + var keys2; + if (message.playerOpPatternToSkillId && (keys2 = Object.keys(message.playerOpPatternToSkillId)).length) { + object.playerOpPatternToSkillId = {}; + for (var j = 0; j < keys2.length; ++j) + object.playerOpPatternToSkillId[keys2[j]] = message.playerOpPatternToSkillId[keys2[j]]; + } return object; }; diff --git a/jsexport/battle/room_downsync_frame.go b/jsexport/battle/room_downsync_frame.go index 1990338..3bc65a7 100644 --- a/jsexport/battle/room_downsync_frame.go +++ b/jsexport/battle/room_downsync_frame.go @@ -91,13 +91,14 @@ type FireballBullet struct { } type RoomDownsyncFrame struct { - Id int32 - PlayersArr []*PlayerDownsync - CountdownNanos int64 - MeleeBullets []*MeleeBullet - FireballBullets []*FireballBullet - BackendUnconfirmedMask uint64 - ShouldForceResync bool + Id int32 + PlayersArr []*PlayerDownsync + CountdownNanos int64 + MeleeBullets []*MeleeBullet + FireballBullets []*FireballBullet + BackendUnconfirmedMask uint64 + ShouldForceResync bool + PlayerOpPatternToSkillId map[int]int } type InputFrameDownsync struct { diff --git a/jsexport/main.go b/jsexport/main.go index 360b356..dd76919 100644 --- a/jsexport/main.go +++ b/jsexport/main.go @@ -62,6 +62,33 @@ func NewPlayerDownsyncJs(id, virtualGridX, virtualGridY, dirX, dirY, velX, velY, }) } +func NewMeleeBulletJs(battleLocalId, startupFrames, activeFrames, recoveryFrames, recoveryFramesOnBlock, recoveryFramesOnHit, hitStunFrames, blockStunFrames, releaseTriggerType, damage, offenderJoinIndex, offenderPlayerId int32, pushback, hitboxOffset, selfMoveforwardX, selfMoveforwardY, hitboxSizeX, hitboxSizeY float64) *js.Object { + return js.MakeWrapper(&MeleeBullet{ + Bullet: Bullet{ + BattleLocalId: battleLocalId, + StartupFrames: startupFrames, + ActiveFrames: activeFrames, + RecoveryFrames: recoveryFrames, + RecoveryFramesOnBlock: recoveryFramesOnBlock, + RecoveryFramesOnHit: recoveryFramesOnHit, + HitboxOffset: hitboxOffset, + HitStunFrames: hitStunFrames, + BlockStunFrames: blockStunFrames, + Pushback: pushback, + ReleaseTriggerType: releaseTriggerType, + Damage: damage, + + SelfMoveforwardX: selfMoveforwardX, + SelfMoveforwardY: selfMoveforwardY, + HitboxSizeX: hitboxSizeX, + HitboxSizeY: hitboxSizeY, + + OffenderJoinIndex: offenderJoinIndex, + OffenderPlayerId: offenderPlayerId, + }, + }) +} + func NewRoomDownsyncFrameJs(id int32, playersArr []*PlayerDownsync, meleeBullets []*MeleeBullet) *js.Object { // [WARNING] Avoid using "pb.RoomDownsyncFrame" here, in practive "MakeFullWrapper" doesn't expose the public fields for a "protobuf struct" as expected and requires helper functions like "GetCollisionSpaceObjsJs". return js.MakeFullWrapper(&RoomDownsyncFrame{ @@ -112,6 +139,7 @@ func main() { "NewPolygon2DJs": NewPolygon2DJs, "NewBarrierJs": NewBarrierJs, "NewPlayerDownsyncJs": NewPlayerDownsyncJs, + "NewMeleeBulletJs": NewMeleeBulletJs, "NewRoomDownsyncFrameJs": NewRoomDownsyncFrameJs, "NewCollisionSpaceJs": NewCollisionSpaceJs, "NewInputFrameDownsync": NewInputFrameDownsync,