Compare commits

...

10 Commits

Author SHA1 Message Date
genxium
360f2fc22b Simplified backend config loading. 2022-11-21 17:27:32 +08:00
yflu
2dbc529978 Fixes for jiggling character animation on resynced. 2022-11-21 00:23:01 +08:00
genxium
d21f59cafa Minor fix. 2022-11-20 21:07:45 +08:00
Wing
335fef66ef Merge pull request #7 from genxium/dungeon_characters
Updated anim of characters, and minor updates to inputs on wire to support atk button.
2022-11-20 20:18:44 +08:00
genxium
52480ab29f Updated TouchEventsManager to support input from Keyboard as well as an additional atk btn. 2022-11-20 20:13:08 +08:00
genxium
971f6461ab Updated charts. 2022-11-20 12:27:29 +08:00
genxium
061aa449c9 Fixes for online map class to use updated character animations. 2022-11-19 22:59:12 +08:00
genxium
78dd9ecd85 Initial commit for offline map, might break the online version. 2022-11-19 20:58:07 +08:00
yflu
d4226137b6 Initial draft of an offline map for testing new characters. 2022-11-17 23:39:32 +08:00
yflu
e432026fec Fixed proto_gen_shortcut script for OSX. 2022-11-17 23:13:53 +08:00
82 changed files with 2908 additions and 4098 deletions

View File

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

View File

