Documentation ¶
Overview ¶
记录战斗关键数据并储存,用于战斗结算和重连重新开启战斗
Index ¶
- Variables
- type Avatar
- type Battle
- type DbAvatar
- type DbItem
- type DbLineUp
- type DbScene
- type Dbgacha
- type EntityList
- type Equipment
- type Game
- func (g *Game) AddAvatar(avatarId uint32)
- func (g *Game) AddEquipment(tid uint32)
- func (g *Game) AddGachaItem(id uint32) (bool, bool)
- func (g *Game) AddHeadIcon(headIconId uint32)
- func (g *Game) AddMaterial(tid, num uint32)
- func (g *Game) AddPalyerData(uid uint32) *PlayerData
- func (g *Game) AddRelic(tid uint32)
- func (g *Game) AddTrailblazerExp(num uint32)
- func (g *Game) AutoUpDataPlayer()
- func (g *Game) AvatarExpUpCsReq(payloadMsg []byte)
- func (g *Game) AvatarPlayerSyncScNotify(avatarId uint32)
- func (g *Game) BattleSyncLineupNotify(index uint32)
- func (g *Game) ChangeLineupLeaderCsReq(payloadMsg []byte)
- func (g *Game) ChangePlayer()
- func (g *Game) DecodePayloadToProto(cmdId uint16, msg []byte) (protoObj pb.Message)
- func (g *Game) DelEquipmentPlayerSyncScNotify(equipmentList []uint32)
- func (g *Game) DelMaterialPlayerSyncScNotify(pileItem []*Material)
- func (g *Game) DoGachaCsReq(payloadMsg []byte)
- func (g *Game) DressAvatarCsReq(payloadMsg []byte)
- func (g *Game) DressAvatarPlayerSyncScNotify(avatarId, equipmentUniqueId uint32)
- func (g *Game) EnterSceneByServerScNotify(entryId, teleportId uint32)
- func (g *Game) EnterSceneCsReq(payloadMsg []byte)
- func (g *Game) EquipmentPlayerSyncScNotify(tid, uniqueId uint32)
- func (g *Game) ExchangeHcoinCsReq(payloadMsg []byte)
- func (g *Game) ExpUpEquipmentCsReq(payloadMsg []byte)
- func (g *Game) GMRegisterMessage(cmdId uint16, payloadMsg pb.Message)
- func (g *Game) GachaRandom(gachaId uint32) uint32
- func (g *Game) GetAvatarHp(avatarId uint32) uint32
- func (g *Game) GetBattleIdGuid() uint32
- func (g *Game) GetCurChallengeCsReq(payloadMsg []byte)
- func (g *Game) GetFirstTalkNpcCsReq()
- func (g *Game) GetGacha(gachaId uint32) *Num
- func (g *Game) GetMailCsReq()
- func (g *Game) GetNextGameObjectGuid() uint64
- func (g *Game) GetProbability(gachaId uint32) (uint32, uint32)
- func (g *Game) GetQuestDataCsReq(payloadMsg []byte)
- func (g *Game) GetRogueInfoCsReq(payloadMsg []byte)
- func (g *Game) GetRogueScoreRewardInfoCsReq()
- func (g *Game) GetRogueTalentInfoCsReq()
- func (g *Game) GetSceneAvatarId() uint32
- func (g *Game) GetShopListCsReq()
- func (g *Game) GetSkilltree(avatarId uint32) []*proto.AvatarSkillTree
- func (g *Game) GmGive(payloadMsg pb.Message)
- func (g *Game) GmWorldLevel(payloadMsg pb.Message)
- func (g *Game) HandleGetActivityScheduleConfigCsReq(payloadMsg []byte)
- func (g *Game) HandleGetAllLineupDataCsReq(payloadMsg []byte)
- func (g *Game) HandleGetArchiveDataCsReq(payloadMsg []byte)
- func (g *Game) HandleGetAssistHistoryCsReq()
- func (g *Game) HandleGetAvatarDataCsReq(payloadMsg []byte)
- func (g *Game) HandleGetBagCsReq(payloadMsg []byte)
- func (g *Game) HandleGetBasicInfoCsReq()
- func (g *Game) HandleGetChallengeCsReq(payloadMsg []byte)
- func (g *Game) HandleGetChatEmojiListCsReq(payloadMsg []byte)
- func (g *Game) HandleGetCurLineupDataCsReq(payloadMsg []byte)
- func (g *Game) HandleGetCurSceneInfoCsReq(payloadMsg []byte)
- func (g *Game) HandleGetEnteredSceneCsReq(payloadMsg []byte)
- func (g *Game) HandleGetFriendLoginInfoCsReq(payloadMsg []byte)
- func (g *Game) HandleGetGachaCeilingCsReq(payloadMsg []byte)
- func (g *Game) HandleGetGachaInfoCsReq(payloadMsg []byte)
- func (g *Game) HandleGetHeroBasicTypeInfoCsReq(payloadMsg []byte)
- func (g *Game) HandleGetJukeboxDataCsReq(payloadMsg []byte)
- func (g *Game) HandleGetMissionStatusCsReq(payloadMsg []byte)
- func (g *Game) HandleGetPhoneDataCsReq(payloadMsg []byte)
- func (g *Game) HandleGetPlayerBoardDataCsReq(payloadMsg []byte)
- func (g *Game) HandleGetRogueHandbookDataCsReq(payloadMsg []byte)
- func (g *Game) HandleJoinLineupCsReq(payloadMsg []byte)
- func (g *Game) HandlePlayerHeartBeatCsReq(payloadMsg []byte)
- func (g *Game) HandlePlayerLoginCsReq(payloadMsg []byte)
- func (g *Game) HandlePlayerLoginFinishCsReq(payloadMsg []byte)
- func (g *Game) HandleQueryProductInfoCsReq(payloadMsg []byte)
- func (g *Game) HandleSwapLineupCsReq(payloadMsg []byte)
- func (g *Game) HandleSwitchLineupIndexCsReq(payloadMsg []byte)
- func (g *Game) HanldeGetSceneMapInfoCsReq(payloadMsg []byte)
- func (g *Game) InteractPropCsReq()
- func (g *Game) KickPlayer() error
- func (g *Game) LeaveRogueCsReq(payloadMsg []byte)
- func (g *Game) MaterialPlayerSyncScNotify(tid uint32)
- func (g *Game) PVEBattleResultCsReq(payloadMsg []byte)
- func (g *Game) PlayerLogoutCsReq()
- func (g *Game) PlayerPlayerSyncScNotify()
- func (g *Game) PromoteAvatarCsReq(payloadMsg []byte)
- func (g *Game) PromoteEquipmentCsReq(payloadMsg []byte)
- func (g *Game) QuitLineupCsReq(payloadMsg []byte)
- func (g *Game) QuitRogueCsReq(payloadMsg []byte)
- func (g *Game) RankUpAvatarCsReq(payloadMsg []byte)
- func (g *Game) RankUpEquipmentCsReq(payloadMsg []byte)
- func (g *Game) RegisterMessage(cmdId uint16, payloadMsg []byte)
- func (g *Game) RelicPlayerSyncScNotify(tid, uniqueId uint32)
- func (g *Game) RelicScenePlaneEventScNotify(uniqueId uint32)
- func (g *Game) ReplaceLineupCsReq(payloadMsg []byte)
- func (g *Game) SceneCastSkillCsReq(payloadMsg []byte)
- func (g *Game) SceneEntityMoveCsReq(payloadMsg []byte)
- func (g *Game) SceneEntityMoveScNotify()
- func (g *Game) SceneGroupRefreshScNotify()
- func (g *Game) ScenePlaneEventScNotify(id, num uint32)
- func (g *Game) Send(cmdid uint16, playerMsg pb.Message)
- func (g *Game) SetClientPausedCsReq()
- func (g *Game) SetGameplayBirthdayCsReq(payloadMsg []byte)
- func (g *Game) SetHeadIconCsReq(payloadMsg []byte)
- func (g *Game) SetHeroBasicTypeCsReq(payloadMsg []byte)
- func (g *Game) SetLineupNameCsReq(payloadMsg []byte)
- func (g *Game) SetNicknameCsReq(payloadMsg []byte)
- func (g *Game) SetSignatureCsReq(payloadMsg []byte)
- func (g *Game) StaminaInfoScNotify()
- func (g *Game) StartCocoonStageCsReq(payloadMsg []byte)
- func (g *Game) StartRogueCsReq(payloadMsg []byte)
- func (g *Game) SubtractMaterial(tid, num uint32)
- func (g *Game) SwapLineup(index, src_slot, dst_slot uint32)
- func (g *Game) SyncClientResVersionCsReq(payloadMsg []byte)
- func (g *Game) SyncLineupNotify(index uint32)
- func (g *Game) TakePromotionRewardCsReq(payloadMsg []byte)
- func (g *Game) TextJoinQueryCsReq()
- func (g *Game) UnDbLineUp(index uint32, Slot uint32, avatarId uint32)
- func (g *Game) UnlockSkilltreeCsReq(payloadMsg []byte)
- func (g *Game) UpDataPlayer() error
- type LineUp
- type Material
- type NetMsg
- type Num
- type PlayerData
- type Relic
- type RelicAffix
- type Rogue
- type Skilltree
- type SpBarInfo
- type Vector
Constants ¶
This section is empty.
Variables ¶
View Source
var SNOWFLAKE *alg.SnowflakeWorker // 雪花唯一id生成器
Functions ¶
This section is empty.
Types ¶
type Avatar ¶
type Avatar struct { AvatarId uint32 // 角色id Exp uint32 // 经验 Level uint32 // 等级 Type proto.AvatarType // 角色状态 FirstMetTimestamp uint64 // 获得时间戳 Promotion uint32 // 突破等阶 Rank uint32 // 命座 Hp uint32 // 血量 SpBar *SpBarInfo // 能量 SkilltreeList []*Skilltree // 技能等级数据 [id]level EquipmentUniqueId uint32 // 装备光锥 TakenRewards []uint32 // 已领取的突破奖励 BuffList uint32 // 开启战斗的buff }
type Battle ¶
type Battle struct { BattleId uint32 // 战斗ID Wave uint32 // 次数 EventID uint32 // 怪物群实体id LogicRandomSeed uint32 // 逻辑随机种子 RoundsLimit uint32 // 回合限制 StaminaCost uint32 // 扣除体力 DisplayItemList []*Material // 奖励物品 BuffList []*proto.BattleBuff // Buff列表 BattleAvatarList []*proto.BattleAvatar // 战斗角色列表 }
type DbAvatar ¶
type DbAvatar struct { Avatar map[uint32]*Avatar MainAvatar proto.HeroBasicType // 默认主角 MainAvatarList []uint32 // 主角们 }
type EntityList ¶
type Game ¶
type Game struct { IsToken bool // 是否通过token验证 Uid uint32 Seed uint64 NetMsgInput chan *NetMsg KcpConn *kcp.UDPSession LastActiveTime int64 // 最近一次的活跃时间 // 玩家数据 Player *PlayerData // 密钥 XorKey []byte }
func (*Game) AddEquipment ¶
func (*Game) AddHeadIcon ¶
func (*Game) AddMaterial ¶
func (*Game) AddTrailblazerExp ¶
func (*Game) AutoUpDataPlayer ¶
func (g *Game) AutoUpDataPlayer()
func (*Game) AvatarExpUpCsReq ¶
func (*Game) AvatarPlayerSyncScNotify ¶
func (*Game) ChangeLineupLeaderCsReq ¶
func (*Game) ChangePlayer ¶
func (g *Game) ChangePlayer()
func (*Game) DecodePayloadToProto ¶
func (*Game) DelEquipmentPlayerSyncScNotify ¶
func (*Game) DelMaterialPlayerSyncScNotify ¶
func (*Game) DoGachaCsReq ¶
func (*Game) DressAvatarCsReq ¶
func (*Game) DressAvatarPlayerSyncScNotify ¶
光锥交换通知
func (*Game) EnterSceneByServerScNotify ¶
通知客户端进入场景
func (*Game) EnterSceneCsReq ¶
func (*Game) EquipmentPlayerSyncScNotify ¶
func (*Game) ExchangeHcoinCsReq ¶
func (*Game) ExpUpEquipmentCsReq ¶
func (*Game) GMRegisterMessage ¶
func (*Game) GachaRandom ¶
func (*Game) GetAvatarHp ¶
func (*Game) GetBattleIdGuid ¶
func (*Game) GetCurChallengeCsReq ¶
func (*Game) GetFirstTalkNpcCsReq ¶
func (g *Game) GetFirstTalkNpcCsReq()
func (*Game) GetMailCsReq ¶
func (g *Game) GetMailCsReq()
func (*Game) GetNextGameObjectGuid ¶
func (*Game) GetQuestDataCsReq ¶
func (*Game) GetRogueInfoCsReq ¶
func (*Game) GetRogueScoreRewardInfoCsReq ¶
func (g *Game) GetRogueScoreRewardInfoCsReq()
func (*Game) GetRogueTalentInfoCsReq ¶
func (g *Game) GetRogueTalentInfoCsReq()
func (*Game) GetSceneAvatarId ¶
func (*Game) GetShopListCsReq ¶
func (g *Game) GetShopListCsReq()
func (*Game) GetSkilltree ¶
func (g *Game) GetSkilltree(avatarId uint32) []*proto.AvatarSkillTree
func (*Game) GmWorldLevel ¶
func (*Game) HandleGetActivityScheduleConfigCsReq ¶
func (*Game) HandleGetAllLineupDataCsReq ¶
func (*Game) HandleGetArchiveDataCsReq ¶
func (*Game) HandleGetAssistHistoryCsReq ¶
func (g *Game) HandleGetAssistHistoryCsReq()
func (*Game) HandleGetAvatarDataCsReq ¶
func (*Game) HandleGetBagCsReq ¶
func (*Game) HandleGetBasicInfoCsReq ¶
func (g *Game) HandleGetBasicInfoCsReq()
func (*Game) HandleGetChallengeCsReq ¶
func (*Game) HandleGetChatEmojiListCsReq ¶
func (*Game) HandleGetCurLineupDataCsReq ¶
func (*Game) HandleGetCurSceneInfoCsReq ¶
客户端登录需要的包,不是传送的通知包
func (*Game) HandleGetEnteredSceneCsReq ¶
func (*Game) HandleGetFriendLoginInfoCsReq ¶
func (*Game) HandleGetGachaCeilingCsReq ¶
func (*Game) HandleGetGachaInfoCsReq ¶
func (*Game) HandleGetHeroBasicTypeInfoCsReq ¶
func (*Game) HandleGetJukeboxDataCsReq ¶
func (*Game) HandleGetMissionStatusCsReq ¶
func (*Game) HandleGetPhoneDataCsReq ¶
func (*Game) HandleGetPlayerBoardDataCsReq ¶
func (*Game) HandleGetRogueHandbookDataCsReq ¶
func (*Game) HandleJoinLineupCsReq ¶
func (*Game) HandlePlayerHeartBeatCsReq ¶
func (*Game) HandlePlayerLoginCsReq ¶
func (*Game) HandlePlayerLoginFinishCsReq ¶
func (*Game) HandleQueryProductInfoCsReq ¶
func (*Game) HandleSwapLineupCsReq ¶
func (*Game) HandleSwitchLineupIndexCsReq ¶
func (*Game) HanldeGetSceneMapInfoCsReq ¶
func (*Game) InteractPropCsReq ¶
func (g *Game) InteractPropCsReq()
func (*Game) KickPlayer ¶
func (*Game) LeaveRogueCsReq ¶
func (*Game) MaterialPlayerSyncScNotify ¶
func (*Game) PVEBattleResultCsReq ¶
func (*Game) PromoteAvatarCsReq ¶
func (*Game) PromoteEquipmentCsReq ¶
func (*Game) QuitLineupCsReq ¶
func (*Game) QuitRogueCsReq ¶
func (*Game) RankUpAvatarCsReq ¶
func (*Game) RankUpEquipmentCsReq ¶
func (*Game) RegisterMessage ¶
func (*Game) RelicPlayerSyncScNotify ¶
func (*Game) RelicScenePlaneEventScNotify ¶
func (*Game) ReplaceLineupCsReq ¶
func (*Game) SceneCastSkillCsReq ¶
func (*Game) SceneEntityMoveCsReq ¶
func (*Game) SceneGroupRefreshScNotify ¶
func (g *Game) SceneGroupRefreshScNotify()
func (*Game) ScenePlaneEventScNotify ¶
func (*Game) SetClientPausedCsReq ¶
func (g *Game) SetClientPausedCsReq()
func (*Game) SetGameplayBirthdayCsReq ¶
func (*Game) SetHeadIconCsReq ¶
func (*Game) SetHeroBasicTypeCsReq ¶
func (*Game) SetLineupNameCsReq ¶
func (*Game) SetNicknameCsReq ¶
func (*Game) SetSignatureCsReq ¶
func (*Game) StaminaInfoScNotify ¶
func (g *Game) StaminaInfoScNotify()
func (*Game) StartCocoonStageCsReq ¶
func (*Game) StartRogueCsReq ¶
func (*Game) SubtractMaterial ¶
func (*Game) SyncClientResVersionCsReq ¶
func (*Game) TakePromotionRewardCsReq ¶
func (*Game) TextJoinQueryCsReq ¶
func (g *Game) TextJoinQueryCsReq()
func (*Game) UnDbLineUp ¶
队伍更新
func (*Game) UnlockSkilltreeCsReq ¶
func (*Game) UpDataPlayer ¶
type PlayerData ¶
type PlayerData struct { PlayerId uint32 // 玩家uid NickName string // 昵称 Level uint32 // 玩家等级 Exp uint32 // 玩家经验 WorldLevel uint32 // 世界等级 Mcoin uint32 // 氪金的 Signature string // 签名 HeadImage uint32 // 头像 Birthday uint32 // 生日 DbScene *DbScene // 场景 Pos *Vector // 存档坐标 Rot *Vector // 存档朝向 DbAvatar *DbAvatar // 角色数据 DbLineUp *DbLineUp // 队伍 DbItem *DbItem // 背包 DbGacha *Dbgacha // 卡池抽取情况 Battle map[uint32]*Battle // 正在进行的战斗 // 下面是在线数据 BattleId uint32 `json:"-"` // 战斗id EntityBattleId uint32 `json:"-"` // 攻击实体id IsPaused bool `json:"-"` // 是否暂停 GameObjectGuidCounter uint64 `json:"-"` // 游戏对象guid计数器 IsNickName bool `json:"-"` // 是否修改昵称 EntityList map[uint32]*EntityList `json:"-"` // 实体ID映射表 IsRogue bool `json:"-"` // 是否正在进行模拟宇宙 }
func NewAvatar ¶
func NewAvatar(data *PlayerData, mainAvatar proto.HeroBasicType) *PlayerData
func NewDbLineUp ¶
func NewDbLineUp(data *PlayerData) *PlayerData
func NewGaCha ¶
func NewGaCha(data *PlayerData) *PlayerData
func NewItem ¶
func NewItem(data *PlayerData) *PlayerData
func NewScene ¶
func NewScene(data *PlayerData) *PlayerData
type RelicAffix ¶
Source Files ¶
- db_avatar.go
- db_battle.go
- db_gacha.go
- db_item.go
- db_lineup.go
- db_player.go
- db_scene.go
- game.go
- gm.go
- player_avatar.go
- player_battle.go
- player_data.go
- player_gacha.go
- player_grow_equipment.go
- player_item.go
- player_lineup.go
- player_login.go
- player_player.go
- player_query.go
- player_quest.go
- player_scene.go
- player_shop.go
- router.go
Click to show internal directories.
Click to hide internal directories.