@@ -4,6 +4,7 @@ import (
. "battle_srv/common"
"battle_srv/common/utils"
"battle_srv/models"
. "battle_srv/protos"
"battle_srv/storage"
. "dnmshared"
sq "github.com/Masterminds/squirrel"
@@ -71,7 +72,6 @@ func createMysqlData(rows *sqlx.Rows, v string) {
}
}
// 加上tableName参数, 用于pre_conf_data.sqlite里bot_player表的复用 --kobako
func maybeCreateNewPlayerFromBotTable(db *sqlx.DB, tableName string) {
var ls []*dbBotPlayer
err := db.Select(&ls, "SELECT name, magic_phone_country_code, magic_phone_num, display_name FROM "+tableName)
@@ -88,7 +88,6 @@ func maybeCreateNewPlayerFromBotTable(db *sqlx.DB, tableName string) {
panic(err)
}
query = storage.MySQLManagerIns.Rebind(query)
// existNames := make([]string, len(ls), len(ls))
var existPlayers []*models.Player
err = storage.MySQLManagerIns.Select(&existPlayers, query, args...)
if nil != err {
@@ -99,13 +98,11 @@ func maybeCreateNewPlayerFromBotTable(db *sqlx.DB, tableName string) {
var flag bool
for _, v := range existPlayers {
if botPlayer.Name == v.Name {
// 已有数据,合并处理
flag = true
break
}
}
if !flag {
// 找不到,新增
Logger.Debug("create", zap.Any(tableName, botPlayer))
err := createNewBotPlayer(botPlayer)
if err != nil {
@@ -120,11 +117,14 @@ func createNewBotPlayer(p *dbBotPlayer) error {
defer tx.Rollback()
now := utils.UnixtimeMilli()
player := models.Player{
CreatedAt: now,
UpdatedAt: now,
Name: p.Name,
DisplayName: p.DisplayName,
CreatedAt: now,
UpdatedAt: now,
PlayerDownsync: PlayerDownsync{
Name: p.Name,
DisplayName: p.DisplayName,
},
}
err := player.Insert(tx)
if err != nil {
return err

View File

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

View File

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

View File

@@ -1,11 +1,14 @@
package models
import (
"database/sql"
. "battle_srv/protos"
"battle_srv/storage"
. "dnmshared"
. "dnmshared/sharedprotos"
"fmt"
sq "github.com/Masterminds/squirrel"
"github.com/jmoiron/sqlx"
"go.uber.org/zap"
)
type PlayerBattleState struct {
@@ -33,12 +36,7 @@ func InitPlayerBattleStateIns() {
}
type Player struct {
// Meta info fields
Id int32 `json:"id,omitempty" db:"id"`
Name string `json:"name,omitempty" db:"name"`
DisplayName string `json:"displayName,omitempty" db:"display_name"`
Avatar string `json:"avatar,omitempty"`
ColliderRadius float64 `json:"-"`
PlayerDownsync
// DB only fields
CreatedAt int64 `db:"created_at"`
@@ -46,19 +44,10 @@ type Player struct {
DeletedAt NullInt64 `db:"deleted_at"`
TutorialStage int `db:"tutorial_stage"`
// in-battle info fields
VirtualGridX int32
VirtualGridY int32
Dir *Direction
Speed int32
BattleState int32
LastMoveGmtMillis int32
Score int32
Removed bool
JoinIndex int32
// other in-battle info fields
LastSentInputFrameId int32
AckingFrameId int32
AckingInputFrameId int32
LastSentInputFrameId int32
}
func ExistPlayerByName(name string) (bool, error) {
@@ -74,15 +63,48 @@ func GetPlayerById(id int) (*Player, error) {
}
func getPlayer(cond sq.Eq) (*Player, error) {
var p Player
err := getObj("player", cond, &p)
if err == sql.ErrNoRows {
return nil, nil
p := Player{}
pd := PlayerDownsync{
Dir: &Direction{
Dx: 0,
Dy: 0,
},
}
p.Dir = &Direction{
Dx: 0,
Dy: 0,
query, args, err := sq.Select("*").From("player").Where(cond).Limit(1).ToSql()
if err != nil {
return nil, err
}
rows, err := storage.MySQLManagerIns.Queryx(query, args...)
if err != nil {
return nil, err
}
cols, err := rows.Columns()
if nil != err {
panic(err)
}
for rows.Next() {
// TODO: Do it more elegantly, but by now I don't have time to learn reflection of Golang
vals := rowValues(rows, cols)
for i, col := range cols {
val := *vals[i].(*interface{})
if "id" == col {
pd.Id = int32(val.(int64))
}
if "name" == col {
switch v := val.(type) {
case []byte:
pd.Name = string(v)
default:
pd.Name = fmt.Sprintf("%v", v)
}
}
if "created_at" == col {
p.CreatedAt = int64(val.(int64))
}
}
Logger.Info("Queried player from db", zap.Any("cond", cond), zap.Any("p", p), zap.Any("pd", pd), zap.Any("cols", cols), zap.Any("rowValues", vals))
}
p.PlayerDownsync = pd
return &p, nil
}
@@ -113,8 +135,6 @@ func Update(tx *sqlx.Tx, id int32, p *Player) (bool, error) {
}
result, err := tx.Exec(query, args...)
if err != nil {
fmt.Println("ERRRRRRR: ")
fmt.Println(err)
return false, err
}
rowsAffected, err := result.RowsAffected()

View File

@@ -10,6 +10,17 @@ import (
"go.uber.org/zap"
)
func rowValues(rows *sqlx.Rows, cols []string) []interface{} {
results := make([]interface{}, len(cols))
for i := range results {
results[i] = new(interface{})
}
if err := rows.Scan(results[:]...); err != nil {
panic(err)
}
return results
}
func exist(t string, cond sq.Eq) (bool, error) {
c, err := getCount(t, cond)
if err != nil {

View File

@@ -160,23 +160,12 @@ 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
RollbackEstimatedDtMillis float64
RollbackEstimatedDtNanos int64
LastRenderFrameIdTriggeredAt int64
WorldToVirtualGridRatio float64
VirtualGridToWorldRatio float64
BackendDynamicsEnabled bool
LastRenderFrameIdTriggeredAt int64
PlayerDefaultSpeed int32
PlayerDefaultSpeed int32
StageName string
StageDiscreteW int32
StageDiscreteH int32
StageTileW int32
StageTileH int32
RawBattleStrToVec2DListMap StrToVec2DListMap
RawBattleStrToPolygon2DListMap StrToPolygon2DListMap
BackendDynamicsEnabled bool
BattleColliderInfo // Compositing to send centralized magic numbers
}
func (pR *Room) updateScore() {
@@ -297,7 +286,7 @@ func (pR *Room) ChooseStage() error {
DeserializeTsxToColliderDict(pTmxMapIns, byteArrOfTsxFile, int(tileset.FirstGid), gidBoundariesMapInB2World)
}
stageDiscreteW, stageDiscreteH, stageTileW, stageTileH, toRetStrToVec2DListMap, toRetStrToPolygon2DListMap, err := ParseTmxLayersAndGroups(pTmxMapIns, gidBoundariesMapInB2World)
stageDiscreteW, stageDiscreteH, stageTileW, stageTileH, strToVec2DListMap, strToPolygon2DListMap, err := ParseTmxLayersAndGroups(pTmxMapIns, gidBoundariesMapInB2World)
if nil != err {
panic(err)
}
@@ -306,10 +295,10 @@ func (pR *Room) ChooseStage() error {
pR.StageDiscreteH = stageDiscreteH
pR.StageTileW = stageTileW
pR.StageTileH = stageTileH
pR.RawBattleStrToVec2DListMap = toRetStrToVec2DListMap
pR.RawBattleStrToPolygon2DListMap = toRetStrToPolygon2DListMap
pR.StrToVec2DListMap = strToVec2DListMap
pR.StrToPolygon2DListMap = strToPolygon2DListMap
barrierPolygon2DList := *(toRetStrToPolygon2DListMap["Barrier"])
barrierPolygon2DList := *(strToPolygon2DListMap["Barrier"])
var barrierLocalIdInBattle int32 = 0
for _, polygon2DUnaligned := range barrierPolygon2DList.Eles {
@@ -345,13 +334,6 @@ func (pR *Room) ConvertToLastUsedRenderFrameId(inputFrameId int32, inputDelayFra
return ((inputFrameId << pR.InputScaleFrames) + inputDelayFrames + (1 << pR.InputScaleFrames) - 1)
}
func (pR *Room) EncodeUpsyncCmd(upsyncCmd *InputFrameUpsync) uint64 {
var ret uint64 = 0
// There're 13 possible directions, occupying the first 4 bits, no need to shift
ret += uint64(upsyncCmd.EncodedDir)
return ret
}
func (pR *Room) RenderFrameBufferString() string {
return fmt.Sprintf("{renderFrameId: %d, stRenderFrameId: %d, edRenderFrameId: %d, lastAllConfirmedRenderFrameId: %d}", pR.RenderFrameId, pR.RenderFrameBuffer.StFrameId, pR.RenderFrameBuffer.EdFrameId, pR.CurDynamicsRenderFrameId)
}
@@ -393,7 +375,7 @@ func (pR *Room) StartBattle() {
pR.CurDynamicsRenderFrameId = 0
kickoffFrame := &RoomDownsyncFrame{
Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players),
Players: toPbPlayers(pR.Players, false),
CountdownNanos: pR.BattleDurationNanos,
}
pR.RenderFrameBuffer.Put(kickoffFrame)
@@ -537,8 +519,8 @@ func (pR *Room) StartBattle() {
2. reconnection
*/
shouldResync1 := (MAGIC_LAST_SENT_INPUT_FRAME_ID_READDED == player.LastSentInputFrameId)
// shouldResync2 := (0 < (unconfirmedMask & uint64(1 << uint32(player.JoinIndex-1)))) // This condition is critical, if we don't send resync upon this condition, the "reconnected or slowly-clocking player" might never get its input synced
shouldResync2 := (0 < unconfirmedMask) // An easier version of the above, might keep sending "refRenderFrame"s to still connected players when any player is disconnected
shouldResync2 := (0 < (unconfirmedMask & uint64(1<<uint32(player.JoinIndex-1)))) // This condition is critical, if we don't send resync upon this condition, the "reconnected or slowly-clocking player" might never get its input synced
// shouldResync2 := (0 < unconfirmedMask) // An easier version of the above, might keep sending "refRenderFrame"s to still connected players when any player is disconnected
if pR.BackendDynamicsEnabled && (shouldResync1 || shouldResync2) {
tmp := pR.RenderFrameBuffer.GetByFrameId(refRenderFrameId)
if nil == tmp {
@@ -560,26 +542,29 @@ func (pR *Room) StartBattle() {
}
}
toApplyInputFrameId := pR.ConvertToInputFrameId(refRenderFrameId, pR.InputDelayFrames)
minToKeepInputFrameId := pR.ConvertToInputFrameId(refRenderFrameId, pR.InputDelayFrames) - pR.SpAtkLookupFrames
/*
[WARNING]
The following updates to "toApplyInputFrameId" is necessary because when "false == pR.BackendDynamicsEnabled", the variable "refRenderFrameId" is not well defined.
The following updates to "minToKeepInputFrameId" is necessary because when "false == pR.BackendDynamicsEnabled", the variable "refRenderFrameId" is not well defined.
*/
minLastSentInputFrameId := int32(math.MaxInt32)
for _, player := range pR.Players {
if PlayerBattleStateIns.ACTIVE != player.BattleState {
continue
}
if player.LastSentInputFrameId >= minLastSentInputFrameId {
continue
}
minLastSentInputFrameId = player.LastSentInputFrameId
}
if minLastSentInputFrameId < toApplyInputFrameId {
toApplyInputFrameId = minLastSentInputFrameId
if minLastSentInputFrameId < minToKeepInputFrameId {
minToKeepInputFrameId = minLastSentInputFrameId
}
for pR.InputsBuffer.N < pR.InputsBuffer.Cnt || (0 < pR.InputsBuffer.Cnt && pR.InputsBuffer.StFrameId < toApplyInputFrameId) {
for pR.InputsBuffer.N < pR.InputsBuffer.Cnt || (0 < pR.InputsBuffer.Cnt && pR.InputsBuffer.StFrameId < minToKeepInputFrameId) {
f := pR.InputsBuffer.Pop().(*InputFrameDownsync)
if pR.inputFrameIdDebuggable(f.InputFrameId) {
// Popping of an "inputFrame" would be AFTER its being all being confirmed, because it requires the "inputFrame" to be all acked
Logger.Debug("inputFrame lifecycle#4[popped]:", zap.Any("roomId", pR.Id), zap.Any("inputFrameId", f.InputFrameId), zap.Any("toApplyInputFrameId", toApplyInputFrameId), zap.Any("InputsBuffer", pR.InputsBufferString(false)))
Logger.Debug("inputFrame lifecycle#4[popped]:", zap.Any("roomId", pR.Id), zap.Any("inputFrameId", f.InputFrameId), zap.Any("minToKeepInputFrameId", minToKeepInputFrameId), zap.Any("InputsBuffer", pR.InputsBufferString(false)))
}
}
@@ -684,7 +669,7 @@ func (pR *Room) StopBattleForSettlement() {
for playerId, _ := range pR.Players {
assembledFrame := RoomDownsyncFrame{
Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players),
Players: toPbPlayers(pR.Players, false),
CountdownNanos: -1, // TODO: Replace this magic constant!
}
pR.sendSafely(&assembledFrame, nil, DOWNSYNC_MSG_ACT_BATTLE_STOPPED, playerId)
@@ -708,22 +693,9 @@ func (pR *Room) onBattlePrepare(cb BattleStartCbType) {
pR.State = RoomBattleStateIns.PREPARE
Logger.Info("Battle state transitted to RoomBattleStateIns.PREPARE for:", zap.Any("roomId", pR.Id))
playerMetas := make(map[int32]*PlayerDownsyncMeta, 0)
for _, player := range pR.Players {
playerMetas[player.Id] = &PlayerDownsyncMeta{
Id: player.Id,
Name: player.Name,
DisplayName: player.DisplayName,
Avatar: player.Avatar,
ColliderRadius: player.ColliderRadius, // hardcoded for now
JoinIndex: player.JoinIndex,
}
}
battleReadyToStartFrame := &RoomDownsyncFrame{
Id: DOWNSYNC_MSG_ACT_BATTLE_READY_TO_START,
Players: toPbPlayers(pR.Players),
PlayerMetas: playerMetas,
Players: toPbPlayers(pR.Players, true),
CountdownNanos: pR.BattleDurationNanos,
}
@@ -792,6 +764,7 @@ 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.WorldToVirtualGridRatio = float64(1000)
pR.VirtualGridToWorldRatio = float64(1.0) / pR.WorldToVirtualGridRatio // this is a one-off computation, should avoid division in iterations
pR.SpAtkLookupFrames = 5
pR.PlayerDefaultSpeed = int32(float64(2) * pR.WorldToVirtualGridRatio) // in virtual grids per frame
pR.Players = make(map[int32]*Player)
pR.PlayersArr = make([]*Player, pR.Capacity)
@@ -819,7 +792,7 @@ func (pR *Room) OnDismissed() {
pR.BattleDurationFrames = 30 * pR.ServerFps
pR.BattleDurationNanos = int64(pR.BattleDurationFrames) * (pR.RollbackEstimatedDtNanos + 1)
pR.InputFrameUpsyncDelayTolerance = 2
pR.MaxChasingRenderFramesPerUpdate = 5
pR.MaxChasingRenderFramesPerUpdate = 8
pR.BackendDynamicsEnabled = true // [WARNING] When "false", recovery upon reconnection wouldn't work!
@@ -931,7 +904,7 @@ func (pR *Room) onPlayerAdded(playerId int32) {
pR.JoinIndexBooleanArr[index] = true
// Lazily assign the initial position of "Player" for "RoomDownsyncFrame".
playerPosList := *(pR.RawBattleStrToVec2DListMap["PlayerStartingPos"])
playerPosList := *(pR.StrToVec2DListMap["PlayerStartingPos"])
if index > len(playerPosList.Eles) {
panic(fmt.Sprintf("onPlayerAdded error, index >= len(playerPosList), roomId=%v, playerId=%v, roomState=%v, roomEffectivePlayerCount=%v", pR.Id, playerId, pR.State, pR.EffectivePlayerCount))
}
@@ -968,18 +941,6 @@ func (pR *Room) OnPlayerBattleColliderAcked(playerId int32) bool {
return false
}
playerMetas := make(map[int32]*PlayerDownsyncMeta, 0)
for _, eachPlayer := range pR.Players {
playerMetas[eachPlayer.Id] = &PlayerDownsyncMeta{
Id: eachPlayer.Id,
Name: eachPlayer.Name,
DisplayName: eachPlayer.DisplayName,
Avatar: eachPlayer.Avatar,
JoinIndex: eachPlayer.JoinIndex,
ColliderRadius: eachPlayer.ColliderRadius,
}
}
// Broadcast added or readded player info to all players in the same room
for _, eachPlayer := range pR.Players {
/*
@@ -993,16 +954,14 @@ func (pR *Room) OnPlayerBattleColliderAcked(playerId int32) bool {
switch targetPlayer.BattleState {
case PlayerBattleStateIns.ADDED_PENDING_BATTLE_COLLIDER_ACK:
playerAckedFrame := &RoomDownsyncFrame{
Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players),
PlayerMetas: playerMetas,
Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players, true),
}
pR.sendSafely(playerAckedFrame, nil, DOWNSYNC_MSG_ACT_PLAYER_ADDED_AND_ACKED, eachPlayer.Id)
case PlayerBattleStateIns.READDED_PENDING_BATTLE_COLLIDER_ACK:
playerAckedFrame := &RoomDownsyncFrame{
Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players),
PlayerMetas: playerMetas,
Id: pR.RenderFrameId,
Players: toPbPlayers(pR.Players, true),
}
pR.sendSafely(playerAckedFrame, nil, DOWNSYNC_MSG_ACT_PLAYER_READDED_AND_ACKED, eachPlayer.Id)
default:
@@ -1073,7 +1032,7 @@ func (pR *Room) prefabInputFrameDownsync(inputFrameId int32) *InputFrameDownsync
ConfirmedList: uint64(0),
}
} else {
tmp := pR.InputsBuffer.GetByFrameId(inputFrameId - 1)
tmp := pR.InputsBuffer.GetByFrameId(inputFrameId - 1) // There's no need for the backend to find the "lastAllConfirmed inputs" for prefabbing, either "BackendDynamicsEnabled" is true or false
if nil == tmp {
panic(fmt.Sprintf("Error prefabbing inputFrameDownsync: roomId=%v, InputsBuffer=%v", pR.Id, pR.InputsBufferString(false)))
}
@@ -1092,15 +1051,9 @@ func (pR *Room) prefabInputFrameDownsync(inputFrameId int32) *InputFrameDownsync
func (pR *Room) markConfirmationIfApplicable() {
inputFrameId1 := pR.LastAllConfirmedInputFrameId + 1
gap := int32(4) // This value is hardcoded and doesn't need be much bigger, because the backend side is supposed to never lag when "false == BackendDynamicsEnabled".
inputFrameId2 := inputFrameId1 + gap
if inputFrameId2 > pR.InputsBuffer.EdFrameId {
inputFrameId2 = pR.InputsBuffer.EdFrameId
}
totPlayerCnt := uint32(pR.Capacity)
allConfirmedMask := uint64((1 << totPlayerCnt) - 1)
for inputFrameId := inputFrameId1; inputFrameId < inputFrameId2; inputFrameId++ {
for inputFrameId := inputFrameId1; inputFrameId < pR.InputsBuffer.EdFrameId; inputFrameId++ {
tmp := pR.InputsBuffer.GetByFrameId(inputFrameId)
if nil == tmp {
panic(fmt.Sprintf("inputFrameId=%v doesn't exist for roomId=%v, this is abnormal because the server should prefab inputFrameDownsync in a most advanced pace, check the prefab logic! InputsBuffer=%v", inputFrameId, pR.Id, pR.InputsBufferString(false)))
@@ -1114,7 +1067,7 @@ func (pR *Room) markConfirmationIfApplicable() {
}
inputFrameUpsync := tmp.(*InputFrameUpsync)
indiceInJoinIndexBooleanArr := uint32(player.JoinIndex - 1)
inputFrameDownsync.InputList[indiceInJoinIndexBooleanArr] = pR.EncodeUpsyncCmd(inputFrameUpsync)
inputFrameDownsync.InputList[indiceInJoinIndexBooleanArr] = inputFrameUpsync.Encoded
inputFrameDownsync.ConfirmedList |= (1 << indiceInJoinIndexBooleanArr)
}
@@ -1239,9 +1192,8 @@ func (pR *Room) applyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputF
joinIndex := player.JoinIndex
effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y = float64(0), float64(0)
currPlayerDownsync := currRenderFrame.Players[playerId]
encodedInput := inputList[joinIndex-1]
decodedInput := DIRECTION_DECODER[encodedInput]
proposedVirtualGridDx, proposedVirtualGridDy := (decodedInput[0] + decodedInput[0]*currPlayerDownsync.Speed), (decodedInput[1] + decodedInput[1]*currPlayerDownsync.Speed)
decodedInput := pR.decodeInput(inputList[joinIndex-1])
proposedVirtualGridDx, proposedVirtualGridDy := (decodedInput.Dx + decodedInput.Dx*currPlayerDownsync.Speed), (decodedInput.Dy + decodedInput.Dy*currPlayerDownsync.Speed)
newVx, newVy := (currPlayerDownsync.VirtualGridX + proposedVirtualGridDx), (currPlayerDownsync.VirtualGridY + proposedVirtualGridDy)
// Reset playerCollider position from the "virtual grid position"
collisionPlayerIndex := COLLISION_PLAYER_INDEX_PREFIX + joinIndex
@@ -1250,11 +1202,9 @@ func (pR *Room) applyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputF
// Update in the collision system
playerCollider.Update()
if 0 < encodedInput {
Logger.Debug(fmt.Sprintf("Checking collision for playerId=%v: virtual (%d, %d) -> (%d, %d), now playerShape=%v", playerId, currPlayerDownsync.VirtualGridX, currPlayerDownsync.VirtualGridY, newVx, newVy, ConvexPolygonStr(playerCollider.Shape.(*resolv.ConvexPolygon))))
nextRenderFramePlayers[playerId].Dir.Dx = decodedInput[0]
nextRenderFramePlayers[playerId].Dir.Dy = decodedInput[1]
if 0 != decodedInput.Dx || 0 != decodedInput.Dy {
nextRenderFramePlayers[playerId].Dir.Dx = decodedInput.Dx
nextRenderFramePlayers[playerId].Dir.Dy = decodedInput.Dy
}
}
@@ -1289,12 +1239,22 @@ func (pR *Room) applyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputF
nextRenderFramePlayers[playerId].VirtualGridY = newVy
}
Logger.Debug(fmt.Sprintf("After applyInputFrameDownsyncDynamicsOnSingleRenderFrame: currRenderFrame.Id=%v, inputList=%v, currRenderFrame.Players=%v, nextRenderFramePlayers=%v, toRet.Players=%v", currRenderFrame.Id, inputList, currRenderFrame.Players, nextRenderFramePlayers, toRet.Players))
Logger.Debug(fmt.Sprintf("After applyInputFrameDownsyncDynamicsOnSingleRenderFrame: currRenderFrame.Id=%v, inputList=%v, currRenderFrame.Players=%v, nextRenderFramePlayers=%v", currRenderFrame.Id, inputList, currRenderFrame.Players, nextRenderFramePlayers))
}
return toRet
}
func (pR *Room) decodeInput(encodedInput uint64) *InputFrameDecoded {
encodedDirection := (encodedInput & uint64(15))
btnALevel := int32((encodedInput >> 4) & 1)
return &InputFrameDecoded{
Dx: DIRECTION_DECODER[encodedDirection][0],
Dy: DIRECTION_DECODER[encodedDirection][1],
BtnALevel: btnALevel,
}
}
func (pR *Room) inputFrameIdDebuggable(inputFrameId int32) bool {
return 0 == (inputFrameId % 10)
}

View File

@@ -48,6 +48,7 @@ type BattleColliderInfo struct {
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"`
SpAtkLookupFrames int32 `protobuf:"varint,23,opt,name=spAtkLookupFrames,proto3" json:"spAtkLookupFrames,omitempty"`
}
func (x *BattleColliderInfo) Reset() {
@@ -236,6 +237,13 @@ func (x *BattleColliderInfo) GetVirtualGridToWorldRatio() float64 {
return 0
}
func (x *BattleColliderInfo) GetSpAtkLookupFrames() int32 {
if x != nil {
return x.SpAtkLookupFrames
}
return 0
}
type PlayerDownsync struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -247,10 +255,14 @@ type PlayerDownsync struct {
Dir *sharedprotos.Direction `protobuf:"bytes,4,opt,name=dir,proto3" json:"dir,omitempty"`
Speed int32 `protobuf:"varint,5,opt,name=speed,proto3" json:"speed,omitempty"` // in terms of virtual grid units
BattleState int32 `protobuf:"varint,6,opt,name=battleState,proto3" json:"battleState,omitempty"`
LastMoveGmtMillis int32 `protobuf:"varint,7,opt,name=lastMoveGmtMillis,proto3" json:"lastMoveGmtMillis,omitempty"`
JoinIndex int32 `protobuf:"varint,7,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"`
ColliderRadius float64 `protobuf:"fixed64,8,opt,name=colliderRadius,proto3" json:"colliderRadius,omitempty"`
Removed bool `protobuf:"varint,9,opt,name=removed,proto3" json:"removed,omitempty"`
Score int32 `protobuf:"varint,10,opt,name=score,proto3" json:"score,omitempty"`
Removed bool `protobuf:"varint,11,opt,name=removed,proto3" json:"removed,omitempty"`
JoinIndex int32 `protobuf:"varint,12,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"`
LastMoveGmtMillis int32 `protobuf:"varint,11,opt,name=lastMoveGmtMillis,proto3" json:"lastMoveGmtMillis,omitempty"`
Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"`
DisplayName string `protobuf:"bytes,13,opt,name=displayName,proto3" json:"displayName,omitempty"`
Avatar string `protobuf:"bytes,14,opt,name=avatar,proto3" json:"avatar,omitempty"`
}
func (x *PlayerDownsync) Reset() {
@@ -327,16 +339,16 @@ func (x *PlayerDownsync) GetBattleState() int32 {
return 0
}
func (x *PlayerDownsync) GetLastMoveGmtMillis() int32 {
func (x *PlayerDownsync) GetJoinIndex() int32 {
if x != nil {
return x.LastMoveGmtMillis
return x.JoinIndex
}
return 0
}
func (x *PlayerDownsync) GetScore() int32 {
func (x *PlayerDownsync) GetColliderRadius() float64 {
if x != nil {
return x.Score
return x.ColliderRadius
}
return 0
}
@@ -348,28 +360,53 @@ func (x *PlayerDownsync) GetRemoved() bool {
return false
}
func (x *PlayerDownsync) GetJoinIndex() int32 {
func (x *PlayerDownsync) GetScore() int32 {
if x != nil {
return x.JoinIndex
return x.Score
}
return 0
}
type PlayerDownsyncMeta struct {
func (x *PlayerDownsync) GetLastMoveGmtMillis() int32 {
if x != nil {
return x.LastMoveGmtMillis
}
return 0
}
func (x *PlayerDownsync) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *PlayerDownsync) GetDisplayName() string {
if x != nil {
return x.DisplayName
}
return ""
}
func (x *PlayerDownsync) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
type InputFrameDecoded struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
DisplayName string `protobuf:"bytes,3,opt,name=displayName,proto3" json:"displayName,omitempty"`
Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"`
JoinIndex int32 `protobuf:"varint,5,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"`
ColliderRadius float64 `protobuf:"fixed64,6,opt,name=colliderRadius,proto3" json:"colliderRadius,omitempty"`
Dx int32 `protobuf:"varint,1,opt,name=dx,proto3" json:"dx,omitempty"`
Dy int32 `protobuf:"varint,2,opt,name=dy,proto3" json:"dy,omitempty"`
BtnALevel int32 `protobuf:"varint,3,opt,name=btnALevel,proto3" json:"btnALevel,omitempty"`
}
func (x *PlayerDownsyncMeta) Reset() {
*x = PlayerDownsyncMeta{}
func (x *InputFrameDecoded) Reset() {
*x = InputFrameDecoded{}
if protoimpl.UnsafeEnabled {
mi := &file_room_downsync_frame_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -377,13 +414,13 @@ func (x *PlayerDownsyncMeta) Reset() {
}
}
func (x *PlayerDownsyncMeta) String() string {
func (x *InputFrameDecoded) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PlayerDownsyncMeta) ProtoMessage() {}
func (*InputFrameDecoded) ProtoMessage() {}
func (x *PlayerDownsyncMeta) ProtoReflect() protoreflect.Message {
func (x *InputFrameDecoded) ProtoReflect() protoreflect.Message {
mi := &file_room_downsync_frame_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -395,49 +432,28 @@ func (x *PlayerDownsyncMeta) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use PlayerDownsyncMeta.ProtoReflect.Descriptor instead.
func (*PlayerDownsyncMeta) Descriptor() ([]byte, []int) {
// Deprecated: Use InputFrameDecoded.ProtoReflect.Descriptor instead.
func (*InputFrameDecoded) Descriptor() ([]byte, []int) {
return file_room_downsync_frame_proto_rawDescGZIP(), []int{2}
}
func (x *PlayerDownsyncMeta) GetId() int32 {
func (x *InputFrameDecoded) GetDx() int32 {
if x != nil {
return x.Id
return x.Dx
}
return 0
}
func (x *PlayerDownsyncMeta) GetName() string {
func (x *InputFrameDecoded) GetDy() int32 {
if x != nil {
return x.Name
}
return ""
}
func (x *PlayerDownsyncMeta) GetDisplayName() string {
if x != nil {
return x.DisplayName
}
return ""
}
func (x *PlayerDownsyncMeta) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *PlayerDownsyncMeta) GetJoinIndex() int32 {
if x != nil {
return x.JoinIndex
return x.Dy
}
return 0
}
func (x *PlayerDownsyncMeta) GetColliderRadius() float64 {
func (x *InputFrameDecoded) GetBtnALevel() int32 {
if x != nil {
return x.ColliderRadius
return x.BtnALevel
}
return 0
}
@@ -447,8 +463,8 @@ type InputFrameUpsync struct {
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"`
InputFrameId int32 `protobuf:"varint,1,opt,name=inputFrameId,proto3" json:"inputFrameId,omitempty"`
Encoded uint64 `protobuf:"varint,2,opt,name=encoded,proto3" json:"encoded,omitempty"`
}
func (x *InputFrameUpsync) Reset() {
@@ -490,9 +506,9 @@ func (x *InputFrameUpsync) GetInputFrameId() int32 {
return 0
}
func (x *InputFrameUpsync) GetEncodedDir() int32 {
func (x *InputFrameUpsync) GetEncoded() uint64 {
if x != nil {
return x.EncodedDir
return x.Encoded
}
return 0
}
@@ -612,10 +628,9 @@ type RoomDownsyncFrame struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Players map[int32]*PlayerDownsync `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"`
PlayerMetas map[int32]*PlayerDownsyncMeta `protobuf:"bytes,4,rep,name=playerMetas,proto3" json:"playerMetas,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Players map[int32]*PlayerDownsync `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"`
}
func (x *RoomDownsyncFrame) Reset() {
@@ -671,13 +686,6 @@ func (x *RoomDownsyncFrame) GetCountdownNanos() int64 {
return 0
}
func (x *RoomDownsyncFrame) GetPlayerMetas() map[int32]*PlayerDownsyncMeta {
if x != nil {
return x.PlayerMetas
}
return nil
}
type WsReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -874,7 +882,7 @@ 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, 0xd4, 0x0a, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f,
0x6f, 0x74, 0x6f, 0x22, 0x82, 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, 0x5f, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x54,
@@ -947,132 +955,124 @@ var file_room_downsync_frame_proto_rawDesc = []byte{
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, 0x5d, 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, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x17, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 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, 0x65, 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, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x73, 0x2e, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc7, 0x02, 0x0a, 0x0e, 0x50,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a,
0x0c, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x58, 0x18, 0x02, 0x20,
0x01, 0x28, 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, 0x29, 0x0a, 0x03, 0x64, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 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, 0xb8, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44,
0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69,
0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f,
0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x69,
0x64, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52,
0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x22,
0x56, 0x0a, 0x10, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x70, 0x41, 0x74, 0x6b, 0x4c, 0x6f, 0x6f,
0x6b, 0x75, 0x70, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x05, 0x52,
0x11, 0x73, 0x70, 0x41, 0x74, 0x6b, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x46, 0x72, 0x61, 0x6d,
0x65, 0x73, 0x1a, 0x5d, 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, 0x2d,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 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, 0x65, 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, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1b, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e,
0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x32, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbd, 0x03, 0x0a, 0x0e, 0x50, 0x6c, 0x61,
0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x76,
0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x58, 0x18, 0x02, 0x20, 0x01, 0x28,
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, 0x29, 0x0a, 0x03, 0x64, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x17, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 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, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e,
0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49,
0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72,
0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x63, 0x6f,
0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07,
0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72,
0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x11,
0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69,
0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76,
0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20,
0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x51, 0x0a, 0x11, 0x49, 0x6e, 0x70, 0x75,
0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x0e, 0x0a,
0x02, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x78, 0x12, 0x0e, 0x0a,
0x02, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x79, 0x12, 0x1c, 0x0a,
0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x09, 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x50, 0x0a, 0x10, 0x49,
0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x12,
0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d,
0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x22, 0x7c, 0x0a,
0x12, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73,
0x79, 0x6e, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d,
0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74,
0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 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, 0x8b, 0x03, 0x0a, 0x11, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73,
0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79,
0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46,
0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01,
0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e,
0x6f, 0x73, 0x12, 0x4c, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61,
0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73,
0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61,
0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x73,
0x1a, 0x52, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65,
0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5a, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4d, 0x65,
0x74, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74,
0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75,
0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d,
0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x0f, 0x48,
0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x28,
0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54,
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x52, 0x6f, 0x6f,
0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x40,
0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77,
0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65,
0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73,
0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e,
0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64,
0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x1a, 0x52, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x79,
0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e,
0x63, 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,
0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb8, 0x02, 0x0a,
0x05, 0x57, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08,
0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f,
0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a,
0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x69,
0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x2e,
0x0a, 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61,
0x6d, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x61, 0x63, 0x6b, 0x69,
0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x4e,
0x0a, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79,
0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d,
0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72,
0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x27,
0x0a, 0x02, 0x68, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73,
0x79, 0x6e, 0x63, 0x52, 0x02, 0x68, 0x62, 0x22, 0x89, 0x02, 0x0a, 0x06, 0x57, 0x73, 0x52, 0x65,
0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x72, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73,
0x67, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65,
0x64, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x03, 0x72, 0x64, 0x66, 0x18,
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52,
0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65,
0x52, 0x03, 0x72, 0x64, 0x66, 0x12, 0x54, 0x0a, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72,
0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68,
0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e,
0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79,
0x6e, 0x63, 0x52, 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f,
0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x36, 0x0a, 0x08, 0x62,
0x63, 0x69, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c,
0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72,
0x61, 0x6d, 0x65, 0x42, 0x13, 0x5a, 0x11, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x73, 0x72,
0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -1087,11 +1087,11 @@ func file_room_downsync_frame_proto_rawDescGZIP() []byte {
return file_room_downsync_frame_proto_rawDescData
}
var file_room_downsync_frame_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_room_downsync_frame_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_room_downsync_frame_proto_goTypes = []interface{}{
(*BattleColliderInfo)(nil), // 0: protos.BattleColliderInfo
(*PlayerDownsync)(nil), // 1: protos.PlayerDownsync
(*PlayerDownsyncMeta)(nil), // 2: protos.PlayerDownsyncMeta
(*InputFrameDecoded)(nil), // 2: protos.InputFrameDecoded
(*InputFrameUpsync)(nil), // 3: protos.InputFrameUpsync
(*InputFrameDownsync)(nil), // 4: protos.InputFrameDownsync
(*HeartbeatUpsync)(nil), // 5: protos.HeartbeatUpsync
@@ -1101,31 +1101,28 @@ var file_room_downsync_frame_proto_goTypes = []interface{}{
nil, // 9: protos.BattleColliderInfo.StrToVec2DListMapEntry
nil, // 10: protos.BattleColliderInfo.StrToPolygon2DListMapEntry
nil, // 11: protos.RoomDownsyncFrame.PlayersEntry
nil, // 12: protos.RoomDownsyncFrame.PlayerMetasEntry
(*sharedprotos.Direction)(nil), // 13: sharedprotos.Direction
(*sharedprotos.Vec2DList)(nil), // 14: sharedprotos.Vec2DList
(*sharedprotos.Polygon2DList)(nil), // 15: sharedprotos.Polygon2DList
(*sharedprotos.Direction)(nil), // 12: sharedprotos.Direction
(*sharedprotos.Vec2DList)(nil), // 13: sharedprotos.Vec2DList
(*sharedprotos.Polygon2DList)(nil), // 14: sharedprotos.Polygon2DList
}
var file_room_downsync_frame_proto_depIdxs = []int32{
9, // 0: protos.BattleColliderInfo.strToVec2DListMap:type_name -> protos.BattleColliderInfo.StrToVec2DListMapEntry
10, // 1: protos.BattleColliderInfo.strToPolygon2DListMap:type_name -> protos.BattleColliderInfo.StrToPolygon2DListMapEntry
13, // 2: protos.PlayerDownsync.dir:type_name -> sharedprotos.Direction
12, // 2: protos.PlayerDownsync.dir:type_name -> sharedprotos.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 -> sharedprotos.Vec2DList
15, // 11: protos.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> sharedprotos.Polygon2DList
1, // 12: protos.RoomDownsyncFrame.PlayersEntry.value:type_name -> protos.PlayerDownsync
2, // 13: protos.RoomDownsyncFrame.PlayerMetasEntry.value:type_name -> protos.PlayerDownsyncMeta
14, // [14:14] is the sub-list for method output_type
14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
3, // 4: protos.WsReq.inputFrameUpsyncBatch:type_name -> protos.InputFrameUpsync
5, // 5: protos.WsReq.hb:type_name -> protos.HeartbeatUpsync
6, // 6: protos.WsResp.rdf:type_name -> protos.RoomDownsyncFrame
4, // 7: protos.WsResp.inputFrameDownsyncBatch:type_name -> protos.InputFrameDownsync
0, // 8: protos.WsResp.bciFrame:type_name -> protos.BattleColliderInfo
13, // 9: protos.BattleColliderInfo.StrToVec2DListMapEntry.value:type_name -> sharedprotos.Vec2DList
14, // 10: protos.BattleColliderInfo.StrToPolygon2DListMapEntry.value:type_name -> sharedprotos.Polygon2DList
1, // 11: protos.RoomDownsyncFrame.PlayersEntry.value:type_name -> protos.PlayerDownsync
12, // [12:12] is the sub-list for method output_type
12, // [12:12] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
}
func init() { file_room_downsync_frame_proto_init() }
@@ -1159,7 +1156,7 @@ func file_room_downsync_frame_proto_init() {
}
}
file_room_downsync_frame_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlayerDownsyncMeta); i {
switch v := v.(*InputFrameDecoded); i {
case 0:
return &v.state
case 1:
@@ -1249,7 +1246,7 @@ func file_room_downsync_frame_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_room_downsync_frame_proto_rawDesc,
NumEnums: 0,
NumMessages: 13,
NumMessages: 12,
NumExtensions: 0,
NumServices: 0,
},

View File

@@ -247,8 +247,8 @@ func Serve(c *gin.Context) {
bciFrame := &pb.BattleColliderInfo{
BoundRoomId: pRoom.Id,
StageName: pRoom.StageName,
StrToVec2DListMap: pRoom.RawBattleStrToVec2DListMap,
StrToPolygon2DListMap: pRoom.RawBattleStrToPolygon2DListMap,
StrToVec2DListMap: pRoom.StrToVec2DListMap,
StrToPolygon2DListMap: pRoom.StrToPolygon2DListMap,
StageDiscreteW: pRoom.StageDiscreteW,
StageDiscreteH: pRoom.StageDiscreteH,
StageTileW: pRoom.StageTileW,
@@ -269,6 +269,8 @@ func Serve(c *gin.Context) {
WorldToVirtualGridRatio: pRoom.WorldToVirtualGridRatio,
VirtualGridToWorldRatio: pRoom.VirtualGridToWorldRatio,
SpAtkLookupFrames: pRoom.SpAtkLookupFrames,
}
resp := &pb.WsResp{

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
{"width":128,"imagePath":"SoldierElf_tex.png","height":128,"name":"SoldierElf","SubTexture":[{"frameHeight":45,"y":1,"frameX":0,"width":34,"frameY":0,"height":44,"name":"cape","frameWidth":34,"x":70},{"width":10,"y":107,"height":14,"name":"shouder_l","x":74},{"width":11,"y":107,"height":14,"name":"forearm_l","x":61},{"width":15,"y":93,"height":16,"name":"hand_l","x":1},{"width":30,"y":61,"height":30,"name":"weapon_hand_l","x":1},{"width":8,"y":101,"height":11,"name":"thigh_l","x":86},{"width":12,"y":93,"height":17,"name":"calf_l","x":18},{"width":20,"y":113,"height":8,"name":"foot_l","x":39},{"width":28,"y":61,"height":31,"name":"pelvis","x":33},{"width":8,"y":88,"height":11,"name":"thigh_r","x":77},{"width":12,"y":88,"height":17,"name":"calf_r","x":63},{"width":20,"y":113,"height":8,"name":"foot_r","x":17},{"width":13,"y":94,"height":12,"name":"shouder_r","x":45},{"width":67,"y":1,"height":58,"name":"chest","x":1},{"width":11,"y":94,"height":17,"name":"forearm_r","x":32},{"width":14,"y":111,"height":13,"name":"hand_r","x":1},{"frameHeight":39,"y":47,"frameX":-2,"width":34,"frameY":0,"height":39,"name":"we_bl_4_f_1","frameWidth":36,"x":70}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -0,0 +1 @@
{"imagePath":"Soldier_02_tex.png","width":128,"name":"Soldier_02","SubTexture":[{"x":53,"y":44,"width":23,"name":"biu","height":22},{"x":76,"y":68,"width":9,"name":"rightArm","height":14},{"y":35,"frameY":0,"height":32,"frameWidth":29,"frameX":-1,"frameHeight":32,"width":27,"name":"yinmoqe00","x":89},{"x":53,"y":1,"width":34,"name":"body","height":41},{"x":78,"y":44,"width":9,"name":"rightShoulder","height":13},{"y":50,"frameY":0,"height":18,"frameWidth":19,"frameX":0,"frameHeight":18,"width":19,"name":"rightFrontArm","x":23},{"x":23,"y":70,"width":14,"name":"rightHand","height":14},{"y":68,"frameY":0,"height":12,"frameWidth":12,"frameX":0,"frameHeight":12,"width":12,"name":"leftArm","x":62},{"x":1,"y":73,"width":13,"name":"leftShoulder","height":12},{"x":1,"y":50,"width":20,"name":"leftFrontArm","height":21},{"x":89,"y":1,"width":33,"name":"head","height":32},{"x":1,"y":1,"width":50,"name":"head2","height":47},{"x":44,"y":68,"width":16,"name":"leftHand","height":14},{"y":59,"frameY":-2,"height":4,"frameWidth":8,"frameX":-1,"frameHeight":8,"width":4,"name":"huomiao01","x":78}],"height":128}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "2202f4f4-b792-4dea-8302-633315aded66",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"width":128,"SubTexture":[{"frameWidth":34,"y":1,"frameHeight":45,"width":34,"frameX":0,"height":44,"name":"cape","frameY":0,"x":70},{"width":10,"y":107,"height":14,"name":"shouder_l","x":74},{"width":11,"y":107,"height":14,"name":"forearm_l","x":61},{"width":15,"y":93,"height":16,"name":"hand_l","x":1},{"width":30,"y":61,"height":30,"name":"weapon_hand_l","x":1},{"width":8,"y":88,"height":11,"name":"thigh_l","x":77},{"width":12,"y":93,"height":17,"name":"calf_l","x":18},{"width":20,"y":113,"height":8,"name":"foot_l","x":39},{"width":28,"y":61,"height":31,"name":"pelvis","x":33},{"width":8,"y":101,"height":11,"name":"thigh_r","x":86},{"width":12,"y":88,"height":17,"name":"calf_r","x":63},{"width":20,"y":113,"height":8,"name":"foot_r","x":17},{"width":13,"y":94,"height":12,"name":"shouder_r","x":45},{"width":67,"y":1,"height":58,"name":"chest","x":1},{"width":11,"y":94,"height":17,"name":"forearm_r","x":32},{"width":14,"y":111,"height":13,"name":"hand_r","x":1},{"frameWidth":36,"y":47,"frameHeight":39,"width":34,"frameX":-2,"height":39,"name":"we_bl_4_f_1","frameY":0,"x":70}],"height":128,"name":"SoldierElf","imagePath":"SoldierElf_tex.png"}

View File

@@ -0,0 +1,7 @@
{
"ver": "1.0.0",
"uuid": "24d7bb8f-577c-4e5d-b730-56613ca8685d",
"atlasJson": "{\"width\":128,\"SubTexture\":[{\"frameWidth\":34,\"y\":1,\"frameHeight\":45,\"width\":34,\"frameX\":0,\"height\":44,\"name\":\"cape\",\"frameY\":0,\"x\":70},{\"width\":10,\"y\":107,\"height\":14,\"name\":\"shouder_l\",\"x\":74},{\"width\":11,\"y\":107,\"height\":14,\"name\":\"forearm_l\",\"x\":61},{\"width\":15,\"y\":93,\"height\":16,\"name\":\"hand_l\",\"x\":1},{\"width\":30,\"y\":61,\"height\":30,\"name\":\"weapon_hand_l\",\"x\":1},{\"width\":8,\"y\":88,\"height\":11,\"name\":\"thigh_l\",\"x\":77},{\"width\":12,\"y\":93,\"height\":17,\"name\":\"calf_l\",\"x\":18},{\"width\":20,\"y\":113,\"height\":8,\"name\":\"foot_l\",\"x\":39},{\"width\":28,\"y\":61,\"height\":31,\"name\":\"pelvis\",\"x\":33},{\"width\":8,\"y\":101,\"height\":11,\"name\":\"thigh_r\",\"x\":86},{\"width\":12,\"y\":88,\"height\":17,\"name\":\"calf_r\",\"x\":63},{\"width\":20,\"y\":113,\"height\":8,\"name\":\"foot_r\",\"x\":17},{\"width\":13,\"y\":94,\"height\":12,\"name\":\"shouder_r\",\"x\":45},{\"width\":67,\"y\":1,\"height\":58,\"name\":\"chest\",\"x\":1},{\"width\":11,\"y\":94,\"height\":17,\"name\":\"forearm_r\",\"x\":32},{\"width\":14,\"y\":111,\"height\":13,\"name\":\"hand_r\",\"x\":1},{\"frameWidth\":36,\"y\":47,\"frameHeight\":39,\"width\":34,\"frameX\":-2,\"height\":39,\"name\":\"we_bl_4_f_1\",\"frameY\":0,\"x\":70}],\"height\":128,\"name\":\"SoldierElf\",\"imagePath\":\"SoldierElf_tex.png\"}",
"texture": "050fb016-1a1f-4341-8367-283bfeddc4a8",
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -0,0 +1,34 @@
{
"ver": "2.3.3",
"uuid": "050fb016-1a1f-4341-8367-283bfeddc4a8",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"platformSettings": {},
"subMetas": {
"SoldierElf_tex": {
"ver": "1.0.4",
"uuid": "c62e1779-f92b-40d3-bf4f-7ab747e33d6e",
"rawTextureUuid": "050fb016-1a1f-4341-8367-283bfeddc4a8",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -11.5,
"offsetY": 1.5,
"trimX": 1,
"trimY": 1,
"width": 103,
"height": 123,
"rawWidth": 128,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "f1176719-d1d6-4af5-89c6-ddff16ab85fd",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"width":128,"SubTexture":[{"frameWidth":23,"y":44,"frameHeight":22,"width":22,"frameX":-1,"height":22,"name":"biu","frameY":0,"x":53},{"width":9,"y":68,"height":14,"name":"rightArm","x":76},{"frameWidth":29,"y":35,"frameHeight":32,"width":26,"frameX":-1,"height":32,"name":"yinmoqe00","frameY":0,"x":89},{"width":34,"y":1,"height":41,"name":"body","x":53},{"width":9,"y":44,"height":13,"name":"rightShoulder","x":77},{"width":19,"y":50,"height":18,"name":"rightFrontArm","x":23},{"width":14,"y":70,"height":14,"name":"rightHand","x":23},{"width":12,"y":68,"height":12,"name":"leftArm","x":62},{"width":13,"y":73,"height":12,"name":"leftShoulder","x":1},{"width":20,"y":50,"height":21,"name":"leftFrontArm","x":1},{"width":33,"y":1,"height":32,"name":"head","x":89},{"width":50,"y":1,"height":47,"name":"head2","x":1},{"width":16,"y":68,"height":14,"name":"leftHand","x":44},{"frameWidth":8,"y":59,"frameHeight":8,"width":4,"frameX":-1,"height":4,"name":"huomiao01","frameY":-2,"x":77}],"height":128,"name":"SoldierFireGhost","imagePath":"SoldierFireGhost_tex.png"}

View File

@@ -0,0 +1,7 @@
{
"ver": "1.0.0",
"uuid": "4a9187d5-a9ad-4464-a03c-d2f3cc277051",
"atlasJson": "{\"width\":128,\"SubTexture\":[{\"frameWidth\":23,\"y\":44,\"frameHeight\":22,\"width\":22,\"frameX\":-1,\"height\":22,\"name\":\"biu\",\"frameY\":0,\"x\":53},{\"width\":9,\"y\":68,\"height\":14,\"name\":\"rightArm\",\"x\":76},{\"frameWidth\":29,\"y\":35,\"frameHeight\":32,\"width\":26,\"frameX\":-1,\"height\":32,\"name\":\"yinmoqe00\",\"frameY\":0,\"x\":89},{\"width\":34,\"y\":1,\"height\":41,\"name\":\"body\",\"x\":53},{\"width\":9,\"y\":44,\"height\":13,\"name\":\"rightShoulder\",\"x\":77},{\"width\":19,\"y\":50,\"height\":18,\"name\":\"rightFrontArm\",\"x\":23},{\"width\":14,\"y\":70,\"height\":14,\"name\":\"rightHand\",\"x\":23},{\"width\":12,\"y\":68,\"height\":12,\"name\":\"leftArm\",\"x\":62},{\"width\":13,\"y\":73,\"height\":12,\"name\":\"leftShoulder\",\"x\":1},{\"width\":20,\"y\":50,\"height\":21,\"name\":\"leftFrontArm\",\"x\":1},{\"width\":33,\"y\":1,\"height\":32,\"name\":\"head\",\"x\":89},{\"width\":50,\"y\":1,\"height\":47,\"name\":\"head2\",\"x\":1},{\"width\":16,\"y\":68,\"height\":14,\"name\":\"leftHand\",\"x\":44},{\"frameWidth\":8,\"y\":59,\"frameHeight\":8,\"width\":4,\"frameX\":-1,\"height\":4,\"name\":\"huomiao01\",\"frameY\":-2,\"x\":77}],\"height\":128,\"name\":\"SoldierFireGhost\",\"imagePath\":\"SoldierFireGhost_tex.png\"}",
"texture": "700d963b-2192-4219-a066-8be5b3db7453",
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,34 @@
{
"ver": "2.3.3",
"uuid": "700d963b-2192-4219-a066-8be5b3db7453",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"platformSettings": {},
"subMetas": {
"SoldierFireGhost_tex": {
"ver": "1.0.4",
"uuid": "8ef8a6b3-0bac-4cf1-bba0-ab090f4d9e52",
"rawTextureUuid": "700d963b-2192-4219-a066-8be5b3db7453",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -2.5,
"offsetY": 21,
"trimX": 1,
"trimY": 1,
"width": 121,
"height": 84,
"rawWidth": 128,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.2" tiledversion="1.2.3" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="16" tileheight="16" infinite="0" nextlayerid="2" nextobjectid="8">
<map version="1.2" tiledversion="1.2.3" orientation="orthogonal" renderorder="right-down" width="64" height="64" tilewidth="16" tileheight="16" infinite="0" nextlayerid="2" nextobjectid="12">
<tileset firstgid="1" source="tiles0.tsx"/>
<tileset firstgid="65" source="tiles1.tsx"/>
<layer id="1" name="Ground" width="64" height="64">
@@ -61,5 +61,29 @@
</properties>
<polyline points="0,0 -191.667,0.666667 -191.667,17.3333 -0.715174,17.3333"/>
</object>
<object id="8" x="-9.33333" y="-13.3333">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 0,18.6667 1041.33,21.3333 1041.33,-1.33333"/>
</object>
<object id="9" x="-9.33333" y="1014.67">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 0,18.6667 1041.33,21.3333 1041.33,-1.33333"/>
</object>
<object id="10" x="-14" y="-40">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 4,1110 24,1110 24,-8"/>
</object>
<object id="11" x="1014" y="-42">
<properties>
<property name="boundary_type" value="barrier"/>
</properties>
<polyline points="0,0 4,1110 24,1110 24,-8"/>
</object>
</objectgroup>
</map>

View File

@@ -29,6 +29,8 @@ message BattleColliderInfo {
double worldToVirtualGridRatio = 21;
double virtualGridToWorldRatio = 22;
int32 spAtkLookupFrames = 23;
}
message PlayerDownsync {
@@ -38,24 +40,26 @@ message PlayerDownsync {
sharedprotos.Direction dir = 4;
int32 speed = 5; // in terms of virtual grid units
int32 battleState = 6;
int32 lastMoveGmtMillis = 7;
int32 joinIndex = 7;
double colliderRadius = 8;
bool removed = 9;
int32 score = 10;
bool removed = 11;
int32 joinIndex = 12;
int32 lastMoveGmtMillis = 11;
string name = 12;
string displayName = 13;
string avatar = 14;
}
message PlayerDownsyncMeta {
int32 id = 1;
string name = 2;
string displayName = 3;
string avatar = 4;
int32 joinIndex = 5;
double colliderRadius = 6;
message InputFrameDecoded {
int32 dx = 1;
int32 dy = 2;
int32 btnALevel = 3;
}
message InputFrameUpsync {
int32 inputFrameId = 1;
int32 encodedDir = 6;
uint64 encoded = 2;
}
message InputFrameDownsync {
@@ -72,7 +76,6 @@ message RoomDownsyncFrame {
int32 id = 1;
map<int32, PlayerDownsync> players = 2;
int64 countdownNanos = 3;
map<int32, PlayerDownsyncMeta> playerMetas = 4;
}
message WsReq {

View File

@@ -1,309 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "Bullet",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.7,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Node",
"_name": "Tail",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_level": 2,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-14,
-6,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.ParticleSystem",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_srcBlendFactor": 770,
"_dstBlendFactor": 1,
"_custom": true,
"_file": {
"__uuid__": "b2687ac4-099e-403c-a192-ff477686f4f5"
},
"_spriteFrame": {
"__uuid__": "472df5d3-35e7-4184-9e6c-7f41bee65ee3"
},
"_texture": {
"__uuid__": "d0a82d39-bede-46c4-b698-c81ff0dedfff"
},
"_stopped": false,
"playOnLoad": true,
"autoRemoveOnFinish": false,
"totalParticles": 200,
"duration": -1,
"emissionRate": 999.999985098839,
"life": 0.20000000298023224,
"lifeVar": 0.5,
"_startColor": {
"__type__": "cc.Color",
"r": 202,
"g": 200,
"b": 86,
"a": 163
},
"_startColorVar": {
"__type__": "cc.Color",
"r": 229,
"g": 255,
"b": 173,
"a": 198
},
"_endColor": {
"__type__": "cc.Color",
"r": 173,
"g": 161,
"b": 19,
"a": 214
},
"_endColorVar": {
"__type__": "cc.Color",
"r": 107,
"g": 249,
"b": 249,
"a": 188
},
"angle": 360,
"angleVar": 360,
"startSize": 3.369999885559082,
"startSizeVar": 50,
"endSize": 30.31999969482422,
"endSizeVar": 0,
"startSpin": -47.369998931884766,
"startSpinVar": 0,
"endSpin": -47.369998931884766,
"endSpinVar": -142.11000061035156,
"sourcePos": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"posVar": {
"__type__": "cc.Vec2",
"x": 7,
"y": 7
},
"positionType": 1,
"emitterMode": 0,
"gravity": {
"__type__": "cc.Vec2",
"x": -1000,
"y": 0.5
},
"speed": 10,
"speedVar": 190.7899932861328,
"tangentialAccel": -92.11000061035156,
"tangentialAccelVar": 65.79000091552734,
"radialAccel": -671.0499877929688,
"radialAccelVar": 65.79000091552734,
"rotationIsDir": false,
"startRadius": 0,
"startRadiusVar": 0,
"endRadius": 0,
"endRadiusVar": 0,
"rotatePerS": 0,
"rotatePerSVar": 0,
"_N$preview": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "7673e0e4-bebd-4caa-8a10-a6e1e86f1b2f"
},
"fileId": "f8NGWnOBtGmZNTU+o6vnbe",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "2f525bb2-80d1-4508-bdc3-d03c11587ce4"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": {
"__uuid__": "266c6cef-32d6-4545-b3e6-c2b75a895578"
},
"_id": ""
},
{
"__type__": "ea9650l7IJHjL2ymsB5gasO",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"localIdInBattle": null,
"linearSpeed": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "7673e0e4-bebd-4caa-8a10-a6e1e86f1b2f"
},
"fileId": "f7AuVG6IFIr5KrEg6RCeY2",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "7673e0e4-bebd-4caa-8a10-a6e1e86f1b2f",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -13,7 +13,7 @@
},
{
"__type__": "cc.Node",
"_name": "Player1",
"_name": "Root",
"_objFlags": 0,
"_parent": null,
"_children": [
@@ -25,25 +25,22 @@
},
{
"__id__": 8
},
{
"__id__": 11
}
],
"_active": true,
"_components": [
{
"__id__": 11
"__id__": 19
},
{
"__id__": 12
},
{
"__id__": 13
},
{
"__id__": 14
"__id__": 20
}
],
"_prefab": {
"__id__": 15
"__id__": 21
},
"_opacity": 255,
"_color": {
@@ -192,7 +189,7 @@
"__id__": 1
},
"asset": {
"__uuid__": "8a738d50-1dac-4b6e-99e1-d241f5ee7169"
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"fileId": "5apzDmIE9IuaMOyF3z06sc",
"sync": false
@@ -366,7 +363,7 @@
"__id__": 1
},
"asset": {
"__uuid__": "8a738d50-1dac-4b6e-99e1-d241f5ee7169"
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"fileId": "04uxaznclAmLRL13XKszPJ",
"sync": false
@@ -475,11 +472,319 @@
"__id__": 1
},
"asset": {
"__uuid__": "8a738d50-1dac-4b6e-99e1-d241f5ee7169"
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"fileId": "e4mum5GwxNiZ0T8ouw95jJ",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "animNode",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 12
},
{
"__id__": 15
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 18
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "SoldierElf",
"_objFlags": 0,
"_parent": {
"__id__": 11
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 13
}
],
"_prefab": {
"__id__": 14
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "SoldierElf",
"_animationName": "Idle1",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "affcd973-4743-48e5-9bcd-339180a6101b#24d7bb8f-577c-4e5d-b730-56613ca8685d",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "affcd973-4743-48e5-9bcd-339180a6101b"
},
"_N$dragonAtlasAsset": {
"__uuid__": "24d7bb8f-577c-4e5d-b730-56613ca8685d"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"fileId": "3fs20Yd8dIO68/1Wx2oVLh",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "SoldierFireGhost",
"_objFlags": 0,
"_parent": {
"__id__": 11
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 16
}
],
"_prefab": {
"__id__": 17
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "SoldierFireGhost",
"_animationName": "Idle1",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "36230012-8df3-4e85-afad-76ec47d0e4d7#4a9187d5-a9ad-4464-a03c-d2f3cc277051",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "36230012-8df3-4e85-afad-76ec47d0e4d7"
},
"_N$dragonAtlasAsset": {
"__uuid__": "4a9187d5-a9ad-4464-a03c-d2f3cc277051"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 8,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"fileId": "a8ZUEyoP1Ec5azSkL7Z/9h",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"fileId": "7aN7Gcc/tBw5EGlTJVBj2+",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
@@ -506,52 +811,6 @@
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "28194c48-ae3b-4197-8263-0d474ae8b9bc"
},
"_clips": [
{
"__uuid__": "28194c48-ae3b-4197-8263-0d474ae8b9bc"
},
{
"__uuid__": "e1c45a36-2022-4b18-a2db-b5e2e0a120ed"
},
{
"__uuid__": "126dff26-0ace-439d-89b5-b888aa52d159"
},
{
"__uuid__": "95c2d541-8f99-446a-a7e0-094130ce6d41"
},
{
"__uuid__": "380f5fa0-f77f-434a-8f39-d545ee6823c5"
},
{
"__uuid__": "a306c6de-ccd8-492b-bfec-c6be0a4cbde2"
},
{
"__uuid__": "f496072b-51fd-4406-abbd-9885ac23f7a9"
},
{
"__uuid__": "6405ad8b-3084-4b67-8c2e-9b4d34fa3d09"
},
{
"__uuid__": "af16cdcb-6e82-4be6-806d-9fc52ae99fff"
},
{
"__uuid__": "02eba566-4d22-4fa7-99d7-f032f5845421"
}
],
"playOnLoad": true,
"_id": ""
},
{
"__type__": "b74b05YDqZFRo4OkZRFZX8k",
"_name": "",
@@ -560,8 +819,10 @@
"__id__": 1
},
"_enabled": true,
"animComp": null,
"lastMovedAt": 0,
"animNode": {
"__id__": 11
},
"arrowTipNode": {
"__id__": 8
},
@@ -570,30 +831,13 @@
},
"_id": ""
},
{
"__type__": "cc.CircleCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_radius": 12,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "8a738d50-1dac-4b6e-99e1-d241f5ee7169"
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"fileId": "4cx75uwJJFa7U8QL187QCL",
"sync": false

View File

@@ -1,6 +1,6 @@
{
"ver": "1.2.5",
"uuid": "8a738d50-1dac-4b6e-99e1-d241f5ee7169",
"uuid": "59bff7a2-23e1-4d69-bce7-afb37eae196a",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,

View File

@@ -1,153 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "GuardTower",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 2
},
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 90,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 2,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": false,
"_state": 0,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "31a63530-7811-45bc-a4ee-571faf917e35"
},
"fileId": "cb43NtzzhP0bpzlQHRRrkX",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "31a63530-7811-45bc-a4ee-571faf917e35",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -1,601 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "Player2",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 5
},
{
"__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 11
},
{
"__id__": 12
},
{
"__id__": 13
},
{
"__id__": 14
}
],
"_prefab": {
"__id__": 15
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 120
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
3,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 2,
"groupIndex": 2,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "CoordinateLabel",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 46.68,
"height": 27.72
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-5,
50,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "(0, 0)",
"_N$string": "(0, 0)",
"_fontSize": 20,
"_lineHeight": 22,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "1f479636-9eb8-4612-8f97-371964d6eae3"
},
"fileId": "5apzDmIE9IuaMOyF3z06sc",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "particlesystem",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.ParticleSystem",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 1,
"_custom": true,
"_file": {
"__uuid__": "b2687ac4-099e-403c-a192-ff477686f4f5"
},
"_spriteFrame": {
"__uuid__": "472df5d3-35e7-4184-9e6c-7f41bee65ee3"
},
"_texture": null,
"_stopped": false,
"playOnLoad": true,
"autoRemoveOnFinish": false,
"totalParticles": 200,
"duration": -1,
"emissionRate": 999.999985098839,
"life": 0.20000000298023224,
"lifeVar": 0.5,
"_startColor": {
"__type__": "cc.Color",
"r": 202,
"g": 200,
"b": 86,
"a": 163
},
"_startColorVar": {
"__type__": "cc.Color",
"r": 229,
"g": 255,
"b": 173,
"a": 198
},
"_endColor": {
"__type__": "cc.Color",
"r": 173,
"g": 161,
"b": 19,
"a": 214
},
"_endColorVar": {
"__type__": "cc.Color",
"r": 107,
"g": 249,
"b": 249,
"a": 188
},
"angle": 360,
"angleVar": 360,
"startSize": 3.369999885559082,
"startSizeVar": 50,
"endSize": 30.31999969482422,
"endSizeVar": 0,
"startSpin": -47.369998931884766,
"startSpinVar": 0,
"endSpin": -47.369998931884766,
"endSpinVar": -142.11000061035156,
"sourcePos": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"posVar": {
"__type__": "cc.Vec2",
"x": 7,
"y": 7
},
"_positionType": 1,
"positionType": 1,
"emitterMode": 0,
"gravity": {
"__type__": "cc.Vec2",
"x": 0.25,
"y": 0.8600000143051147
},
"speed": 0,
"speedVar": 190.7899932861328,
"tangentialAccel": -92.11000061035156,
"tangentialAccelVar": 65.79000091552734,
"radialAccel": -671.0499877929688,
"radialAccelVar": 65.79000091552734,
"rotationIsDir": false,
"startRadius": 0,
"startRadiusVar": 0,
"endRadius": 0,
"endRadiusVar": 0,
"rotatePerS": 0,
"rotatePerSVar": 0,
"_N$preview": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "1f479636-9eb8-4612-8f97-371964d6eae3"
},
"fileId": "04uxaznclAmLRL13XKszPJ",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "arrowTip",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": {
"__id__": 10
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 76,
"height": 84
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
177,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a2170e4c-df31-41ef-be73-f4f605e75821"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "1f479636-9eb8-4612-8f97-371964d6eae3"
},
"fileId": "6bwyYXs/lD7ba69sgDrsn5",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "115ea7bb-d47f-4d3c-a52a-f46584346c3f"
},
"_clips": [
{
"__uuid__": "a1bf7c7c-b9f7-4b65-86e3-f86a9e798fb6"
},
{
"__uuid__": "115ea7bb-d47f-4d3c-a52a-f46584346c3f"
},
{
"__uuid__": "d5af527a-9f0c-4398-b2dd-84426be7bd32"
},
{
"__uuid__": "b60618d7-569d-4f13-bdeb-f20341fbadb6"
},
{
"__uuid__": "0b3fb38e-9110-4191-9b72-6b64a224d049"
},
{
"__uuid__": "1bc6de53-800b-4da3-ab8e-4a45e3aa4230"
},
{
"__uuid__": "ee0d670c-893e-4e4d-96dd-5571db18ee97"
},
{
"__uuid__": "596df84a-2e4e-4f1d-967c-a82649f564a8"
},
{
"__uuid__": "8acc4e9f-3c47-4b66-9a9d-d012709680f6"
},
{
"__uuid__": "c7cda0cd-dbce-4722-abd2-aeca28263a21"
}
],
"playOnLoad": true,
"_id": ""
},
{
"__type__": "b74b05YDqZFRo4OkZRFZX8k",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"animComp": null,
"lastMovedAt": 0,
"arrowTipNode": {
"__id__": 8
},
"coordLabel": {
"__id__": 3
},
"_id": ""
},
{
"__type__": "cc.CircleCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_radius": 12,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "1f479636-9eb8-4612-8f97-371964d6eae3"
},
"fileId": "4cx75uwJJFa7U8QL187QCL",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "1f479636-9eb8-4612-8f97-371964d6eae3",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -1,118 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_rawFiles": null,
"data": {
"__id__": 1
}
},
{
"__type__": "cc.Node",
"_name": "PolygonBoundaryBarrier",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 2
}
],
"_prefab": {
"__id__": 3
},
"_id": "",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_skewX": 0,
"_skewY": 0,
"_localZOrder": 0,
"_globalZOrder": 0,
"_opacityModifyRGB": false,
"groupIndex": 1,
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.PolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
]
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "e6gF9LdulAgYGTgO3/Pye8",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "4154eec0-d644-482f-a889-c00ae6b69958",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -1,125 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "PolygonBoundaryShelter",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 2
}
],
"_prefab": {
"__id__": 3
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"_zIndex": 0,
"groupIndex": 4,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-192,
43,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.PolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "f820a6ec-e7a9-46cf-9b8a-331aa3e21487"
},
"fileId": "f8scmoFllMboAtkaldeiym",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "f820a6ec-e7a9-46cf-9b8a-331aa3e21487",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -1,125 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "PolygonBoundaryShelterZReducer",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 2
}
],
"_prefab": {
"__id__": 3
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"_zIndex": 0,
"groupIndex": 3,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.PolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "e6q3kwlllDC425mW1I4/O5"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "a36d024b-a979-4d18-b089-19af313ffb82"
},
"fileId": "fajJ28qMxI0YDyTCPlWINd",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "a36d024b-a979-4d18-b089-19af313ffb82",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -1,132 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "TiledAnim",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 2
},
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 56,
"height": 58
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_spriteFrame": {
"__uuid__": "cc1486e4-5c38-4a73-a0d3-70416d0dd57f"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_id": ""
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_defaultClip": null,
"_clips": [],
"playOnLoad": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "1c02b0a0-859a-4467-86b3-ca39c30d1e19"
},
"fileId": "60dCvhukpIsL1FtdnqBIor",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "1c02b0a0-859a-4467-86b3-ca39c30d1e19",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -1,157 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "treasureNodePrefab",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 2
},
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": "",
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
441,
814,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_spriteFrame": {
"__uuid__": "350fd890-3d28-4e53-9dfa-1bf00d857737"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_id": ""
},
{
"__type__": "cc.PolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "9f340a31-ddfa-46c2-94c7-d11615aedcb1"
},
"fileId": "dc8aAweIBDDYuXBJblR5IA",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "9f340a31-ddfa-46c2-94c7-d11615aedcb1",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -1,167 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "treasureNodePrefab",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 3
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 64,
"height": 64
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 2,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": ""
},
{
"__type__": "5eea6zlA0NHdoCk/M1pvQmb",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "ec3f3234-9b84-43c2-a3cd-58b924cce8e5"
},
"fileId": "dc8aAweIBDDYuXBJblR5IA",
"sync": false
}
]

View File

@@ -1,8 +0,0 @@
{
"ver": "1.2.5",
"uuid": "ec3f3234-9b84-43c2-a3cd-58b924cce8e5",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@@ -80,20 +80,20 @@
],
"_active": true,
"_components": [
{
"__id__": 31
},
{
"__id__": 32
},
{
"__id__": 33
},
{
"__id__": 34
},
{
"__id__": 35
},
{
"__id__": 36
},
{
"__id__": 37
},
{
"__id__": 38
}
],
"_prefab": null,
@@ -234,7 +234,7 @@
"__id__": 7
},
{
"__id__": 33
"__id__": 30
}
],
"_prefab": null,
@@ -307,23 +307,11 @@
"canvasNode": {
"__id__": 2
},
"tiledAnimPrefab": {
"__uuid__": "1c02b0a0-859a-4467-86b3-ca39c30d1e19"
},
"player1Prefab": {
"__uuid__": "8a738d50-1dac-4b6e-99e1-d241f5ee7169"
},
"player2Prefab": {
"__uuid__": "1f479636-9eb8-4612-8f97-371964d6eae3"
},
"polygonBoundaryBarrierPrefab": {
"__uuid__": "4154eec0-d644-482f-a889-c00ae6b69958"
},
"keyboardInputControllerNode": {
"__id__": 8
"controlledCharacterPrefab": {
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"joystickInputControllerNode": {
"__id__": 22
"__id__": 8
},
"confirmLogoutPrefab": {
"__uuid__": "8e8c1a65-623d-42ba-97a7-820ce518ea11"
@@ -335,7 +323,7 @@
"__id__": 17
},
"countdownLabel": {
"__id__": 30
"__id__": 23
},
"resultPanelPrefab": {
"__uuid__": "c4cfe3bd-c59e-4d5b-95cb-c933b120e184"
@@ -353,28 +341,26 @@
"__uuid__": "b4e519f4-e698-4403-9ff2-47b8dacb077e"
},
"forceBigEndianFloatingNumDecoding": false,
"backgroundMapTiledIns": {
"__id__": 4
},
"renderFrameIdLagTolerance": 4,
"teleportEps1D": 0.001,
"jigglingEps1D": 0.001,
"_id": "d12gkAmppNlIzqcRDELa91"
},
{
"__type__": "cc.Node",
"_name": "KeyboardControlsMount",
"_name": "JoystickContainer",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [],
"_children": [
{
"__id__": 24
}
],
"_active": true,
"_components": [
{
"__id__": 31
},
{
"__id__": 32
"__id__": 29
}
],
"_prefab": null,
@@ -388,8 +374,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 50.4
"width": 1280,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -400,8 +386,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-341.33333,
-640,
0,
-500,
0,
0,
0,
@@ -423,7 +409,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e6nL+1zEhLmLSaT8R/9UgD"
"_id": "81iBXkC0lFt5FFUUD0k3xE"
},
{
"__type__": "cc.Node",
@@ -441,9 +427,6 @@
},
{
"__id__": 22
},
{
"__id__": 29
}
],
"_active": true,
@@ -539,7 +522,7 @@
"array": [
0,
0,
342.9460598986377,
239.32248305180272,
0,
0,
0,
@@ -1041,325 +1024,6 @@
"_N$affectedByScale": false,
"_id": "f6GkgYwn9JvKLqbGG1zmeD"
},
{
"__type__": "cc.Node",
"_name": "JoystickContainer",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [
{
"__id__": 23
}
],
"_active": true,
"_components": [
{
"__id__": 28
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-500,
0,
0,
0,
0,
1,
0.66667,
0.66667,
0.66667
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "81iBXkC0lFt5FFUUD0k3xE"
},
{
"__type__": "cc.Node",
"_name": "JoystickBG",
"_objFlags": 0,
"_parent": {
"__id__": 22
},
"_children": [
{
"__id__": 24
}
],
"_active": true,
"_components": [
{
"__id__": 26
},
{
"__id__": 27
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 400
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "88u3wQvvdO8pbrNWhs3ifP"
},
{
"__type__": "cc.Node",
"_name": "Joystick",
"_objFlags": 0,
"_parent": {
"__id__": 23
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 25
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 150,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0.8,
0.8,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3eybpdW/JK3aDeXxdE86VD"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7d4baacd-294c-4a5d-9cd6-5d36e4394c9e"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": "7dr8DOX01K7YFqWlRy1ATp"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "447f7cfe-e678-4424-be03-0afdab8659de"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": "b28Bh9ZcpM+7K3Bd3bmNf0"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 0,
"_left": 40,
"_right": 0,
"_top": 0,
"_bottom": 10,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "c0cEsj4LpMcZZEldELidxy"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 0,
"_left": 278,
"_right": 480.0000000000002,
"_top": 544,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 480,
"_originalHeight": 0,
"_id": "2cxYjEIwNO6rUtXX4WcfnV"
},
{
"__type__": "cc.Node",
"_name": "CountdownSeconds",
@@ -1371,7 +1035,7 @@
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 23
}
],
"_prefab": null,
@@ -1427,7 +1091,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 22
},
"_enabled": true,
"_materials": [
@@ -1453,11 +1117,142 @@
"_id": "dfxSFl+shLcY+0v45FJtGo"
},
{
"__type__": "cc.Label",
"__type__": "cc.Node",
"_name": "JoystickBG",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [
{
"__id__": 25
}
],
"_active": true,
"_components": [
{
"__id__": 27
},
{
"__id__": 28
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 400
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "88u3wQvvdO8pbrNWhs3ifP"
},
{
"__type__": "cc.Node",
"_name": "Joystick",
"_objFlags": 0,
"_parent": {
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 150,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0.8,
0.8,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3eybpdW/JK3aDeXxdE86VD"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
"__id__": 25
},
"_enabled": true,
"_materials": [
@@ -1465,32 +1260,114 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "9cS5BRd+NKJIvGQiojJtIs"
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7d4baacd-294c-4a5d-9cd6-5d36e4394c9e"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": "7dr8DOX01K7YFqWlRy1ATp"
},
{
"__type__": "4561aFzv9JPZLe6iIzODk2d",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "447f7cfe-e678-4424-be03-0afdab8659de"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": "b28Bh9ZcpM+7K3Bd3bmNf0"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 0,
"_left": 40,
"_right": 0,
"_top": 0,
"_bottom": 10,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "c0cEsj4LpMcZZEldELidxy"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_id": "5ahzSYC8pCCLVPCBYyCRfZ"
"alignMode": 0,
"_target": null,
"_alignFlags": 0,
"_left": 278,
"_right": 480.0000000000002,
"_top": 544,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 480,
"_originalHeight": 0,
"_id": "2cxYjEIwNO6rUtXX4WcfnV"
},
{
"__type__": "09e1b/tEy5K2qaPIpqHDbae",
@@ -1600,16 +1477,17 @@
},
"_enabled": true,
"translationListenerNode": {
"__id__": 22
"__id__": 8
},
"zoomingListenerNode": {
"__id__": 5
},
"actionBtnListenerNode": null,
"stickhead": {
"__id__": 24
"__id__": 25
},
"base": {
"__id__": 23
"__id__": 24
},
"joyStickEps": 0.1,
"magicLeanLowerBound": 0.414,

View File

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

View File

@@ -0,0 +1,971 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "368b10b6-88fc-423c-9fcd-545d9fc673bd"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 19
},
{
"__id__": 20
},
{
"__id__": 21
},
{
"__id__": 22
},
{
"__id__": 23
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1024,
"height": 1920
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
512,
960,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "daDUxCjRFEHak7fx7LvgSJ"
},
{
"__type__": "cc.Node",
"_name": "Map",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
},
{
"__id__": 5
},
{
"__id__": 6
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 3200,
"height": 3200
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "79f0Sv9OVGwbY3M3efHnGf"
},
{
"__type__": "cc.TiledMap",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_tmxFile": null,
"_id": "c8MqKDLJdKz7VhPwMjScDw"
},
{
"__type__": "09e1b/tEy5K2qaPIpqHDbae",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"BGMEffect": {
"__uuid__": "64a79efa-97de-4cb5-b2a9-01500c60573a"
},
"crashedByTrapBullet": {
"__uuid__": "1d604e42-8cee-466f-884d-e74cae21ce3b"
},
"highScoreTreasurePicked": {
"__uuid__": "0164d22c-d965-461f-867e-b30e2d56cc5c"
},
"treasurePicked": {
"__uuid__": "7704b97e-6367-420c-b7af-d0750a2bbb30"
},
"countDown10SecToEnd": {
"__uuid__": "261d1d7d-a5cc-4cb7-a737-194427055fd4"
},
"mapNode": {
"__id__": 3
},
"_id": "3crA1nz5xPSLAnCSLQIPOq"
},
{
"__type__": "47d7dy4S4lB2pxqJJlGOoai",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"canvasNode": {
"__id__": 2
},
"controlledCharacterPrefab": {
"__uuid__": "59bff7a2-23e1-4d69-bce7-afb37eae196a"
},
"joystickInputControllerNode": {
"__id__": 7
},
"confirmLogoutPrefab": null,
"simplePressToGoDialogPrefab": null,
"boundRoomIdLabel": null,
"countdownLabel": null,
"resultPanelPrefab": null,
"gameRulePrefab": null,
"findingPlayerPrefab": null,
"countdownToBeginGamePrefab": null,
"playersInfoPrefab": null,
"forceBigEndianFloatingNumDecoding": false,
"renderFrameIdLagTolerance": 4,
"jigglingEps1D": 0.001,
"_id": "4b+kZ46VhC0LCBixXEK2dk"
},
{
"__type__": "cc.Node",
"_name": "JoystickContainer",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [
{
"__id__": 13
}
],
"_active": true,
"_components": [
{
"__id__": 18
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-500,
0,
0,
0,
0,
1,
0.66667,
0.66667,
0.66667
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "81iBXkC0lFt5FFUUD0k3xE"
},
{
"__type__": "cc.Node",
"_name": "WidgetsAboveAll",
"_objFlags": 0,
"_parent": {
"__id__": 9
},
"_children": [
{
"__id__": 7
},
{
"__id__": 11
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c6fPdAUURDX69j0zTeIFZv"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 10
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
216.50635094610968,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "76BOk0enxN+b20dtIJ3uk2"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1.5,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "50qiPTLS9NhbPa+JZU0jOP"
},
{
"__type__": "cc.Node",
"_name": "CountdownSeconds",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 88.2
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
591,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "f6HMd9ebFPppe/Lu0Ry/qk"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_useOriginalSize": false,
"_string": "",
"_N$string": "",
"_fontSize": 70,
"_lineHeight": 70,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "dfxSFl+shLcY+0v45FJtGo"
},
{
"__type__": "cc.Node",
"_name": "JoystickBG",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 16
},
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 400
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "88u3wQvvdO8pbrNWhs3ifP"
},
{
"__type__": "cc.Node",
"_name": "Joystick",
"_objFlags": 0,
"_parent": {
"__id__": 13
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 150,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0.8,
0.8,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3eybpdW/JK3aDeXxdE86VD"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7d4baacd-294c-4a5d-9cd6-5d36e4394c9e"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": "7dr8DOX01K7YFqWlRy1ATp"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "447f7cfe-e678-4424-be03-0afdab8659de"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "030d9286-e8a2-40cf-98f8-baf713f0b8c4"
},
"_id": "b28Bh9ZcpM+7K3Bd3bmNf0"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 0,
"_left": 40,
"_right": 0,
"_top": 0,
"_bottom": 10,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "c0cEsj4LpMcZZEldELidxy"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 0,
"_left": 278,
"_right": 480.0000000000002,
"_top": 544,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 480,
"_originalHeight": 0,
"_id": "2cxYjEIwNO6rUtXX4WcfnV"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1024,
"height": 1920
},
"_fitWidth": true,
"_fitHeight": false,
"_id": "94aSq7GcJJZ7A6IzMerm1J"
},
{
"__type__": "8ac08Cb+Y1M/6ZsO9niGOzW",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"map": {
"__id__": 3
},
"_id": "84o2sgpN1NRqlN9x7mSzBj"
},
{
"__type__": "78830/HTiVJoaf8n504g/J4",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"mapNode": {
"__id__": 3
},
"speed": 5000,
"_id": "76ImpM7XtPSbiLHDXdsJa+"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 0,
"_left": 6240,
"_right": -4000,
"_top": -8320,
"_bottom": 10880,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 960,
"_originalHeight": 640,
"_id": "a8lQ6mB8RMRajCXQCzw1kG"
},
{
"__type__": "d34e3c4jd5NqYtg8ltL9QST",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"translationListenerNode": {
"__id__": 7
},
"zoomingListenerNode": {
"__id__": 3
},
"stickhead": {
"__id__": 14
},
"base": {
"__id__": 13
},
"joyStickEps": 0.1,
"magicLeanLowerBound": 0.414,
"magicLeanUpperBound": 2.414,
"linearScaleFacBase": 1,
"minScale": 1,
"maxScale": 2,
"maxMovingBufferLength": 1,
"zoomingScaleFacBase": 0.1,
"zoomingSpeedBase": 4,
"linearSpeedBase": 320,
"canvasNode": {
"__id__": 2
},
"mapNode": {
"__id__": 3
},
"linearMovingEps": 0.1,
"scaleByEps": 0.0375,
"_id": "e9oVYTr7ROlpp/IrNjBUmR"
}
]

View File

@@ -0,0 +1,7 @@
{
"ver": "1.2.5",
"uuid": "368b10b6-88fc-423c-9fcd-545d9fc673bd",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@@ -0,0 +1,61 @@
const BaseCharacter = require("./BaseCharacter");
window.ATK_CHARACTER_STATE = {
Idle1: [0, "Idle1"],
Walking: [1, "Walking"],
Atk1: [2, "Atk1"],
};
window.ATK_CHARACTER_STATE_ARR = [];
for (let k in window.ATK_CHARACTER_STATE) {
window.ATK_CHARACTER_STATE_ARR.push(window.ATK_CHARACTER_STATE[k]);
}
cc.Class({
extends: BaseCharacter,
properties: {
animNode: {
type: cc.Node,
default: null
},
},
ctor() {
this.speciesName = null;
},
setSpecies(speciesName) {
this.speciesName = speciesName;
this.effAnimNode = this.animNode.getChildByName(this.speciesName);
this.animComp = this.effAnimNode.getComponent(dragonBones.ArmatureDisplay);
this.animComp.playAnimation(ATK_CHARACTER_STATE.Idle1[1]);
this.effAnimNode.active = true;
},
onLoad() {
BaseCharacter.prototype.onLoad.call(this);
this.characterState = ATK_CHARACTER_STATE.Idle1[0];
},
scheduleNewDirection(newScheduledDirection, forceAnimSwitch) {
const oldDx = this.activeDirection.dx, oldDy = this.activeDirection.dy;
BaseCharacter.prototype.scheduleNewDirection.call(this, newScheduledDirection, forceAnimSwitch);
if (ATK_CHARACTER_STATE.Atk1[0] == this.characterState) {
return;
}
let newCharacterState = ATK_CHARACTER_STATE.Idle1[0];
if (0 != newScheduledDirection.dx || 0 != newScheduledDirection.dy) {
newCharacterState = ATK_CHARACTER_STATE.Walking[0];
}
if (newCharacterState != this.characterState) {
this.characterState = newCharacterState;
const newAnimName = window.ATK_CHARACTER_STATE_ARR[newCharacterState][1];
if (newAnimName != this.animComp.animationName) {
this.animComp.playAnimation(newAnimName);
// console.log(`JoinIndex=${this.joinIndex}, Resetting anim to ${newAnimName}, dir changed: (${oldDx}, ${oldDy}) -> (${newScheduledDirection.dx}, ${newScheduledDirection.dy})`);
}
}
},
});

View File

@@ -1,6 +1,6 @@
{
"ver": "1.0.5",
"uuid": "ea965d25-ec82-478c-bdb2-9ac07981ab0e",
"uuid": "0b29c37b-2ac0-47be-ae68-b7b9a4b2dffb",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,

View File

@@ -0,0 +1,61 @@
module.export = cc.Class({
extends: cc.Component,
properties: {
lastMovedAt: {
type: cc.Float,
default: 0 // In "GMT milliseconds"
}
},
ctor() {
this.activeDirection = {
dx: 0,
dy: 0
};
},
onLoad() {
const self = this;
const canvasNode = self.mapNode.parent;
self.mapIns = self.mapNode.getComponent("Map");
const joystickInputControllerScriptIns = canvasNode.getComponent("TouchEventsManager");
self.ctrl = joystickInputControllerScriptIns;
},
scheduleNewDirection(newScheduledDirection, forceAnimSwitch) {
if (!newScheduledDirection) {
return;
}
if (forceAnimSwitch || null == this.activeDirection || (newScheduledDirection.dx != this.activeDirection.dx || newScheduledDirection.dy != this.activeDirection.dy)) {
this.activeDirection = newScheduledDirection;
if (this.animComp && this.animComp.node) {
if (0 > newScheduledDirection.dx) {
this.animComp.node.scaleX = (-1.0);
} else if (0 < newScheduledDirection.dx) {
this.animComp.node.scaleX = (1.0);
}
}
}
},
update(dt) {},
lateUpdate(dt) {},
_generateRandomDirection() {
return ALL_DISCRETE_DIRECTIONS_CLOCKWISE[Math.floor(Math.random() * ALL_DISCRETE_DIRECTIONS_CLOCKWISE.length)];
},
updateSpeed(proposedSpeed) {
if (0 == proposedSpeed && 0 < this.speed) {
this.startFrozenDisplay();
}
if (0 < proposedSpeed && 0 == this.speed) {
this.stopFrozenDisplay();
}
this.speed = proposedSpeed;
},
});

View File

@@ -1,96 +0,0 @@
module.export = cc.Class({
extends: cc.Component,
properties: {
animComp: {
type: cc.Animation,
default: null,
},
lastMovedAt: {
type: cc.Float,
default: 0 // In "GMT milliseconds"
}
},
// LIFE-CYCLE CALLBACKS:
start() {
const self = this;
self.activeDirection = {
dx: 0,
dy: 0
};
},
onLoad() {
const self = this;
self.clips = {
'02': 'Top',
'0-2': 'Bottom',
'-20': 'Left',
'20': 'Right',
'-11': 'TopLeft',
'11': 'TopRight',
'-1-1': 'BottomLeft',
'1-1': 'BottomRight'
};
const canvasNode = self.mapNode.parent;
self.mapIns = self.mapNode.getComponent("Map");
const joystickInputControllerScriptIns = canvasNode.getComponent("TouchEventsManager");
self.ctrl = joystickInputControllerScriptIns;
self.animComp = self.node.getComponent(cc.Animation);
self.animComp.play();
},
scheduleNewDirection(newScheduledDirection, forceAnimSwitch) {
if (!newScheduledDirection) {
return;
}
if (forceAnimSwitch || null == this.activeDirection || (newScheduledDirection.dx != this.activeDirection.dx || newScheduledDirection.dy != this.activeDirection.dy)) {
this.activeDirection = newScheduledDirection;
this.activeDirection = newScheduledDirection;
const clipKey = newScheduledDirection.dx.toString() + newScheduledDirection.dy.toString();
const clips = (this.attacked ? this.attackedClips : this.clips);
let clip = clips[clipKey];
if (!clip) {
// Keep playing the current anim.
if (0 !== newScheduledDirection.dx || 0 !== newScheduledDirection.dy) {
cc.warn('Clip for clipKey === ' + clipKey + ' is invalid: ' + clip + '.');
}
} else {
this.animComp.play(clip);
if (this.attacked) {
cc.log(`Attacked, switching to play clipKey = ${clipKey}, clip == ${clip}, this.activeDirection == ${JSON.stringify(this.activeDirection)}, this.activeDirection == ${JSON.stringify(this.activeDirection)}.`);
}
}
}
},
update(dt) {},
lateUpdate(dt) {},
_generateRandomDirection() {
return ALL_DISCRETE_DIRECTIONS_CLOCKWISE[Math.floor(Math.random() * ALL_DISCRETE_DIRECTIONS_CLOCKWISE.length)];
},
updateSpeed(proposedSpeed) {
if (0 == proposedSpeed && 0 < this.speed) {
this.startFrozenDisplay();
}
if (0 < proposedSpeed && 0 == this.speed) {
this.stopFrozenDisplay();
}
this.speed = proposedSpeed;
},
startFrozenDisplay() {
const self = this;
self.attacked = true;
},
stopFrozenDisplay() {
const self = this;
self.attacked = false;
},
});

View File

@@ -1,201 +0,0 @@
module.export = cc.Class({
extends: cc.Component,
properties: {
localIdInBattle: {
default: null,
},
linearSpeed: {
default: 0.0,
},
},
ctor() {
this.ctrl = null;
this.activeDirection = null;
},
onLoad() {
},
_calculateVecToMoveByWithChosenDir(elapsedTime, sDir) {
if (0 == sDir.dx && 0 == sDir.dy) {
return cc.v2();
}
const self = this;
const distanceToMove = (self.linearSpeed * elapsedTime);
const denominator = Math.sqrt(sDir.dx * sDir.dx + sDir.dy * sDir.dy);
const unitProjDx = (sDir.dx / denominator);
const unitProjDy = (sDir.dy / denominator);
return cc.v2(
distanceToMove * unitProjDx,
distanceToMove * unitProjDy,
);
},
_calculateVecToMoveBy(elapsedTime) {
const self = this;
if (null == self.activeDirection) {
return null;
}
// Note that `sDir` used in this method MUST BE a copy in RAM.
let sDir = {
dx: self.activeDirection.dx,
dy: self.activeDirection.dy,
};
if (0 == sDir.dx && 0 == sDir.dy) {
return cc.v2();
}
return self._calculateVecToMoveByWithChosenDir(elapsedTime, sDir);
},
_canMoveBy(vecToMoveBy) {
return true;
},
update(dt) {
// Used only for EXTRAPOLATING the position of this bullet. The position might be corrected within `setData` as well.
const self = this;
if (null != self.bulletMaxDist) {
const dxMoved = self.node.position.x - self.startAtPoint.x;
const dyMoved = self.node.position.y - self.startAtPoint.y;
const distanceMoved = Math.sqrt(dxMoved * dxMoved + dyMoved * dyMoved)
self.node.opacity = 255*(1 - distanceMoved/self.bulletMaxDist);
}
const vecToMoveBy = self._calculateVecToMoveBy(dt);
if (null == vecToMoveBy) {
return;
}
if (self._canMoveBy(vecToMoveBy)) {
self.node.position = self.node.position.add(vecToMoveBy);
}
},
_calculateAngle(dx, dy) {
if (dx == 0) {
if (dy > 0) {
return 90;
}
if (dy < 0) {
return -90;
}
}
if (dx > 0) {
if (dy == 0) {
return 0;
}
if (dy > 0) {
return 45;
}
if (dy < 0) {
return -45;
}
}
if (dx < 0) {
if (dy == 0) {
return 180;
}
if (dy > 0) {
return 135;
}
if (dy < 0) {
return -135;
}
}
return null;
},
setData(bulletLocalIdInBattle, bulletInfo, dtFromMapUpdate) {
const targetNode = this.node;
if (true == bulletInfo.removed) {
return false;
}
if (null == bulletInfo.startAtPoint || null == bulletInfo.endAtPoint) {
console.error(`Init bullet direction error, startAtPoint:${bulletInfo.startAtPoint}, endAtPoint:${bulletInfo.endAtPoint}`);
return false;
}
this.localIdInBattle = bulletLocalIdInBattle;
this.linearSpeed = bulletInfo.linearSpeed * 1000000000; // The `bullet.LinearSpeed` on server-side is denoted in pts/nanoseconds.
const dx = bulletInfo.endAtPoint.x - bulletInfo.startAtPoint.x;
const dy = bulletInfo.endAtPoint.y - bulletInfo.startAtPoint.y;
const discretizedDir = this.ctrl.discretizeDirection(dx, dy, this.ctrl.joyStickEps);
const baseAngle = 0;
const angleToRotate = baseAngle - this._calculateAngle(discretizedDir.dx, discretizedDir.dy);
if (null == angleToRotate) {
return false;
}
set2dRotation(targetNode, angleToRotate);
const newPos = cc.v2(
bulletInfo.x,
bulletInfo.y
);
if (null == this.activeDirection) {
// Initialization.
this.startAtPoint = bulletInfo.startAtPoint;
this.endAtPoint = bulletInfo.endAtPoint;
this.bulletMaxDist = 600.0; // Hardcoded temporarily, matching that in "<backend>/models/room.go". -- YFLu, 2019-09-05.
targetNode.setPosition(newPos);
this.activeDirection = {
dx: 0,
dy: 0,
};
return true;
}
const oldPos = cc.v2(
targetNode.x,
targetNode.y,
);
const toMoveByVec = newPos.sub(oldPos);
const toMoveByVecMag = toMoveByVec.mag();
const toTeleportDisThreshold = (this.linearSpeed * dtFromMapUpdate * 100);
const notToMoveDisThreshold = (this.linearSpeed * dtFromMapUpdate * 0.5);
if (toMoveByVecMag < notToMoveDisThreshold) {
// To stop extrapolated moving.
this.activeDirection = {
dx: 0,
dy: 0,
};
} else {
if (toMoveByVecMag > toTeleportDisThreshold) {
console.log("Bullet ", bulletLocalIdInBattle, " is teleporting! Having toMoveByVecMag == ", toMoveByVecMag, ", toTeleportDisThreshold == ", toTeleportDisThreshold);
// To stop extrapolated moving.
this.activeDirection = {
dx: 0,
dy: 0
};
// Deliberately NOT using `cc.Action`. -- YFLu, 2019-09-04
targetNode.setPosition(newPos);
} else {
// The common case which is suitable for interpolation.
const normalizedDir = {
dx: toMoveByVec.x / toMoveByVecMag,
dy: toMoveByVec.y / toMoveByVecMag,
};
if (isNaN(normalizedDir.dx) || isNaN(normalizedDir.dy)) {
this.activeDirection = {
dx: 0,
dy: 0,
};
} else {
this.activeDirection = normalizedDir;
}
}
}
return true;
},
});

View File

@@ -1,8 +1,7 @@
const BasePlayer = require("./BasePlayer");
const AttackingCharacter = require("./AttackingCharacter");
cc.Class({
extends: BasePlayer,
// LIFE-CYCLE CALLBACKS:
extends: AttackingCharacter,
properties: {
arrowTipNode: {
type: cc.Node,
@@ -13,22 +12,9 @@ cc.Class({
default: null
}
},
start() {
BasePlayer.prototype.start.call(this);
},
onLoad() {
BasePlayer.prototype.onLoad.call(this);
this.attackedClips = {
'01': 'attackedLeft',
'0-1': 'attackedRight',
'-20': 'attackedLeft',
'20': 'attackedRight',
'-21': 'attackedLeft',
'21': 'attackedRight',
'-2-1': 'attackedLeft',
'2-1': 'attackedRight'
};
AttackingCharacter.prototype.onLoad.call(this);
this.arrowTipNode.active = false;
if (!this.mapIns.showCriticalCoordinateLabels) {
@@ -51,7 +37,7 @@ cc.Class({
},
update(dt) {
BasePlayer.prototype.update.call(this, dt);
AttackingCharacter.prototype.update.call(this, dt);
if (this.mapIns.showCriticalCoordinateLabels) {
this.coordLabel.string = `(${this.node.x.toFixed(2)}, ${this.node.y.toFixed(2)})`;
}

View File

@@ -1,69 +0,0 @@
cc.Class({
extends: cc.Component,
properties: {},
setInputControls: function() {
const self = this;
// add keyboard event listener
// When there is a key being pressed down, judge if it's the designated directional button and set up acceleration in the corresponding direction
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, function(event) {
switch (event.keyCode) {
case cc.macro.KEY.w:
self.activeDirection.dPjY = +1.0;
break;
case cc.macro.KEY.s:
self.activeDirection.dPjY = -1.0;
break;
case cc.macro.KEY.a:
self.activeDirection.dPjX = -2.0;
break;
case cc.macro.KEY.d:
self.activeDirection.dPjX = +2.0;
break;
default:
break;
}
}, self.node);
// when releasing the button, stop acceleration in this direction
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP, function(event) {
switch (event.keyCode) {
case cc.macro.KEY.w:
if (+1.0 == self.activeDirection.dPjY) {
self.activeDirection.dPjY = 0.0;
}
break;
case cc.macro.KEY.s:
if (-1.0 == self.activeDirection.dPjY) {
self.activeDirection.dPjY = 0.0;
}
break;
case cc.macro.KEY.a:
if (-2.0 == self.activeDirection.dPjX) {
self.activeDirection.dPjX = 0.0;
}
break;
case cc.macro.KEY.d:
if (+2.0 == self.activeDirection.dPjX) {
self.activeDirection.dPjX = 0.0;
}
break;
default:
break;
}
}, self.node);
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
// Properties deliberately hidden from GUI panel.
this.activeDirection = {
dPjY: 0.0,
dPjX: 0.0
};
this.setInputControls();
}
});

View File

@@ -40,26 +40,10 @@ cc.Class({
type: cc.Node,
default: null,
},
tiledAnimPrefab: {
controlledCharacterPrefab: {
type: cc.Prefab,
default: null,
},
player1Prefab: {
type: cc.Prefab,
default: null,
},
player2Prefab: {
type: cc.Prefab,
default: null,
},
polygonBoundaryBarrierPrefab: {
type: cc.Prefab,
default: null,
},
keyboardInputControllerNode: {
type: cc.Node,
default: null
},
joystickInputControllerNode: {
type: cc.Node,
default: null
@@ -103,10 +87,6 @@ cc.Class({
forceBigEndianFloatingNumDecoding: {
default: false,
},
backgroundMapTiledIns: {
type: cc.TiledMap,
default: null
},
renderFrameIdLagTolerance: {
type: cc.Integer,
default: 4 // implies (renderFrameIdLagTolerance >> inputScaleFrames) count of inputFrameIds
@@ -133,7 +113,7 @@ cc.Class({
dumpToInputCache: function(inputFrameDownsync) {
const self = this;
let minToKeepInputFrameId = self._convertToInputFrameId(self.lastAllConfirmedRenderFrameId, self.inputDelayFrames); // [WARNING] This could be different from "self.lastAllConfirmedInputFrameId". We'd like to keep the corresponding delayedInputFrame for "self.lastAllConfirmedRenderFrameId" such that a rollback could place "self.chaserRenderFrameId = self.lastAllConfirmedRenderFrameId" for the worst case incorrect prediction.
let minToKeepInputFrameId = self._convertToInputFrameId(self.lastAllConfirmedRenderFrameId, self.inputDelayFrames) - self.spAtkLookupFrames; // [WARNING] This could be different from "self.lastAllConfirmedInputFrameId". We'd like to keep the corresponding delayedInputFrame for "self.lastAllConfirmedRenderFrameId" such that a rollback could place "self.chaserRenderFrameId = self.lastAllConfirmedRenderFrameId" for the worst case incorrect prediction.
if (minToKeepInputFrameId > self.lastAllConfirmedInputFrameId) {
minToKeepInputFrameId = self.lastAllConfirmedInputFrameId;
}
@@ -183,8 +163,8 @@ cc.Class({
return [previousSelfInput, existingInputFrame.inputList[joinIndex - 1]];
}
const prefabbedInputList = (null == previousInputFrameDownsyncWithPrediction ? new Array(self.playerRichInfoDict.size).fill(0) : previousInputFrameDownsyncWithPrediction.inputList.slice());
const discreteDir = self.ctrl.getDiscretizedDirection();
prefabbedInputList[(joinIndex - 1)] = discreteDir.encodedIdx;
const currSelfInput = self.ctrl.getEncodedInput();
prefabbedInputList[(joinIndex - 1)] = currSelfInput;
const prefabbedInputFrameDownsync = {
inputFrameId: inputFrameId,
inputList: prefabbedInputList,
@@ -193,7 +173,7 @@ cc.Class({
self.dumpToInputCache(prefabbedInputFrameDownsync); // A prefabbed inputFrame, would certainly be adding a new inputFrame to the cache, because server only downsyncs "all-confirmed inputFrames"
return [previousSelfInput, discreteDir.encodedIdx];
return [previousSelfInput, currSelfInput];
},
shouldSendInputFrameUpsyncBatch(prevSelfInput, currSelfInput, lastUpsyncInputFrameId, currInputFrameId) {
@@ -224,11 +204,13 @@ cc.Class({
} else {
const inputFrameUpsync = {
inputFrameId: i,
encodedDir: inputFrameDownsync.inputList[self.selfPlayerInfo.joinIndex - 1],
encoded: inputFrameDownsync.inputList[self.selfPlayerInfo.joinIndex - 1],
};
inputFrameUpsyncBatch.push(inputFrameUpsync);
}
}
// console.info(`inputFrameUpsyncBatch: ${JSON.stringify(inputFrameUpsyncBatch)}`);
const reqData = window.pb.protos.WsReq.encode({
msgId: Date.now(),
playerId: self.selfPlayerInfo.id,
@@ -304,8 +286,6 @@ cc.Class({
const self = this;
const mapNode = self.node;
const canvasNode = mapNode.parent;
self.countdownLabel.string = "";
self.countdownNanos = null;
// Clearing previous info of all players. [BEGINS]
self.collisionPlayerIndexPrefix = (1 << 17); // For tracking the movements of players
@@ -339,12 +319,20 @@ cc.Class({
self.battleState = ALL_BATTLE_STATES.WAITING;
if (self.countdownLabel) {
self.countdownLabel.string = "";
}
self.countdownNanos = null;
if (self.findingPlayerNode) {
const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.init();
}
safelyAddChild(self.widgetsAboveAllNode, self.playersInfoNode);
safelyAddChild(self.widgetsAboveAllNode, self.findingPlayerNode);
if (self.playersInfoNode) {
safelyAddChild(self.widgetsAboveAllNode, self.playersInfoNode);
}
if (self.findingPlayerNode) {
safelyAddChild(self.widgetsAboveAllNode, self.findingPlayerNode);
}
},
onLoad() {
@@ -352,7 +340,7 @@ cc.Class({
window.mapIns = self;
window.forceBigEndianFloatingNumDecoding = self.forceBigEndianFloatingNumDecoding;
self.showCriticalCoordinateLabels = true;
self.showCriticalCoordinateLabels = false;
console.warn("+++++++ Map onLoad()");
window.handleClientSessionError = function() {
@@ -429,6 +417,7 @@ cc.Class({
self.rollbackEstimatedDtMillis = parsedBattleColliderInfo.rollbackEstimatedDtMillis;
self.rollbackEstimatedDtNanos = parsedBattleColliderInfo.rollbackEstimatedDtNanos;
self.maxChasingRenderFramesPerUpdate = parsedBattleColliderInfo.maxChasingRenderFramesPerUpdate;
self.spAtkLookupFrames = parsedBattleColliderInfo.spAtkLookupFrames;
self.worldToVirtualGridRatio = parsedBattleColliderInfo.worldToVirtualGridRatio;
self.virtualGridToWorldRatio = parsedBattleColliderInfo.virtualGridToWorldRatio;
@@ -475,8 +464,10 @@ cc.Class({
for (let boundaryObj of boundaryObjs.barriers) {
const x0 = boundaryObj.anchor.x,
y0 = boundaryObj.anchor.y;
const newBarrier = self.collisionSys.createPolygon(x0, y0, Array.from(boundaryObj, p => { return [p.x, p.y]; }));
const newBarrier = self.collisionSys.createPolygon(x0, y0, Array.from(boundaryObj, p => {
return [p.x, p.y];
}));
if (self.showCriticalCoordinateLabels) {
for (let i = 0; i < boundaryObj.length; ++i) {
@@ -500,7 +491,7 @@ cc.Class({
barrierVertLabelNode.setPosition(cc.v2(wx, wy));
const barrierVertLabel = barrierVertLabelNode.addComponent(cc.Label);
barrierVertLabel.fontSize = 12;
barrierVertLabel.lineHeight = barrierVertLabel.fontSize+1;
barrierVertLabel.lineHeight = barrierVertLabel.fontSize + 1;
barrierVertLabel.string = `(${wx.toFixed(1)}, ${wy.toFixed(1)})`;
safelyAddChild(self.node, barrierVertLabelNode);
setLocalZOrder(barrierVertLabelNode, 5);
@@ -616,14 +607,14 @@ cc.Class({
}
const players = rdf.players;
const playerMetas = rdf.playerMetas;
self._initPlayerRichInfoDict(players, playerMetas);
self._initPlayerRichInfoDict(players);
// Show the top status indicators for IN_BATTLE
const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo");
for (let i in playerMetas) {
const playerMeta = playerMetas[i];
playersInfoScriptIns.updateData(playerMeta);
if (self.playersInfoNode) {
const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo");
for (let i in players) {
playersInfoScriptIns.updateData(players[i]);
}
}
self.renderFrameId = rdf.id;
@@ -641,7 +632,7 @@ cc.Class({
const canvasNode = self.canvasNode;
self.ctrl = canvasNode.getComponent("TouchEventsManager");
self.enableInputControls();
if (self.countdownToBeginGameNode.parent) {
if (self.countdownToBeginGameNode && self.countdownToBeginGameNode.parent) {
self.countdownToBeginGameNode.parent.removeChild(self.countdownToBeginGameNode);
}
self.transitToState(ALL_MAP_STATES.VISUAL);
@@ -722,7 +713,7 @@ cc.Class({
self.showPopupInCanvas(self.findingPlayerNode);
}
let findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.updatePlayersInfo(rdf.playerMetas);
findingPlayerScriptIns.updatePlayersInfo(rdf.players);
},
logBattleStats() {
@@ -762,11 +753,23 @@ cc.Class({
spawnPlayerNode(joinIndex, vx, vy, playerRichInfo) {
const self = this;
const newPlayerNode = 1 == joinIndex ? cc.instantiate(self.player1Prefab) : cc.instantiate(self.player2Prefab); // hardcoded for now, car color determined solely by joinIndex
const newPlayerNode = cc.instantiate(self.controlledCharacterPrefab)
const playerScriptIns = newPlayerNode.getComponent("ControlledCharacter");
playerScriptIns.joinIndex = joinIndex;
if (1 == joinIndex) {
playerScriptIns.setSpecies("SoldierElf");
} else if (2 == joinIndex) {
playerScriptIns.setSpecies("SoldierFireGhost");
if (0 == playerRichInfo.dir.dx && 0 == playerRichInfo.dir.dy) {
playerScriptIns.animComp.node.scaleX = (-1.0);
}
}
const wpos = self.virtualGridToWorldPos(vx, vy);
newPlayerNode.setPosition(cc.v2(wpos[0], wpos[1]));
newPlayerNode.getComponent("SelfPlayer").mapNode = self.node;
playerScriptIns.mapNode = self.node;
const cpos = self.virtualGridToPlayerColliderPos(vx, vy, playerRichInfo);
const d = playerRichInfo.colliderRadius * 2,
x0 = cpos[0],
@@ -781,7 +784,6 @@ cc.Class({
setLocalZOrder(newPlayerNode, 5);
newPlayerNode.active = true;
const playerScriptIns = newPlayerNode.getComponent("SelfPlayer");
playerScriptIns.scheduleNewDirection({
dx: playerRichInfo.dir.dx,
dy: playerRichInfo.dir.dy
@@ -934,52 +936,58 @@ cc.Class({
if (null == self.findingPlayerNode.parent) return;
self.findingPlayerNode.parent.removeChild(self.findingPlayerNode);
if (null != rdf) {
self._initPlayerRichInfoDict(rdf.players, rdf.playerMetas);
self._initPlayerRichInfoDict(rdf.players);
}
},
onBattleReadyToStart(rdf) {
const self = this;
const players = rdf.players;
const playerMetas = rdf.playerMetas;
self._initPlayerRichInfoDict(players, playerMetas);
self._initPlayerRichInfoDict(players);
// Show the top status indicators for IN_BATTLE
const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo");
for (let i in playerMetas) {
const playerMeta = playerMetas[i];
playersInfoScriptIns.updateData(playerMeta);
if (self.playersInfoNode) {
const playersInfoScriptIns = self.playersInfoNode.getComponent("PlayersInfo");
for (let i in players) {
playersInfoScriptIns.updateData(players[i]);
}
}
console.log("Calling `onBattleReadyToStart` with:", players);
if (self.findingPlayerNode) {
const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.hideExitButton();
findingPlayerScriptIns.updatePlayersInfo(players);
}
console.log("Calling `onBattleReadyToStart` with:", playerMetas);
const findingPlayerScriptIns = self.findingPlayerNode.getComponent("FindingPlayer");
findingPlayerScriptIns.hideExitButton();
findingPlayerScriptIns.updatePlayersInfo(playerMetas);
// Delay to hide the "finding player" GUI, then show a countdown clock
window.setTimeout(() => {
self.hideFindingPlayersGUI();
const countDownScriptIns = self.countdownToBeginGameNode.getComponent("CountdownToBeginGame");
countDownScriptIns.setData();
self.showPopupInCanvas(self.countdownToBeginGameNode);
}, 1500);
if (self.countdownToBeginGameNode) {
window.setTimeout(() => {
self.hideFindingPlayersGUI();
const countDownScriptIns = self.countdownToBeginGameNode.getComponent("CountdownToBeginGame");
countDownScriptIns.setData();
self.showPopupInCanvas(self.countdownToBeginGameNode);
}, 1500);
}
},
applyRoomDownsyncFrameDynamics(rdf) {
const self = this;
const delayedInputFrameForPrevRenderFrame = self.getCachedInputFrameDownsyncWithPrediction(self._convertToInputFrameId(rdf.id - 1, self.inputDelayFrames));
self.playerRichInfoDict.forEach((playerRichInfo, playerId) => {
const immediatePlayerInfo = rdf.players[playerId];
const wpos = self.virtualGridToWorldPos(immediatePlayerInfo.virtualGridX, immediatePlayerInfo.virtualGridY);
const dx = (wpos[0] - playerRichInfo.node.x);
const dy = (wpos[1] - playerRichInfo.node.y);
const justJiggling = (self.jigglingEps1D >= Math.abs(dx) && self.jigglingEps1D >= Math.abs(dy));
if (!justJiggling) {
playerRichInfo.node.setPosition(wpos[0], wpos[1]);
playerRichInfo.virtualGridX = immediatePlayerInfo.virtualGridX;
playerRichInfo.virtualGridY = immediatePlayerInfo.virtualGridY;
playerRichInfo.scriptIns.scheduleNewDirection(immediatePlayerInfo.dir, false);
playerRichInfo.scriptIns.updateSpeed(immediatePlayerInfo.speed);
//const justJiggling = (self.jigglingEps1D >= Math.abs(dx) && self.jigglingEps1D >= Math.abs(dy));
playerRichInfo.node.setPosition(wpos[0], wpos[1]);
playerRichInfo.virtualGridX = immediatePlayerInfo.virtualGridX;
playerRichInfo.virtualGridY = immediatePlayerInfo.virtualGridY;
if (null != delayedInputFrameForPrevRenderFrame) {
const decodedInput = self.ctrl.decodeInput(delayedInputFrameForPrevRenderFrame.inputList[playerRichInfo.joinIndex - 1]);
playerRichInfo.scriptIns.scheduleNewDirection(decodedInput, false);
}
playerRichInfo.scriptIns.updateSpeed(immediatePlayerInfo.speed);
});
},
@@ -1035,8 +1043,7 @@ cc.Class({
const playerCollider = collisionSysMap.get(collisionPlayerIndex);
const player = currRenderFrame.players[playerId];
const encodedInput = inputList[joinIndex - 1];
const decodedInput = self.ctrl.decodeDirection(encodedInput);
const decodedInput = self.ctrl.decodeInput(inputList[joinIndex - 1]);
// console.log(`Got non-zero inputs for playerId=${playerId}, decodedInput=${JSON.stringify(decodedInput)} @currRenderFrame.id=${currRenderFrame.id}, delayedInputFrame.id=${delayedInputFrame.id}`);
/*
@@ -1047,9 +1054,11 @@ cc.Class({
const newCpos = self.virtualGridToPlayerColliderPos(newVx, newVy, self.playerRichInfoArr[joinIndex - 1]);
playerCollider.x = newCpos[0];
playerCollider.y = newCpos[1];
// Update directions and thus would eventually update moving animation accordingly
nextRenderFramePlayers[playerId].dir.dx = decodedInput.dx;
nextRenderFramePlayers[playerId].dir.dy = decodedInput.dy;
if (0 != decodedInput.dx || 0 != decodedInput.dy) {
// Update directions and thus would eventually update moving animation accordingly
nextRenderFramePlayers[playerId].dir.dx = decodedInput.dx;
nextRenderFramePlayers[playerId].dir.dy = decodedInput.dy;
}
}
collisionSys.update();
@@ -1136,15 +1145,13 @@ cc.Class({
return latestRdf;
},
_initPlayerRichInfoDict(players, playerMetas) {
_initPlayerRichInfoDict(players) {
const self = this;
for (let k in players) {
const playerId = parseInt(k);
if (self.playerRichInfoDict.has(playerId)) continue; // Skip already put keys
const immediatePlayerInfo = players[playerId];
const immediatePlayerMeta = playerMetas[playerId];
self.playerRichInfoDict.set(playerId, immediatePlayerInfo);
Object.assign(self.playerRichInfoDict.get(playerId), immediatePlayerMeta);
const nodeAndScriptIns = self.spawnPlayerNode(immediatePlayerInfo.joinIndex, immediatePlayerInfo.virtualGridX, immediatePlayerInfo.virtualGridY, self.playerRichInfoDict.get(playerId));

View File

@@ -1,326 +0,0 @@
const COLLISION_WITH_PLAYER_STATE = {
WALKING_COLLIDABLE: 0,
STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM: 1,
STILL_NEAR_SELF_PLAYER_ONLY_PLAYED_ANIM: 2,
STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM: 3,
STILL_NEAR_OTHER_PLAYER_ONLY_PLAYED_ANIM: 4,
STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM: 5,
STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYED_ANIM: 6,
WALKING_COLLIDABLE_WITH_SELF_PLAYER_BUT_NOT_OTHER_PLAYER: 7,
STILL_NEAR_NOBODY_PLAYING_ANIM: 8,
};
const STILL_NEAR_SELF_PLAYER_STATE_SET = new Set();
STILL_NEAR_SELF_PLAYER_STATE_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM);
STILL_NEAR_SELF_PLAYER_STATE_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYED_ANIM);
STILL_NEAR_SELF_PLAYER_STATE_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM);
STILL_NEAR_SELF_PLAYER_STATE_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYED_ANIM);
const STILL_NEAR_OTHER_PLAYER_STATE_SET = new Set();
STILL_NEAR_OTHER_PLAYER_STATE_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM);
STILL_NEAR_OTHER_PLAYER_STATE_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYED_ANIM);
STILL_NEAR_OTHER_PLAYER_STATE_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM);
STILL_NEAR_OTHER_PLAYER_STATE_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYED_ANIM);
const STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET = new Set();
STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM);
STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYED_ANIM);
STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM);
STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYED_ANIM);
STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM);
STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYED_ANIM);
STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.add(COLLISION_WITH_PLAYER_STATE.STILL_NEAR_NOBODY_PLAYING_ANIM);
function transitWalkingConditionallyCollidableToUnconditionallyCollidable(currentCollisionWithPlayerState) {
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE_WITH_SELF_PLAYER_BUT_NOT_OTHER_PLAYER:
return COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE;
}
return currentCollisionWithPlayerState;
}
function transitUponSelfPlayerLeftProximityArea(currentCollisionWithPlayerState) {
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_NOBODY_PLAYING_ANIM;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYED_ANIM:
return COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYED_ANIM:
return COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE_WITH_SELF_PLAYER_BUT_NOT_OTHER_PLAYER;
}
return currentCollisionWithPlayerState;
}
function transitDueToNoBodyInProximityArea(currentCollisionWithPlayerState) {
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM:
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM:
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_NOBODY_PLAYING_ANIM;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYED_ANIM:
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYED_ANIM:
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYED_ANIM:
return COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE_WITH_SELF_PLAYER_BUT_NOT_OTHER_PLAYER;
}
return currentCollisionWithPlayerState;
}
function transitToPlayingStunnedAnim(currentCollisionWithPlayerState, dueToSelfPlayer, dueToOtherPlayer) {
if (dueToSelfPlayer) {
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE:
case COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE_WITH_SELF_PLAYER_BUT_NOT_OTHER_PLAYER:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM;
}
}
if (dueToOtherPlayer) {
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM;
}
}
// TODO: Any error to throw?
return currentCollisionWithPlayerState;
}
function transitDuringPlayingStunnedAnim(currentCollisionWithPlayerState, dueToSelfPlayerComesIntoProximity, dueToOtherPlayerComesIntoProximity) {
if (dueToSelfPlayerComesIntoProximity) {
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_NOBODY_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM;
}
}
if (dueToOtherPlayerComesIntoProximity) {
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_NOBODY_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM;
}
}
// TODO: Any error to throw?
return currentCollisionWithPlayerState;
}
function transitStunnedAnimPlayingToPlayed(currentCollisionWithPlayerState, forceNotCollidableWithOtherPlayer) {
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_ONLY_PLAYED_ANIM;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYED_ANIM;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYING_ANIM:
return COLLISION_WITH_PLAYER_STATE.STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYED_ANIM;
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_NOBODY_PLAYING_ANIM:
return (true == forceNotCollidableWithOtherPlayer ? COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE_WITH_SELF_PLAYER_BUT_NOT_OTHER_PLAYER : COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE);
}
// TODO: Any error to throw?
return currentCollisionWithPlayerState;
}
function transitStunnedAnimPlayedToWalking(currentCollisionWithPlayerState) {
/*
* Intentionally NOT transiting for
*
* - STILL_NEAR_SELF_PLAYER_NEAR_OTHER_PLAYER_PLAYED_ANIM, or
* - STILL_NEAR_SELF_PLAYER_ONLY_PLAYED_ANIM,
*
* which should be transited upon leaving of "SelfPlayer".
*/
switch (currentCollisionWithPlayerState) {
case COLLISION_WITH_PLAYER_STATE.STILL_NEAR_OTHER_PLAYER_ONLY_PLAYED_ANIM:
return COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE_WITH_SELF_PLAYER_BUT_NOT_OTHER_PLAYER;
}
// TODO: Any error to throw?
return currentCollisionWithPlayerState;
}
const BasePlayer = require("./BasePlayer");
cc.Class({
extends: BasePlayer,
// LIFE-CYCLE CALLBACKS:
start() {
BasePlayer.prototype.start.call(this);
this.scheduleNewDirection(this._generateRandomDirection());
},
onLoad() {
BasePlayer.prototype.onLoad.call(this);
const self = this;
this.collisionWithPlayerState = COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE;
this.clips = {
'01': 'FlatHeadSisterRunTop',
'0-1': 'FlatHeadSisterRunBottom',
'-20': 'FlatHeadSisterRunLeft',
'20': 'FlatHeadSisterRunRight',
'-21': 'FlatHeadSisterRunTopLeft',
'21': 'FlatHeadSisterRunTopRight',
'-2-1': 'FlatHeadSisterRunBottomLeft',
'2-1': 'FlatHeadSisterRunBottomRight'
};
self.onStunnedAnimPlayedSafe = () => {
const oldCollisionWithPlayerState = self.collisionWithPlayerState;
self.collisionWithPlayerState = transitStunnedAnimPlayingToPlayed(this.collisionWithPlayerState, true);
if (oldCollisionWithPlayerState == self.collisionWithPlayerState || !self.node) return;
self.scheduleNewDirection(self._generateRandomDirection());
self.collisionWithPlayerState = transitStunnedAnimPlayedToWalking(self.collisionWithPlayerState);
setTimeout(() => {
self.collisionWithPlayerState = transitWalkingConditionallyCollidableToUnconditionallyCollidable(self.collisionWithPlayerState);
}, 5000);
};
self.onStunnedAnimPlayedSafeAction = cc.callFunc(self.onStunnedAnimPlayedSafe, self);
self.playStunnedAnim = () => {
let colliededAction1 = cc.rotateTo(0.2, -15);
let colliededAction2 = cc.rotateTo(0.3, 15);
let colliededAction3 = cc.rotateTo(0.2, 0);
self.node.runAction(cc.sequence(
cc.callFunc(() => {
self.player.pause()
}, self),
colliededAction1,
colliededAction2,
colliededAction3,
cc.callFunc(() => {
self.player.resume()
}, self),
self.onStunnedAnimPlayedSafeAction
));
// NOTE: Use <cc.Animation>.on('stop', self.onStunnedAnimPlayedSafe) if necessary.
}
},
_canMoveBy(vecToMoveBy) {
if (COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE_WITH_SELF_PLAYER_BUT_NOT_OTHER_PLAYER != this.collisionWithPlayerState && COLLISION_WITH_PLAYER_STATE.WALKING_COLLIDABLE != this.collisionWithPlayerState) {
return false;
}
const superRet = BasePlayer.prototype._canMoveBy.call(this, vecToMoveBy);
const self = this;
const computedNewDifferentPosLocalToParentWithinCurrentFrame = self.node.position.add(vecToMoveBy);
const currentSelfColliderCircle = self.node.getComponent("cc.CircleCollider");
let nextSelfColliderCircle = null;
if (0 < self.contactedBarriers.length || 0 < self.contactedNPCPlayers.length || 0 < self.contactedControlledPlayers) {
/* To avoid unexpected buckling. */
const mutatedVecToMoveBy = vecToMoveBy.mul(2);
nextSelfColliderCircle = {
position: self.node.position.add(vecToMoveBy.mul(2)).add(currentSelfColliderCircle.offset),
radius: currentSelfColliderCircle.radius,
};
} else {
nextSelfColliderCircle = {
position: computedNewDifferentPosLocalToParentWithinCurrentFrame.add(currentSelfColliderCircle.offset),
radius: currentSelfColliderCircle.radius,
};
}
for (let aCircleCollider of self.contactedControlledPlayers) {
let contactedCircleLocalToParentWithinCurrentFrame = {
position: aCircleCollider.node.position.add(aCircleCollider.offset),
radius: aCircleCollider.radius,
};
if (cc.Intersection.circleCircle(contactedCircleLocalToParentWithinCurrentFrame, nextSelfColliderCircle)) {
return false;
}
}
return superRet;
},
update(dt) {
BasePlayer.prototype.update.call(this, dt);
},
onCollisionEnter(other, self) {
BasePlayer.prototype.onCollisionEnter.call(this, other, self);
const playerScriptIns = self.getComponent(self.node.name);
switch (other.node.name) {
case "SelfPlayer":
playerScriptIns._addContactedControlledPlayers(other);
if (1 == playerScriptIns.contactedControlledPlayers.length) {
// When "SelfPlayer" comes into proximity area.
if (!STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.has(playerScriptIns.collisionWithPlayerState)) {
playerScriptIns.collisionWithPlayerState = transitToPlayingStunnedAnim(playerScriptIns.collisionWithPlayerState, true, false);
playerScriptIns.playStunnedAnim();
} else {
playerScriptIns.collisionWithPlayerState = transitDuringPlayingStunnedAnim(playerScriptIns.collisionWithPlayerState, true, false);
}
}
break;
case "NPCPlayer":
if (1 == playerScriptIns.contactedNPCPlayers.length) {
// When one of the other "OtherPlayer"s comes into proximity area.
if (!STILL_SHOULD_NOT_PLAY_STUNNED_ANIM_SET.has(playerScriptIns.collisionWithPlayerState)) {
const oldState = playerScriptIns.collisionWithPlayerState;
playerScriptIns.collisionWithPlayerState = transitToPlayingStunnedAnim(oldState, false, true);
if (playerScriptIns.collisionWithPlayerState != oldState) {
playerScriptIns.playStunnedAnim();
}
} else {
playerScriptIns.collisionWithPlayerState = transitDuringPlayingStunnedAnim(playerScriptIns.collisionWithPlayerState, false, true);
}
}
break;
default:
break;
}
},
onCollisionStay(other, self) {
// TBD.
},
onCollisionExit(other, self) {
BasePlayer.prototype.onCollisionExit.call(this, other, self);
const playerScriptIns = self.getComponent(self.node.name);
switch (other.node.name) {
case "SelfPlayer":
playerScriptIns._removeContactedControlledPlayer(other);
if (0 == playerScriptIns.contactedControlledPlayers.length) {
// Special release step.
if (STILL_NEAR_SELF_PLAYER_STATE_SET.has(playerScriptIns.collisionWithPlayerState)) {
playerScriptIns.collisionWithPlayerState = transitUponSelfPlayerLeftProximityArea(playerScriptIns.collisionWithPlayerState);
}
}
if (0 == playerScriptIns.contactedControlledPlayers.length && 0 == playerScriptIns.contactedNPCPlayers.length) {
transitDueToNoBodyInProximityArea(playerScriptIns.collisionWithPlayerState);
}
break;
case "NPCPlayer":
if (0 == playerScriptIns.contactedControlledPlayers.length && 0 == playerScriptIns.contactedNPCPlayers.length) {
transitDueToNoBodyInProximityArea(playerScriptIns.collisionWithPlayerState);
}
break;
default:
break;
}
},
});

View File

@@ -1,9 +0,0 @@
{
"ver": "1.0.5",
"uuid": "17759956-1f8c-421f-bac2-7f4dd7ccdcda",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,208 @@
const i18n = require('LanguageData');
i18n.init(window.language); // languageID should be equal to the one we input in New Language ID input field
const OnlineMap = require('./Map');
cc.Class({
extends: OnlineMap,
onDestroy() {
console.warn("+++++++ Map onDestroy()");
},
spawnPlayerNode(joinIndex, vx, vy, playerRichInfo) {
const self = this;
const newPlayerNode = cc.instantiate(self.controlledCharacterPrefab)
const playerScriptIns = newPlayerNode.getComponent("ControlledCharacter");
if (1 == joinIndex) {
playerScriptIns.setSpecies("SoldierElf");
} else if (2 == joinIndex) {
playerScriptIns.setSpecies("SoldierFireGhost");
playerScriptIns.animComp.node.scaleX = (-1.0);
}
const wpos = self.virtualGridToWorldPos(vx, vy);
newPlayerNode.setPosition(cc.v2(wpos[0], wpos[1]));
playerScriptIns.mapNode = self.node;
const cpos = self.virtualGridToPlayerColliderPos(vx, vy, playerRichInfo);
const d = playerRichInfo.colliderRadius * 2,
x0 = cpos[0],
y0 = cpos[1];
let pts = [[0, 0], [d, 0], [d, d], [0, d]];
const newPlayerCollider = self.collisionSys.createPolygon(x0, y0, pts);
const collisionPlayerIndex = self.collisionPlayerIndexPrefix + joinIndex;
self.collisionSysMap.set(collisionPlayerIndex, newPlayerCollider);
safelyAddChild(self.node, newPlayerNode);
setLocalZOrder(newPlayerNode, 5);
newPlayerNode.active = true;
playerScriptIns.scheduleNewDirection({
dx: playerRichInfo.dir.dx,
dy: playerRichInfo.dir.dy
}, true);
return [newPlayerNode, playerScriptIns];
},
onLoad() {
const self = this;
window.mapIns = self;
cc.director.getCollisionManager().enabled = false;
const mapNode = self.node;
const canvasNode = mapNode.parent;
self.mainCameraNode = self.canvasNode.getChildByName("Main Camera");
self.mainCamera = self.mainCameraNode.getComponent(cc.Camera);
for (let child of self.mainCameraNode.children) {
child.setScale(1 / self.mainCamera.zoomRatio);
}
self.widgetsAboveAllNode = self.mainCameraNode.getChildByName("WidgetsAboveAll");
self.mainCameraNode.setPosition(cc.v2());
/** Init required prefab ended. */
self.inputDelayFrames = 8;
self.inputScaleFrames = 2;
self.inputFrameUpsyncDelayTolerance = 2;
self.rollbackEstimatedDt = 0.016667;
self.rollbackEstimatedDtMillis = 16.667;
self.rollbackEstimatedDtNanos = 16666666;
self.maxChasingRenderFramesPerUpdate = 5;
self.worldToVirtualGridRatio = 1000;
self.virtualGridToWorldRatio = 1.0 / self.worldToVirtualGridRatio;
const tiledMapIns = self.node.getComponent(cc.TiledMap);
const fullPathOfTmxFile = cc.js.formatStr("map/%s/map", "dungeon");
cc.loader.loadRes(fullPathOfTmxFile, cc.TiledMapAsset, (err, tmxAsset) => {
if (null != err) {
console.error(err);
return;
}
tiledMapIns.tmxAsset = null;
mapNode.removeAllChildren();
self._resetCurrentMatch();
tiledMapIns.tmxAsset = tmxAsset;
const newMapSize = tiledMapIns.getMapSize();
const newTileSize = tiledMapIns.getTileSize();
self.node.setContentSize(newMapSize.width * newTileSize.width, newMapSize.height * newTileSize.height);
self.node.setPosition(cc.v2(0, 0));
let barrierIdCounter = 0;
const boundaryObjs = tileCollisionManager.extractBoundaryObjects(self.node);
for (let boundaryObj of boundaryObjs.barriers) {
const x0 = boundaryObj.anchor.x,
y0 = boundaryObj.anchor.y;
const newBarrier = self.collisionSys.createPolygon(x0, y0, Array.from(boundaryObj, p => {
return [p.x, p.y];
}));
if (self.showCriticalCoordinateLabels) {
for (let i = 0; i < boundaryObj.length; ++i) {
const barrierVertLabelNode = new cc.Node();
switch (i % 4) {
case 0:
barrierVertLabelNode.color = cc.Color.RED;
break;
case 1:
barrierVertLabelNode.color = cc.Color.GRAY;
break;
case 2:
barrierVertLabelNode.color = cc.Color.BLACK;
break;
default:
barrierVertLabelNode.color = cc.Color.MAGENTA;
break;
}
const wx = boundaryObj.anchor.x + boundaryObj[i].x,
wy = boundaryObj.anchor.y + boundaryObj[i].y;
barrierVertLabelNode.setPosition(cc.v2(wx, wy));
const barrierVertLabel = barrierVertLabelNode.addComponent(cc.Label);
barrierVertLabel.fontSize = 12;
barrierVertLabel.lineHeight = barrierVertLabel.fontSize + 1;
barrierVertLabel.string = `(${wx.toFixed(1)}, ${wy.toFixed(1)})`;
safelyAddChild(self.node, barrierVertLabelNode);
setLocalZOrder(barrierVertLabelNode, 5);
barrierVertLabelNode.active = true;
}
}
// console.log("Created barrier: ", newBarrier);
++barrierIdCounter;
const collisionBarrierIndex = (self.collisionBarrierIndexPrefix + barrierIdCounter);
self.collisionSysMap.set(collisionBarrierIndex, newBarrier);
}
const startRdf = {
id: window.MAGIC_ROOM_DOWNSYNC_FRAME_ID.BATTLE_START,
players: {
10: {
id: 10,
joinIndex: 1,
virtualGridX: 0,
virtualGridY: 0,
speed: 2 * self.worldToVirtualGridRatio,
dir: {
dx: 0,
dy: 0
}
},
},
playerMetas: {
10: {
colliderRadius: 12,
},
}
};
self.selfPlayerInfo = {
id: 10
};
self._initPlayerRichInfoDict(startRdf.players, startRdf.playerMetas);
self.onRoomDownsyncFrame(startRdf);
self.battleState = ALL_BATTLE_STATES.IN_BATTLE;
});
},
update(dt) {
const self = this;
if (ALL_BATTLE_STATES.IN_BATTLE == self.battleState) {
const elapsedMillisSinceLastFrameIdTriggered = performance.now() - self.lastRenderFrameIdTriggeredAt;
if (elapsedMillisSinceLastFrameIdTriggered < (self.rollbackEstimatedDtMillis)) {
// console.debug("Avoiding too fast frame@renderFrameId=", self.renderFrameId, ": elapsedMillisSinceLastFrameIdTriggered=", elapsedMillisSinceLastFrameIdTriggered);
return;
}
try {
let st = performance.now();
let prevSelfInput = null,
currSelfInput = null;
const noDelayInputFrameId = self._convertToInputFrameId(self.renderFrameId, 0); // It's important that "inputDelayFrames == 0" here
if (self.shouldGenerateInputFrameUpsync(self.renderFrameId)) {
const prevAndCurrInputs = self._generateInputFrameUpsync(noDelayInputFrameId);
prevSelfInput = prevAndCurrInputs[0];
currSelfInput = prevAndCurrInputs[1];
}
const rdf = self.rollbackAndChase(self.renderFrameId, self.renderFrameId + 1, self.collisionSys, self.collisionSysMap, false);
self.applyRoomDownsyncFrameDynamics(rdf);
let t3 = performance.now();
} catch (err) {
console.error("Error during Map.update", err);
} finally {
++self.renderFrameId; // [WARNING] It's important to increment the renderFrameId AFTER all the operations above!!!
}
}
},
});

View File

@@ -1,6 +1,6 @@
{
"ver": "1.0.5",
"uuid": "4561a173-bfd2-4f64-b7ba-888cce0e4d9d",
"uuid": "47d7dcb8-4b89-41da-9c6a-2499463a86a2",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,

View File

@@ -1,13 +0,0 @@
const Bullet = require("./Bullet");
cc.Class({
extends: Bullet,
// LIFE-CYCLE CALLBACKS:
properties: {
},
onLoad() {
Bullet.prototype.onLoad.call(this);
},
});

View File

@@ -1,9 +0,0 @@
{
"ver": "1.0.5",
"uuid": "c3bb6519-af90-4641-bb5e-5abbbcdfa6da",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -94,6 +94,12 @@ cc.Class({
onLoad() {
this.cachedStickHeadPosition = cc.v2(0.0, 0.0);
this.cachedBtnUpLevel = 0;
this.cachedBtnDownLevel = 0;
this.cachedBtnLeftLevel = 0;
this.cachedBtnRightLevel = 0;
this.cachedBtnALevel = 0;
this.canvasNode = this.mapNode.parent;
this.mainCameraNode = this.canvasNode.getChildByName("Main Camera"); // Cannot drag and assign the `mainCameraNode` from CocosCreator EDITOR directly, otherwise it'll cause an infinite loading time, till v2.1.0.
this.mainCamera = this.mainCameraNode.getComponent(cc.Camera);
@@ -143,6 +149,51 @@ cc.Class({
self._touchEndEvent(event);
});
zoomingListenerNode.inTouchPoints = new Map();
// Setup keyboard controls for the ease of attach debugging
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, function(evt) {
switch (evt.keyCode) {
case cc.macro.KEY.w:
self.cachedBtnUpLevel = 1;
break;
case cc.macro.KEY.s:
self.cachedBtnDownLevel = 1;
break;
case cc.macro.KEY.a:
self.cachedBtnLeftLevel = 1;
break;
case cc.macro.KEY.d:
self.cachedBtnRightLevel = 1;
break;
case cc.macro.KEY.h:
self.cachedBtnALevel = 1;
break;
default:
break;
}
}, this);
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP, function(evt) {
switch (evt.keyCode) {
case cc.macro.KEY.w:
self.cachedBtnUpLevel = 0;
break;
case cc.macro.KEY.s:
self.cachedBtnDownLevel = 0;
break;
case cc.macro.KEY.a:
self.cachedBtnLeftLevel = 0;
break;
case cc.macro.KEY.d:
self.cachedBtnRightLevel = 0;
break;
case cc.macro.KEY.h:
self.cachedBtnALevel = 0;
break;
default:
break;
}
}, this);
},
_isMapOverMoved(mapTargetPos) {
@@ -239,7 +290,6 @@ cc.Class({
// TODO: Handle single-finger-click event.
} while (false);
this.cachedStickHeadPosition = cc.v2(0.0, 0.0);
for (let touch of event._touches) {
if (touch) {
theListenerNode.inTouchPoints.delete(touch._id);
@@ -252,7 +302,42 @@ cc.Class({
update(dt) {
if (this.inMultiTouch) return;
if (true != this.initialized) return;
const self = this;
// Keyboard takes top priority
let keyboardDiffVec = cc.v2(0, 0);
if (1 == this.cachedBtnUpLevel) {
if (1 == this.cachedBtnLeftLevel) {
keyboardDiffVec = cc.v2(-1.0, +1.0);
} else if (1 == this.cachedBtnRightLevel) {
keyboardDiffVec = cc.v2(+1.0, +1.0);
} else {
keyboardDiffVec = cc.v2(0.0, +1.0);
}
} else if (1 == this.cachedBtnDownLevel) {
if (1 == this.cachedBtnLeftLevel) {
keyboardDiffVec = cc.v2(-1.0, -1.0);
} else if (1 == this.cachedBtnRightLevel) {
keyboardDiffVec = cc.v2(+1.0, -1.0);
} else {
keyboardDiffVec = cc.v2(0.0, -1.0);
}
} else if (1 == this.cachedBtnLeftLevel) {
keyboardDiffVec = cc.v2(-1.0, 0.0);
} else if (1 == this.cachedBtnRightLevel) {
keyboardDiffVec = cc.v2(+1.0, 0.0);
}
if (0 != keyboardDiffVec.x || 0 != keyboardDiffVec.y) {
this.cachedStickHeadPosition = keyboardDiffVec.mul(this.maxHeadDistance / keyboardDiffVec.mag());
}
this.stickhead.setPosition(this.cachedStickHeadPosition);
const translationListenerNode = (self.translationListenerNode ? self.translationListenerNode : self.mapNode);
if (0 == translationListenerNode.inTouchPoints.size
&&
(0 == keyboardDiffVec.x && 0 == keyboardDiffVec.y)
) {
this.cachedStickHeadPosition = cc.v2(0, 0); // Important reset!
}
},
discretizeDirection(continuousDx, continuousDy, eps) {
@@ -312,18 +397,23 @@ cc.Class({
return ret;
},
decodeDirection(encodedDirection) {
const mapped = window.DIRECTION_DECODER[encodedDirection];
if (null == mapped) {
console.error("Unexpected encodedDirection = ", encodedDirection);
}
return {
dx: mapped[0],
dy: mapped[1],
};
getEncodedInput() {
const discretizedDir = this.discretizeDirection(this.stickhead.x, this.stickhead.y, this.joyStickEps).encodedIdx; // There're only 9 dirs, thus using only the lower 4-bits
const btnALevel = (this.cachedBtnALevel << 4);
return (btnALevel + discretizedDir);
},
getDiscretizedDirection() {
return this.discretizeDirection(this.cachedStickHeadPosition.x, this.cachedStickHeadPosition.y, this.joyStickEps);
}
decodeInput(encodedInput) {
const encodedDirection = (encodedInput & 15);
const mappedDirection = window.DIRECTION_DECODER[encodedDirection];
if (null == mappedDirection) {
console.error("Unexpected encodedDirection = ", encodedDirection);
}
const btnALevel = ((encodedInput >> 4) & 1);
return window.pb.protos.InputFrameDecoded.create({
dx: mappedDirection[0],
dy: mappedDirection[1],
btnALevel: btnALevel,
});
},
});

View File

@@ -1,26 +0,0 @@
window.LOW_SCORE_TREASURE_TYPE = 1;
window.HIGH_SCORE_TREASURE_TYPE = 2;
window.LOW_SCORE_TREASURE_SCORE = 100;
window.HIGH_SCORE_TREASURE_SCORE = 200;
cc.Class({
extends: cc.Component,
properties: {
},
setData (treasureInfo) {
const self = this;
this.score = treasureInfo.score;
this.type = treasureInfo.type;
this.treasureInfo = treasureInfo;
const spriteComponent = this.node.getComponent(cc.Sprite);
const targetGid = (window.LOW_SCORE_TREASURE_TYPE == treasureInfo.type ? window.battleEntityTypeNameToGlobalGid["LowScoreTreasure"] : window.battleEntityTypeNameToGlobalGid["HighScoreTreasure"])
spriteComponent.spriteFrame = window.getOrCreateSpriteFrameForGid(targetGid).spriteFrame;
},
start() {},
})

View File

@@ -1,9 +0,0 @@
{
"ver": "1.0.5",
"uuid": "5eea6ce5-0343-4776-80a4-fccd69bd099b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -1,84 +0,0 @@
cc.Class({
extends: cc.Component,
properties: {
pickedUpAnimNode: {
type: cc.Node,
default: null
},
durationMillis: {
default: 0
},
binglingAnimNode: {
type: cc.Node,
default: null
},
binglingAnimDurationMillis: {
default: 0
},
scoreLabelNode: {
type: cc.Node,
default: null
}
},
setData (treasureInfo) {
const self = this;
this.score = treasureInfo.score ? treasureInfo.score : 100 ;
this.type = treasureInfo.type ? treasureInfo.type : 1;
this.scoreLabelNode.getComponent(cc.Label).string = this.score;
const spriteComponent = this.pickedUpAnimNode.getComponent(cc.Sprite);
//hardcode treasurePNG's path.
cc.loader.loadRes("textures/treasures/"+ this.type, cc.SpriteFrame, function (err, frame) {
if(err){
cc.warn(err);
return;
}
spriteComponent.spriteFrame = frame;
})
},
// LIFE-CYCLE CALLBACKS:
update (dt) {
const changingNode = this.pickedUpAnimNode;
const elapsedMillis = Date.now() - this.startedAtMillis;
if(elapsedMillis >= this.binglingAnimDurationMillis && null != this.binglingAnimNode && true == this.binglingAnimNode.active) {
this.binglingAnimNode.active = false;
this.startedAtMillis = Date.now();
}
if(this.binglingAnimNode.active)
return;
if (elapsedMillis > this.durationMillis) {
this.node.destroy();
return;
}
if (elapsedMillis <= this.firstDurationMillis) {
let posDiff = cc.v2(0, dt * this.yIncreaseSpeed);
changingNode.setPosition(changingNode.position.add(posDiff));
this.scoreLabelNode.setPosition(this.scoreLabelNode.position.add(posDiff));
changingNode.scale += (this.scaleIncreaseSpeed*dt);
} else {
let posDiff = cc.v2(dt * this.xIncreaseSpeed , ( -1 *dt * this.yDecreaseSpeed));
changingNode.setPosition(changingNode.position.add(posDiff));
this.scoreLabelNode.setPosition(this.scoreLabelNode.position.add(posDiff));
changingNode.opacity -= dt * this.opacityDegradeSpeed;
this.scoreLabelNode.opacity -= dt * this.opacityDegradeSpeed;
}
},
onLoad() {
this.pickedUpAnimNode.scale = 0;
this.startedAtMillis = Date.now();
this.firstDurationMillis = (0.8*this.durationMillis);
this.yIncreaseSpeed = (200 *1000/this.firstDurationMillis);
this.scaleIncreaseSpeed = (2 * 1000/this.firstDurationMillis);
this.scondDurationMillis = (0.2 * this.durationMillis );
this.opacityDegradeSpeed = (255*1000/this.scondDurationMillis);
this.yDecreaseSpeed = (30*1000/this.scondDurationMillis);
this.xIncreaseSpeed = (20*1000/this.scondDurationMillis);
}
});

View File

@@ -1,9 +0,0 @@
{
"ver": "1.0.5",
"uuid": "697ef72c-27ee-4184-9ae3-885808d58153",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -1,28 +0,0 @@
const BasePlayer = require("./BasePlayer");
cc.Class({
extends: BasePlayer,
// LIFE-CYCLE CALLBACKS:
start() {
BasePlayer.prototype.start.call(this);
},
onLoad() {
BasePlayer.prototype.onLoad.call(this);
this.clips = {
'01': 'FlatHeadSisterRunTop',
'0-1': 'FlatHeadSisterRunBottom',
'-20': 'FlatHeadSisterRunLeft',
'20': 'FlatHeadSisterRunRight',
'-21': 'FlatHeadSisterRunTopLeft',
'21': 'FlatHeadSisterRunTopRight',
'-2-1': 'FlatHeadSisterRunBottomLeft',
'2-1': 'FlatHeadSisterRunBottomRight'
};
},
update(dt) {
},
});

View File

@@ -1,9 +0,0 @@
{
"ver": "1.0.5",
"uuid": "233a1795-0de3-4d7c-9ce6-c5736ade723f",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -1213,6 +1213,7 @@ $root.protos = (function() {
* @property {number|Long|null} [rollbackEstimatedDtNanos] BattleColliderInfo rollbackEstimatedDtNanos
* @property {number|null} [worldToVirtualGridRatio] BattleColliderInfo worldToVirtualGridRatio
* @property {number|null} [virtualGridToWorldRatio] BattleColliderInfo virtualGridToWorldRatio
* @property {number|null} [spAtkLookupFrames] BattleColliderInfo spAtkLookupFrames
*/
/**
@@ -1408,6 +1409,14 @@ $root.protos = (function() {
*/
BattleColliderInfo.prototype.virtualGridToWorldRatio = 0;
/**
* BattleColliderInfo spAtkLookupFrames.
* @member {number} spAtkLookupFrames
* @memberof protos.BattleColliderInfo
* @instance
*/
BattleColliderInfo.prototype.spAtkLookupFrames = 0;
/**
* Creates a new BattleColliderInfo instance using the specified properties.
* @function create
@@ -1482,6 +1491,8 @@ $root.protos = (function() {
writer.uint32(/* id 21, wireType 1 =*/169).double(message.worldToVirtualGridRatio);
if (message.virtualGridToWorldRatio != null && Object.hasOwnProperty.call(message, "virtualGridToWorldRatio"))
writer.uint32(/* id 22, wireType 1 =*/177).double(message.virtualGridToWorldRatio);
if (message.spAtkLookupFrames != null && Object.hasOwnProperty.call(message, "spAtkLookupFrames"))
writer.uint32(/* id 23, wireType 0 =*/184).int32(message.spAtkLookupFrames);
return writer;
};
@@ -1642,6 +1653,10 @@ $root.protos = (function() {
message.virtualGridToWorldRatio = reader.double();
break;
}
case 23: {
message.spAtkLookupFrames = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
@@ -1757,6 +1772,9 @@ $root.protos = (function() {
if (message.virtualGridToWorldRatio != null && message.hasOwnProperty("virtualGridToWorldRatio"))
if (typeof message.virtualGridToWorldRatio !== "number")
return "virtualGridToWorldRatio: number expected";
if (message.spAtkLookupFrames != null && message.hasOwnProperty("spAtkLookupFrames"))
if (!$util.isInteger(message.spAtkLookupFrames))
return "spAtkLookupFrames: integer expected";
return null;
};
@@ -1846,6 +1864,8 @@ $root.protos = (function() {
message.worldToVirtualGridRatio = Number(object.worldToVirtualGridRatio);
if (object.virtualGridToWorldRatio != null)
message.virtualGridToWorldRatio = Number(object.virtualGridToWorldRatio);
if (object.spAtkLookupFrames != null)
message.spAtkLookupFrames = object.spAtkLookupFrames | 0;
return message;
};
@@ -1895,6 +1915,7 @@ $root.protos = (function() {
object.rollbackEstimatedDtNanos = options.longs === String ? "0" : 0;
object.worldToVirtualGridRatio = 0;
object.virtualGridToWorldRatio = 0;
object.spAtkLookupFrames = 0;
}
if (message.stageName != null && message.hasOwnProperty("stageName"))
object.stageName = message.stageName;
@@ -1953,6 +1974,8 @@ $root.protos = (function() {
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;
if (message.spAtkLookupFrames != null && message.hasOwnProperty("spAtkLookupFrames"))
object.spAtkLookupFrames = message.spAtkLookupFrames;
return object;
};
@@ -1997,10 +2020,14 @@ $root.protos = (function() {
* @property {sharedprotos.Direction|null} [dir] PlayerDownsync dir
* @property {number|null} [speed] PlayerDownsync speed
* @property {number|null} [battleState] PlayerDownsync battleState
* @property {number|null} [lastMoveGmtMillis] PlayerDownsync lastMoveGmtMillis
* @property {number|null} [score] PlayerDownsync score
* @property {boolean|null} [removed] PlayerDownsync removed
* @property {number|null} [joinIndex] PlayerDownsync joinIndex
* @property {number|null} [colliderRadius] PlayerDownsync colliderRadius
* @property {boolean|null} [removed] PlayerDownsync removed
* @property {number|null} [score] PlayerDownsync score
* @property {number|null} [lastMoveGmtMillis] PlayerDownsync lastMoveGmtMillis
* @property {string|null} [name] PlayerDownsync name
* @property {string|null} [displayName] PlayerDownsync displayName
* @property {string|null} [avatar] PlayerDownsync avatar
*/
/**
@@ -2067,20 +2094,20 @@ $root.protos = (function() {
PlayerDownsync.prototype.battleState = 0;
/**
* PlayerDownsync lastMoveGmtMillis.
* @member {number} lastMoveGmtMillis
* PlayerDownsync joinIndex.
* @member {number} joinIndex
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.lastMoveGmtMillis = 0;
PlayerDownsync.prototype.joinIndex = 0;
/**
* PlayerDownsync score.
* @member {number} score
* PlayerDownsync colliderRadius.
* @member {number} colliderRadius
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.score = 0;
PlayerDownsync.prototype.colliderRadius = 0;
/**
* PlayerDownsync removed.
@@ -2091,12 +2118,44 @@ $root.protos = (function() {
PlayerDownsync.prototype.removed = false;
/**
* PlayerDownsync joinIndex.
* @member {number} joinIndex
* PlayerDownsync score.
* @member {number} score
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.joinIndex = 0;
PlayerDownsync.prototype.score = 0;
/**
* PlayerDownsync lastMoveGmtMillis.
* @member {number} lastMoveGmtMillis
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.lastMoveGmtMillis = 0;
/**
* PlayerDownsync name.
* @member {string} name
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.name = "";
/**
* PlayerDownsync displayName.
* @member {string} displayName
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.displayName = "";
/**
* PlayerDownsync avatar.
* @member {string} avatar
* @memberof protos.PlayerDownsync
* @instance
*/
PlayerDownsync.prototype.avatar = "";
/**
* Creates a new PlayerDownsync instance using the specified properties.
@@ -2134,14 +2193,22 @@ $root.protos = (function() {
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speed);
if (message.battleState != null && Object.hasOwnProperty.call(message, "battleState"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.battleState);
if (message.lastMoveGmtMillis != null && Object.hasOwnProperty.call(message, "lastMoveGmtMillis"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.lastMoveGmtMillis);
if (message.joinIndex != null && Object.hasOwnProperty.call(message, "joinIndex"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.joinIndex);
if (message.colliderRadius != null && Object.hasOwnProperty.call(message, "colliderRadius"))
writer.uint32(/* id 8, wireType 1 =*/65).double(message.colliderRadius);
if (message.removed != null && Object.hasOwnProperty.call(message, "removed"))
writer.uint32(/* id 9, wireType 0 =*/72).bool(message.removed);
if (message.score != null && Object.hasOwnProperty.call(message, "score"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.score);
if (message.removed != null && Object.hasOwnProperty.call(message, "removed"))
writer.uint32(/* id 11, wireType 0 =*/88).bool(message.removed);
if (message.joinIndex != null && Object.hasOwnProperty.call(message, "joinIndex"))
writer.uint32(/* id 12, wireType 0 =*/96).int32(message.joinIndex);
if (message.lastMoveGmtMillis != null && Object.hasOwnProperty.call(message, "lastMoveGmtMillis"))
writer.uint32(/* id 11, wireType 0 =*/88).int32(message.lastMoveGmtMillis);
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
writer.uint32(/* id 12, wireType 2 =*/98).string(message.name);
if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName);
if (message.avatar != null && Object.hasOwnProperty.call(message, "avatar"))
writer.uint32(/* id 14, wireType 2 =*/114).string(message.avatar);
return writer;
};
@@ -2201,7 +2268,15 @@ $root.protos = (function() {
break;
}
case 7: {
message.lastMoveGmtMillis = reader.int32();
message.joinIndex = reader.int32();
break;
}
case 8: {
message.colliderRadius = reader.double();
break;
}
case 9: {
message.removed = reader.bool();
break;
}
case 10: {
@@ -2209,11 +2284,19 @@ $root.protos = (function() {
break;
}
case 11: {
message.removed = reader.bool();
message.lastMoveGmtMillis = reader.int32();
break;
}
case 12: {
message.joinIndex = reader.int32();
message.name = reader.string();
break;
}
case 13: {
message.displayName = reader.string();
break;
}
case 14: {
message.avatar = reader.string();
break;
}
default:
@@ -2271,18 +2354,30 @@ $root.protos = (function() {
if (message.battleState != null && message.hasOwnProperty("battleState"))
if (!$util.isInteger(message.battleState))
return "battleState: integer expected";
if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis"))
if (!$util.isInteger(message.lastMoveGmtMillis))
return "lastMoveGmtMillis: integer expected";
if (message.score != null && message.hasOwnProperty("score"))
if (!$util.isInteger(message.score))
return "score: integer expected";
if (message.removed != null && message.hasOwnProperty("removed"))
if (typeof message.removed !== "boolean")
return "removed: boolean expected";
if (message.joinIndex != null && message.hasOwnProperty("joinIndex"))
if (!$util.isInteger(message.joinIndex))
return "joinIndex: integer expected";
if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius"))
if (typeof message.colliderRadius !== "number")
return "colliderRadius: number expected";
if (message.removed != null && message.hasOwnProperty("removed"))
if (typeof message.removed !== "boolean")
return "removed: boolean expected";
if (message.score != null && message.hasOwnProperty("score"))
if (!$util.isInteger(message.score))
return "score: integer expected";
if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis"))
if (!$util.isInteger(message.lastMoveGmtMillis))
return "lastMoveGmtMillis: integer expected";
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
if (message.displayName != null && message.hasOwnProperty("displayName"))
if (!$util.isString(message.displayName))
return "displayName: string expected";
if (message.avatar != null && message.hasOwnProperty("avatar"))
if (!$util.isString(message.avatar))
return "avatar: string expected";
return null;
};
@@ -2313,14 +2408,22 @@ $root.protos = (function() {
message.speed = object.speed | 0;
if (object.battleState != null)
message.battleState = object.battleState | 0;
if (object.lastMoveGmtMillis != null)
message.lastMoveGmtMillis = object.lastMoveGmtMillis | 0;
if (object.score != null)
message.score = object.score | 0;
if (object.removed != null)
message.removed = Boolean(object.removed);
if (object.joinIndex != null)
message.joinIndex = object.joinIndex | 0;
if (object.colliderRadius != null)
message.colliderRadius = Number(object.colliderRadius);
if (object.removed != null)
message.removed = Boolean(object.removed);
if (object.score != null)
message.score = object.score | 0;
if (object.lastMoveGmtMillis != null)
message.lastMoveGmtMillis = object.lastMoveGmtMillis | 0;
if (object.name != null)
message.name = String(object.name);
if (object.displayName != null)
message.displayName = String(object.displayName);
if (object.avatar != null)
message.avatar = String(object.avatar);
return message;
};
@@ -2344,10 +2447,14 @@ $root.protos = (function() {
object.dir = null;
object.speed = 0;
object.battleState = 0;
object.lastMoveGmtMillis = 0;
object.score = 0;
object.removed = false;
object.joinIndex = 0;
object.colliderRadius = 0;
object.removed = false;
object.score = 0;
object.lastMoveGmtMillis = 0;
object.name = "";
object.displayName = "";
object.avatar = "";
}
if (message.id != null && message.hasOwnProperty("id"))
object.id = message.id;
@@ -2361,14 +2468,22 @@ $root.protos = (function() {
object.speed = message.speed;
if (message.battleState != null && message.hasOwnProperty("battleState"))
object.battleState = message.battleState;
if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis"))
object.lastMoveGmtMillis = message.lastMoveGmtMillis;
if (message.score != null && message.hasOwnProperty("score"))
object.score = message.score;
if (message.removed != null && message.hasOwnProperty("removed"))
object.removed = message.removed;
if (message.joinIndex != null && message.hasOwnProperty("joinIndex"))
object.joinIndex = message.joinIndex;
if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius"))
object.colliderRadius = options.json && !isFinite(message.colliderRadius) ? String(message.colliderRadius) : message.colliderRadius;
if (message.removed != null && message.hasOwnProperty("removed"))
object.removed = message.removed;
if (message.score != null && message.hasOwnProperty("score"))
object.score = message.score;
if (message.lastMoveGmtMillis != null && message.hasOwnProperty("lastMoveGmtMillis"))
object.lastMoveGmtMillis = message.lastMoveGmtMillis;
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.displayName != null && message.hasOwnProperty("displayName"))
object.displayName = message.displayName;
if (message.avatar != null && message.hasOwnProperty("avatar"))
object.avatar = message.avatar;
return object;
};
@@ -2401,29 +2516,26 @@ $root.protos = (function() {
return PlayerDownsync;
})();
protos.PlayerDownsyncMeta = (function() {
protos.InputFrameDecoded = (function() {
/**
* Properties of a PlayerDownsyncMeta.
* Properties of an InputFrameDecoded.
* @memberof protos
* @interface IPlayerDownsyncMeta
* @property {number|null} [id] PlayerDownsyncMeta id
* @property {string|null} [name] PlayerDownsyncMeta name
* @property {string|null} [displayName] PlayerDownsyncMeta displayName
* @property {string|null} [avatar] PlayerDownsyncMeta avatar
* @property {number|null} [joinIndex] PlayerDownsyncMeta joinIndex
* @property {number|null} [colliderRadius] PlayerDownsyncMeta colliderRadius
* @interface IInputFrameDecoded
* @property {number|null} [dx] InputFrameDecoded dx
* @property {number|null} [dy] InputFrameDecoded dy
* @property {number|null} [btnALevel] InputFrameDecoded btnALevel
*/
/**
* Constructs a new PlayerDownsyncMeta.
* Constructs a new InputFrameDecoded.
* @memberof protos
* @classdesc Represents a PlayerDownsyncMeta.
* @implements IPlayerDownsyncMeta
* @classdesc Represents an InputFrameDecoded.
* @implements IInputFrameDecoded
* @constructor
* @param {protos.IPlayerDownsyncMeta=} [properties] Properties to set
* @param {protos.IInputFrameDecoded=} [properties] Properties to set
*/
function PlayerDownsyncMeta(properties) {
function InputFrameDecoded(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -2431,145 +2543,103 @@ $root.protos = (function() {
}
/**
* PlayerDownsyncMeta id.
* @member {number} id
* @memberof protos.PlayerDownsyncMeta
* InputFrameDecoded dx.
* @member {number} dx
* @memberof protos.InputFrameDecoded
* @instance
*/
PlayerDownsyncMeta.prototype.id = 0;
InputFrameDecoded.prototype.dx = 0;
/**
* PlayerDownsyncMeta name.
* @member {string} name
* @memberof protos.PlayerDownsyncMeta
* InputFrameDecoded dy.
* @member {number} dy
* @memberof protos.InputFrameDecoded
* @instance
*/
PlayerDownsyncMeta.prototype.name = "";
InputFrameDecoded.prototype.dy = 0;
/**
* PlayerDownsyncMeta displayName.
* @member {string} displayName
* @memberof protos.PlayerDownsyncMeta
* InputFrameDecoded btnALevel.
* @member {number} btnALevel
* @memberof protos.InputFrameDecoded
* @instance
*/
PlayerDownsyncMeta.prototype.displayName = "";
InputFrameDecoded.prototype.btnALevel = 0;
/**
* PlayerDownsyncMeta avatar.
* @member {string} avatar
* @memberof protos.PlayerDownsyncMeta
* @instance
*/
PlayerDownsyncMeta.prototype.avatar = "";
/**
* PlayerDownsyncMeta joinIndex.
* @member {number} joinIndex
* @memberof protos.PlayerDownsyncMeta
* @instance
*/
PlayerDownsyncMeta.prototype.joinIndex = 0;
/**
* PlayerDownsyncMeta colliderRadius.
* @member {number} colliderRadius
* @memberof protos.PlayerDownsyncMeta
* @instance
*/
PlayerDownsyncMeta.prototype.colliderRadius = 0;
/**
* Creates a new PlayerDownsyncMeta instance using the specified properties.
* Creates a new InputFrameDecoded instance using the specified properties.
* @function create
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {protos.IPlayerDownsyncMeta=} [properties] Properties to set
* @returns {protos.PlayerDownsyncMeta} PlayerDownsyncMeta instance
* @param {protos.IInputFrameDecoded=} [properties] Properties to set
* @returns {protos.InputFrameDecoded} InputFrameDecoded instance
*/
PlayerDownsyncMeta.create = function create(properties) {
return new PlayerDownsyncMeta(properties);
InputFrameDecoded.create = function create(properties) {
return new InputFrameDecoded(properties);
};
/**
* Encodes the specified PlayerDownsyncMeta message. Does not implicitly {@link protos.PlayerDownsyncMeta.verify|verify} messages.
* Encodes the specified InputFrameDecoded message. Does not implicitly {@link protos.InputFrameDecoded.verify|verify} messages.
* @function encode
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {protos.PlayerDownsyncMeta} message PlayerDownsyncMeta message or plain object to encode
* @param {protos.InputFrameDecoded} message InputFrameDecoded message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
PlayerDownsyncMeta.encode = function encode(message, writer) {
InputFrameDecoded.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName);
if (message.avatar != null && Object.hasOwnProperty.call(message, "avatar"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.avatar);
if (message.joinIndex != null && Object.hasOwnProperty.call(message, "joinIndex"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.joinIndex);
if (message.colliderRadius != null && Object.hasOwnProperty.call(message, "colliderRadius"))
writer.uint32(/* id 6, wireType 1 =*/49).double(message.colliderRadius);
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);
if (message.btnALevel != null && Object.hasOwnProperty.call(message, "btnALevel"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.btnALevel);
return writer;
};
/**
* Encodes the specified PlayerDownsyncMeta message, length delimited. Does not implicitly {@link protos.PlayerDownsyncMeta.verify|verify} messages.
* Encodes the specified InputFrameDecoded message, length delimited. Does not implicitly {@link protos.InputFrameDecoded.verify|verify} messages.
* @function encodeDelimited
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {protos.PlayerDownsyncMeta} message PlayerDownsyncMeta message or plain object to encode
* @param {protos.InputFrameDecoded} message InputFrameDecoded message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
PlayerDownsyncMeta.encodeDelimited = function encodeDelimited(message, writer) {
InputFrameDecoded.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a PlayerDownsyncMeta message from the specified reader or buffer.
* Decodes an InputFrameDecoded message from the specified reader or buffer.
* @function decode
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {protos.PlayerDownsyncMeta} PlayerDownsyncMeta
* @returns {protos.InputFrameDecoded} InputFrameDecoded
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
PlayerDownsyncMeta.decode = function decode(reader, length) {
InputFrameDecoded.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.PlayerDownsyncMeta();
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.InputFrameDecoded();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.id = reader.int32();
message.dx = reader.int32();
break;
}
case 2: {
message.name = reader.string();
message.dy = reader.int32();
break;
}
case 3: {
message.displayName = reader.string();
break;
}
case 4: {
message.avatar = reader.string();
break;
}
case 5: {
message.joinIndex = reader.int32();
break;
}
case 6: {
message.colliderRadius = reader.double();
message.btnALevel = reader.int32();
break;
}
default:
@@ -2581,143 +2651,119 @@ $root.protos = (function() {
};
/**
* Decodes a PlayerDownsyncMeta message from the specified reader or buffer, length delimited.
* Decodes an InputFrameDecoded message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {protos.PlayerDownsyncMeta} PlayerDownsyncMeta
* @returns {protos.InputFrameDecoded} InputFrameDecoded
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
PlayerDownsyncMeta.decodeDelimited = function decodeDelimited(reader) {
InputFrameDecoded.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a PlayerDownsyncMeta message.
* Verifies an InputFrameDecoded message.
* @function verify
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
PlayerDownsyncMeta.verify = function verify(message) {
InputFrameDecoded.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.id != null && message.hasOwnProperty("id"))
if (!$util.isInteger(message.id))
return "id: integer expected";
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
if (message.displayName != null && message.hasOwnProperty("displayName"))
if (!$util.isString(message.displayName))
return "displayName: string expected";
if (message.avatar != null && message.hasOwnProperty("avatar"))
if (!$util.isString(message.avatar))
return "avatar: string expected";
if (message.joinIndex != null && message.hasOwnProperty("joinIndex"))
if (!$util.isInteger(message.joinIndex))
return "joinIndex: integer expected";
if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius"))
if (typeof message.colliderRadius !== "number")
return "colliderRadius: number expected";
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";
if (message.btnALevel != null && message.hasOwnProperty("btnALevel"))
if (!$util.isInteger(message.btnALevel))
return "btnALevel: integer expected";
return null;
};
/**
* Creates a PlayerDownsyncMeta message from a plain object. Also converts values to their respective internal types.
* Creates an InputFrameDecoded message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {Object.<string,*>} object Plain object
* @returns {protos.PlayerDownsyncMeta} PlayerDownsyncMeta
* @returns {protos.InputFrameDecoded} InputFrameDecoded
*/
PlayerDownsyncMeta.fromObject = function fromObject(object) {
if (object instanceof $root.protos.PlayerDownsyncMeta)
InputFrameDecoded.fromObject = function fromObject(object) {
if (object instanceof $root.protos.InputFrameDecoded)
return object;
var message = new $root.protos.PlayerDownsyncMeta();
if (object.id != null)
message.id = object.id | 0;
if (object.name != null)
message.name = String(object.name);
if (object.displayName != null)
message.displayName = String(object.displayName);
if (object.avatar != null)
message.avatar = String(object.avatar);
if (object.joinIndex != null)
message.joinIndex = object.joinIndex | 0;
if (object.colliderRadius != null)
message.colliderRadius = Number(object.colliderRadius);
var message = new $root.protos.InputFrameDecoded();
if (object.dx != null)
message.dx = object.dx | 0;
if (object.dy != null)
message.dy = object.dy | 0;
if (object.btnALevel != null)
message.btnALevel = object.btnALevel | 0;
return message;
};
/**
* Creates a plain object from a PlayerDownsyncMeta message. Also converts values to other types if specified.
* Creates a plain object from an InputFrameDecoded message. Also converts values to other types if specified.
* @function toObject
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {protos.PlayerDownsyncMeta} message PlayerDownsyncMeta
* @param {protos.InputFrameDecoded} message InputFrameDecoded
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
PlayerDownsyncMeta.toObject = function toObject(message, options) {
InputFrameDecoded.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.id = 0;
object.name = "";
object.displayName = "";
object.avatar = "";
object.joinIndex = 0;
object.colliderRadius = 0;
object.dx = 0;
object.dy = 0;
object.btnALevel = 0;
}
if (message.id != null && message.hasOwnProperty("id"))
object.id = message.id;
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.displayName != null && message.hasOwnProperty("displayName"))
object.displayName = message.displayName;
if (message.avatar != null && message.hasOwnProperty("avatar"))
object.avatar = message.avatar;
if (message.joinIndex != null && message.hasOwnProperty("joinIndex"))
object.joinIndex = message.joinIndex;
if (message.colliderRadius != null && message.hasOwnProperty("colliderRadius"))
object.colliderRadius = options.json && !isFinite(message.colliderRadius) ? String(message.colliderRadius) : message.colliderRadius;
if (message.dx != null && message.hasOwnProperty("dx"))
object.dx = message.dx;
if (message.dy != null && message.hasOwnProperty("dy"))
object.dy = message.dy;
if (message.btnALevel != null && message.hasOwnProperty("btnALevel"))
object.btnALevel = message.btnALevel;
return object;
};
/**
* Converts this PlayerDownsyncMeta to JSON.
* Converts this InputFrameDecoded to JSON.
* @function toJSON
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @instance
* @returns {Object.<string,*>} JSON object
*/
PlayerDownsyncMeta.prototype.toJSON = function toJSON() {
InputFrameDecoded.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for PlayerDownsyncMeta
* Gets the default type url for InputFrameDecoded
* @function getTypeUrl
* @memberof protos.PlayerDownsyncMeta
* @memberof protos.InputFrameDecoded
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
PlayerDownsyncMeta.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
InputFrameDecoded.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/protos.PlayerDownsyncMeta";
return typeUrlPrefix + "/protos.InputFrameDecoded";
};
return PlayerDownsyncMeta;
return InputFrameDecoded;
})();
protos.InputFrameUpsync = (function() {
@@ -2727,7 +2773,7 @@ $root.protos = (function() {
* @memberof protos
* @interface IInputFrameUpsync
* @property {number|null} [inputFrameId] InputFrameUpsync inputFrameId
* @property {number|null} [encodedDir] InputFrameUpsync encodedDir
* @property {number|Long|null} [encoded] InputFrameUpsync encoded
*/
/**
@@ -2754,12 +2800,12 @@ $root.protos = (function() {
InputFrameUpsync.prototype.inputFrameId = 0;
/**
* InputFrameUpsync encodedDir.
* @member {number} encodedDir
* InputFrameUpsync encoded.
* @member {number|Long} encoded
* @memberof protos.InputFrameUpsync
* @instance
*/
InputFrameUpsync.prototype.encodedDir = 0;
InputFrameUpsync.prototype.encoded = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* Creates a new InputFrameUpsync instance using the specified properties.
@@ -2787,8 +2833,8 @@ $root.protos = (function() {
writer = $Writer.create();
if (message.inputFrameId != null && Object.hasOwnProperty.call(message, "inputFrameId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputFrameId);
if (message.encodedDir != null && Object.hasOwnProperty.call(message, "encodedDir"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.encodedDir);
if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.encoded);
return writer;
};
@@ -2827,8 +2873,8 @@ $root.protos = (function() {
message.inputFrameId = reader.int32();
break;
}
case 6: {
message.encodedDir = reader.int32();
case 2: {
message.encoded = reader.uint64();
break;
}
default:
@@ -2869,9 +2915,9 @@ $root.protos = (function() {
if (message.inputFrameId != null && message.hasOwnProperty("inputFrameId"))
if (!$util.isInteger(message.inputFrameId))
return "inputFrameId: integer expected";
if (message.encodedDir != null && message.hasOwnProperty("encodedDir"))
if (!$util.isInteger(message.encodedDir))
return "encodedDir: integer expected";
if (message.encoded != null && message.hasOwnProperty("encoded"))
if (!$util.isInteger(message.encoded) && !(message.encoded && $util.isInteger(message.encoded.low) && $util.isInteger(message.encoded.high)))
return "encoded: integer|Long expected";
return null;
};
@@ -2889,8 +2935,15 @@ $root.protos = (function() {
var message = new $root.protos.InputFrameUpsync();
if (object.inputFrameId != null)
message.inputFrameId = object.inputFrameId | 0;
if (object.encodedDir != null)
message.encodedDir = object.encodedDir | 0;
if (object.encoded != null)
if ($util.Long)
(message.encoded = $util.Long.fromValue(object.encoded)).unsigned = true;
else if (typeof object.encoded === "string")
message.encoded = parseInt(object.encoded, 10);
else if (typeof object.encoded === "number")
message.encoded = object.encoded;
else if (typeof object.encoded === "object")
message.encoded = new $util.LongBits(object.encoded.low >>> 0, object.encoded.high >>> 0).toNumber(true);
return message;
};
@@ -2909,12 +2962,19 @@ $root.protos = (function() {
var object = {};
if (options.defaults) {
object.inputFrameId = 0;
object.encodedDir = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.encoded = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.encoded = options.longs === String ? "0" : 0;
}
if (message.inputFrameId != null && message.hasOwnProperty("inputFrameId"))
object.inputFrameId = message.inputFrameId;
if (message.encodedDir != null && message.hasOwnProperty("encodedDir"))
object.encodedDir = message.encodedDir;
if (message.encoded != null && message.hasOwnProperty("encoded"))
if (typeof message.encoded === "number")
object.encoded = options.longs === String ? String(message.encoded) : message.encoded;
else
object.encoded = options.longs === String ? $util.Long.prototype.toString.call(message.encoded) : options.longs === Number ? new $util.LongBits(message.encoded.low >>> 0, message.encoded.high >>> 0).toNumber(true) : message.encoded;
return object;
};
@@ -3472,7 +3532,6 @@ $root.protos = (function() {
* @property {number|null} [id] RoomDownsyncFrame id
* @property {Object.<string,protos.PlayerDownsync>|null} [players] RoomDownsyncFrame players
* @property {number|Long|null} [countdownNanos] RoomDownsyncFrame countdownNanos
* @property {Object.<string,protos.PlayerDownsyncMeta>|null} [playerMetas] RoomDownsyncFrame playerMetas
*/
/**
@@ -3485,7 +3544,6 @@ $root.protos = (function() {
*/
function RoomDownsyncFrame(properties) {
this.players = {};
this.playerMetas = {};
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -3516,14 +3574,6 @@ $root.protos = (function() {
*/
RoomDownsyncFrame.prototype.countdownNanos = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* RoomDownsyncFrame playerMetas.
* @member {Object.<string,protos.PlayerDownsyncMeta>} playerMetas
* @memberof protos.RoomDownsyncFrame
* @instance
*/
RoomDownsyncFrame.prototype.playerMetas = $util.emptyObject;
/**
* Creates a new RoomDownsyncFrame instance using the specified properties.
* @function create
@@ -3557,11 +3607,6 @@ $root.protos = (function() {
}
if (message.countdownNanos != null && Object.hasOwnProperty.call(message, "countdownNanos"))
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.countdownNanos);
if (message.playerMetas != null && Object.hasOwnProperty.call(message, "playerMetas"))
for (var keys = Object.keys(message.playerMetas), i = 0; i < keys.length; ++i) {
writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]);
$root.protos.PlayerDownsyncMeta.encode(message.playerMetas[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
}
return writer;
};
@@ -3627,29 +3672,6 @@ $root.protos = (function() {
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.protos.PlayerDownsyncMeta.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.playerMetas[key] = value;
break;
}
default:
reader.skipType(tag & 7);
break;
@@ -3705,20 +3727,6 @@ $root.protos = (function() {
if (message.countdownNanos != null && message.hasOwnProperty("countdownNanos"))
if (!$util.isInteger(message.countdownNanos) && !(message.countdownNanos && $util.isInteger(message.countdownNanos.low) && $util.isInteger(message.countdownNanos.high)))
return "countdownNanos: integer|Long expected";
if (message.playerMetas != null && message.hasOwnProperty("playerMetas")) {
if (!$util.isObject(message.playerMetas))
return "playerMetas: object expected";
var key = Object.keys(message.playerMetas);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "playerMetas: integer key{k:int32} expected";
{
var error = $root.protos.PlayerDownsyncMeta.verify(message.playerMetas[key[i]]);
if (error)
return "playerMetas." + error;
}
}
}
return null;
};
@@ -3755,16 +3763,6 @@ $root.protos = (function() {
message.countdownNanos = object.countdownNanos;
else if (typeof object.countdownNanos === "object")
message.countdownNanos = new $util.LongBits(object.countdownNanos.low >>> 0, object.countdownNanos.high >>> 0).toNumber();
if (object.playerMetas) {
if (typeof object.playerMetas !== "object")
throw TypeError(".protos.RoomDownsyncFrame.playerMetas: object expected");
message.playerMetas = {};
for (var keys = Object.keys(object.playerMetas), i = 0; i < keys.length; ++i) {
if (typeof object.playerMetas[keys[i]] !== "object")
throw TypeError(".protos.RoomDownsyncFrame.playerMetas: object expected");
message.playerMetas[keys[i]] = $root.protos.PlayerDownsyncMeta.fromObject(object.playerMetas[keys[i]]);
}
}
return message;
};
@@ -3781,10 +3779,8 @@ $root.protos = (function() {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults) {
if (options.objects || options.defaults)
object.players = {};
object.playerMetas = {};
}
if (options.defaults) {
object.id = 0;
if ($util.Long) {
@@ -3806,11 +3802,6 @@ $root.protos = (function() {
object.countdownNanos = options.longs === String ? String(message.countdownNanos) : message.countdownNanos;
else
object.countdownNanos = options.longs === String ? $util.Long.prototype.toString.call(message.countdownNanos) : options.longs === Number ? new $util.LongBits(message.countdownNanos.low >>> 0, message.countdownNanos.high >>> 0).toNumber() : message.countdownNanos;
if (message.playerMetas && (keys2 = Object.keys(message.playerMetas)).length) {
object.playerMetas = {};
for (var j = 0; j < keys2.length; ++j)
object.playerMetas[keys2[j]] = $root.protos.PlayerDownsyncMeta.toObject(message.playerMetas[keys2[j]], options);
}
return object;
};

6
proto_gen_shortcut.sh Normal file → Executable file
View File

@@ -24,6 +24,10 @@ 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/geometry.proto $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 # Not working in OSX, needs further investigation
if [[ $OSTYPE == 'darwin'* ]]; then
sed -i '' -e 's#require("protobufjs/minimal")#require("./protobuf-with-floating-num-decoding-endianess-toggle")#g' $js_outdir/room_downsync_frame_proto_bundle.forcemsg.js
else
sed -i 's#require("protobufjs/minimal")#require("./protobuf-with-floating-num-decoding-endianess-toggle")#g' $js_outdir/room_downsync_frame_proto_bundle.forcemsg.js
fi
echo "JavaScript part done"