完善客户端协议

This commit is contained in:
flswld
2023-01-19 19:29:52 +08:00
parent a00bee14d0
commit 2983c16272
3254 changed files with 57101 additions and 93258 deletions

View File

@@ -28,7 +28,7 @@ func (g *GCGAi) ReceiveGCGMessagePackNotify(notify *proto.GCGMessagePackNotify)
// 阶段改变
msg := message.GetPhaseChange()
switch msg.AfterPhase {
case proto.GCGPhaseType_GCG_PHASE_TYPE_ON_STAGE:
case proto.GCGPhaseType_GCG_PHASE_ON_STAGE:
logger.Error("请选择你的英雄 hhh")
go func() {
time.Sleep(3 * 1000)
@@ -37,7 +37,7 @@ func (g *GCGAi) ReceiveGCGMessagePackNotify(notify *proto.GCGMessagePackNotify)
// 操控者选择角色牌
g.game.ControllerSelectChar(gameController, cardInfo, []uint32{})
}()
case proto.GCGPhaseType_GCG_PHASE_TYPE_MAIN:
case proto.GCGPhaseType_GCG_PHASE_MAIN:
if gameController.allow == 0 {
return
}
@@ -57,10 +57,10 @@ func (g *GCGAi) ReceiveGCGMessagePackNotify(notify *proto.GCGMessagePackNotify)
time.Sleep(3 * 1000)
cardInfo1 := g.game.controllerMap[g.controllerId].cardMap[CardInfoType_Char][0]
cardInfo2 := g.game.controllerMap[g.controllerId].cardMap[CardInfoType_Char][1]
g.game.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_NONE, g.game.GCGMsgPVEIntention(&proto.GCGMsgPVEIntention{CardGuid: cardInfo1.guid, SkillIdList: []uint32{cardInfo1.skillList[0].skillId}}, &proto.GCGMsgPVEIntention{CardGuid: cardInfo2.guid, SkillIdList: []uint32{cardInfo2.skillList[0].skillId}}))
g.game.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_NONE, g.game.GCGMsgPVEIntention(&proto.GCGMsgPVEIntention{CardGuid: cardInfo1.guid, SkillIdList: []uint32{cardInfo1.skillList[0].skillId}}, &proto.GCGMsgPVEIntention{CardGuid: cardInfo2.guid, SkillIdList: []uint32{cardInfo2.skillList[0].skillId}}))
g.game.SendAllMsgPack()
g.game.SetControllerAllow(g.game.controllerMap[g.controllerId], false, true)
g.game.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_SEND_MESSAGE, g.game.GCGMsgPhaseContinue())
g.game.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_SEND_MESSAGE, g.game.GCGMsgPhaseContinue())
}()
}
}

View File

@@ -160,11 +160,11 @@ type GCGManager struct {
func NewGCGManager() *GCGManager {
gcgManager := new(GCGManager)
gcgManager.phaseFuncMap = map[proto.GCGPhaseType]func(game *GCGGame){
proto.GCGPhaseType_GCG_PHASE_TYPE_START: gcgManager.PhaseStart,
proto.GCGPhaseType_GCG_PHASE_TYPE_DRAW: gcgManager.PhaseDraw,
proto.GCGPhaseType_GCG_PHASE_TYPE_DICE: gcgManager.PhaseRollDice,
proto.GCGPhaseType_GCG_PHASE_TYPE_PRE_MAIN: gcgManager.PhasePreMain,
proto.GCGPhaseType_GCG_PHASE_TYPE_MAIN: gcgManager.PhaseMain,
proto.GCGPhaseType_GCG_PHASE_START: gcgManager.PhaseStart,
proto.GCGPhaseType_GCG_PHASE_DRAW: gcgManager.PhaseDraw,
proto.GCGPhaseType_GCG_PHASE_DICE: gcgManager.PhaseRollDice,
proto.GCGPhaseType_GCG_PHASE_PRE_MAIN: gcgManager.PhasePreMain,
proto.GCGPhaseType_GCG_PHASE_MAIN: gcgManager.PhaseMain,
}
gcgManager.gameMap = make(map[uint32]*GCGGame)
return gcgManager
@@ -195,7 +195,7 @@ func (g *GCGManager) PhaseStart(game *GCGGame) {
// 设置除了先手的玩家不允许操控
game.SetExceptControllerAllow(game.roundInfo.firstController, false, true)
// 游戏跳过阶段消息包
game.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_SEND_MESSAGE, game.GCGMsgPhaseContinue())
game.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_SEND_MESSAGE, game.GCGMsgPhaseContinue())
// 等待玩家进入
}
@@ -207,7 +207,7 @@ func (g *GCGManager) PhaseDraw(game *GCGGame) {
game.ControllerDrawCard(controller, 5) // 默认5张
}
// 游戏选择角色卡牌阶段
game.ChangePhase(proto.GCGPhaseType_GCG_PHASE_TYPE_ON_STAGE)
game.ChangePhase(proto.GCGPhaseType_GCG_PHASE_ON_STAGE)
}
// PhaseRollDice 阶段投掷骰子
@@ -219,7 +219,7 @@ func (g *GCGManager) PhaseRollDice(game *GCGGame) {
// 玩家需要8个骰子
for i := 0; i < 8; i++ {
// diceSide := proto.GCGDiceSideType(random.GetRandomInt32(1, 8))
diceSide := proto.GCGDiceSideType_GCG_DICE_SIDE_TYPE_PAIMON
diceSide := proto.GCGDiceSideType_GCG_DICE_SIDE_PAIMON
diceSideList = append(diceSideList, diceSide)
}
// 存储该回合玩家的骰子
@@ -227,9 +227,9 @@ func (g *GCGManager) PhaseRollDice(game *GCGGame) {
for _, c := range game.controllerMap {
// 发送给其他玩家骰子信息时隐藏具体的骰子类型
if c == controller {
game.AddMsgPack(c, controller.controllerId, proto.GCGActionType_GCG_ACTION_TYPE_ROLL, game.GCGMsgDiceRoll(controller.controllerId, uint32(len(diceSideList)), diceSideList))
game.AddMsgPack(c, controller.controllerId, proto.GCGActionType_GCG_ACTION_ROLL, game.GCGMsgDiceRoll(controller.controllerId, uint32(len(diceSideList)), diceSideList))
} else {
game.AddMsgPack(c, controller.controllerId, proto.GCGActionType_GCG_ACTION_TYPE_ROLL, game.GCGMsgDiceRoll(controller.controllerId, uint32(len(diceSideList)), []proto.GCGDiceSideType{}))
game.AddMsgPack(c, controller.controllerId, proto.GCGActionType_GCG_ACTION_ROLL, game.GCGMsgDiceRoll(controller.controllerId, uint32(len(diceSideList)), []proto.GCGDiceSideType{}))
}
}
}
@@ -239,18 +239,18 @@ func (g *GCGManager) PhaseRollDice(game *GCGGame) {
// PhasePreMain 阶段战斗开始
func (g *GCGManager) PhasePreMain(game *GCGGame) {
// TODO 使用技能完善
game.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_TRIGGER_SKILL, game.GCGMsgUseSkill(195, 33024), game.GCGMsgNewCard(), game.GCGMsgModifyAdd(2, proto.GCGReason_GCG_REASON_EFFECT, 4, []uint32{23}), game.GCGMsgUseSkillEnd(181, 33024))
game.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TRIGGER_SKILL, game.GCGMsgUseSkill(195, 33024), game.GCGMsgNewCard(), game.GCGMsgModifyAdd(2, proto.GCGReason_GCG_REASON_EFFECT, 4, []uint32{23}), game.GCGMsgUseSkillEnd(181, 33024))
// 设置先手允许操控
game.SetControllerAllow(game.controllerMap[game.roundInfo.firstController], true, false)
// 游戏行动阶段
game.ChangePhase(proto.GCGPhaseType_GCG_PHASE_TYPE_MAIN)
game.ChangePhase(proto.GCGPhaseType_GCG_PHASE_MAIN)
}
// PhaseMain 阶段行动
func (g *GCGManager) PhaseMain(game *GCGGame) {
// 消耗费用信息
for _, controller := range game.controllerMap {
game.AddMsgPack(controller, 0, proto.GCGActionType_GCG_ACTION_TYPE_NOTIFY_COST, game.GCGMsgCostRevise(controller))
game.AddMsgPack(controller, 0, proto.GCGActionType_GCG_ACTION_NOTIFY_COST, game.GCGMsgCostRevise(controller))
// 如果玩家当前允许操作则发送技能预览信息
if controller.allow == 1 && controller.player != nil {
GAME_MANAGER.SendMsg(cmd.GCGSkillPreviewNotify, controller.player.PlayerID, controller.player.ClientSeq, GAME_MANAGER.PacketGCGSkillPreviewNotify(game, controller))
@@ -408,14 +408,14 @@ func (g *GCGGame) ChangePhase(phase proto.GCGPhaseType) {
// 根据阶段改变操控者允许状态
switch phase {
case proto.GCGPhaseType_GCG_PHASE_TYPE_ON_STAGE, proto.GCGPhaseType_GCG_PHASE_TYPE_DICE:
case proto.GCGPhaseType_GCG_PHASE_ON_STAGE, proto.GCGPhaseType_GCG_PHASE_DICE:
// 该阶段允许所有操控者操作
g.SetAllControllerAllow(true, false)
for _, controller := range g.controllerMap {
g.roundInfo.allowControllerMap[controller.controllerId] = controller.allow
}
case proto.GCGPhaseType_GCG_PHASE_TYPE_MAIN:
case proto.GCGPhaseType_GCG_PHASE_MAIN:
// 行动阶段仅允许操控者操作
for _, controller := range g.controllerMap {
// 跳过不允许的操控者
@@ -426,17 +426,13 @@ func (g *GCGGame) ChangePhase(phase proto.GCGPhaseType) {
}
}
allowControllerMap := make([]*proto.Uint32Pair, 0, len(g.controllerMap))
allowControllerMap := make(map[uint32]uint32)
for controllerId, allow := range g.roundInfo.allowControllerMap {
pair := &proto.Uint32Pair{
Key: controllerId,
Value: allow,
}
allowControllerMap = append(allowControllerMap, pair)
allowControllerMap[controllerId] = allow
}
// 游戏下一阶段切换消息包
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_NEXT_PHASE, g.GCGMsgPhaseChange(beforePhase, phase, allowControllerMap))
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_NEXT_PHASE, g.GCGMsgPhaseChange(beforePhase, phase, allowControllerMap))
// 执行阶段处理前假装现在是最后一个阶段处理
g.roundInfo.isLastMsgPack = true
@@ -467,7 +463,7 @@ func (g *GCGGame) SetExceptControllerAllow(controllerId uint32, isAllow bool, is
// 是否添加消息包
if isAddMsg {
// 更新客户端操控者允许状态消息包
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_NONE, g.GCGMsgUpdateController())
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_NONE, g.GCGMsgUpdateController())
}
}
@@ -479,7 +475,7 @@ func (g *GCGGame) SetAllControllerAllow(isAllow bool, isAddMsg bool) {
// 是否添加消息包
if isAddMsg {
// 更新客户端操控者允许状态消息包
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_NONE, g.GCGMsgUpdateController())
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_NONE, g.GCGMsgUpdateController())
}
}
@@ -495,7 +491,7 @@ func (g *GCGGame) SetControllerAllow(controller *GCGController, isAllow bool, is
// 是否添加消息包
if isAddMsg {
// 更新客户端操控者允许状态消息包
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_NONE, g.GCGMsgUpdateController())
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_NONE, g.GCGMsgUpdateController())
}
}
@@ -514,7 +510,7 @@ func (g *GCGGame) ControllerSelectChar(controller *GCGController, cardInfo *GCGC
g.SetControllerAllow(controller, false, true)
// 广播选择的角色卡牌消息包
g.AddAllMsgPack(controller.controllerId, proto.GCGActionType_GCG_ACTION_TYPE_SELECT_ONSTAGE, g.GCGMsgSelectOnStage(controller.controllerId, cardInfo.guid, proto.GCGReason_GCG_REASON_DEFAULT))
g.AddAllMsgPack(controller.controllerId, proto.GCGActionType_GCG_ACTION_SELECT_ONSTAGE, g.GCGMsgSelectOnStage(controller.controllerId, cardInfo.guid, proto.GCGReason_GCG_REASON_DEFAULT))
// 该阶段确保每位玩家都选择了角色牌
isAllSelectedChar := true
@@ -526,12 +522,12 @@ func (g *GCGGame) ControllerSelectChar(controller *GCGController, cardInfo *GCGC
// 如果有玩家未选择角色牌不同处理
if isAllSelectedChar {
// 回合信息
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_SEND_MESSAGE, g.GCGMsgDuelDataChange())
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_SEND_MESSAGE, g.GCGMsgDuelDataChange())
// 游戏投掷骰子阶段
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_TYPE_DICE)
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_DICE)
} else {
// 跳过该阶段 官服是这样的我也不知道为什么
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_SEND_MESSAGE, g.GCGMsgPhaseContinue())
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_SEND_MESSAGE, g.GCGMsgPhaseContinue())
// 立刻发送消息包 模仿官服效果
g.SendAllMsgPack()
@@ -543,7 +539,7 @@ func (g *GCGGame) ControllerReRollDice(controller *GCGController, diceIndexList
// 玩家禁止操作
g.SetAllControllerAllow(false, true)
// 游戏战斗开始阶段
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_TYPE_PRE_MAIN)
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_PRE_MAIN)
}
// ControllerUseSkill 操控者使用技能
@@ -582,8 +578,8 @@ func (g *GCGGame) ControllerUseSkill(controller *GCGController, skillId uint32,
// 因为使用技能自身充能+1
msgList = append(msgList, g.GCGMsgTokenChange(controller.selectedCharCardGuid, proto.GCGReason_GCG_REASON_ATTACK, constant.GCGTokenConst.TOKEN_CUR_ELEM, 3))
g.AddAllMsgPack(controller.controllerId, proto.GCGActionType_GCG_ACTION_TYPE_ATTACK, msgList...)
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_TYPE_MAIN)
g.AddAllMsgPack(controller.controllerId, proto.GCGActionType_GCG_ACTION_ATTACK, msgList...)
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_MAIN)
}
// ControllerDrawCard 操控者抽取手牌
@@ -611,9 +607,9 @@ func (g *GCGGame) ControllerDrawCard(controller *GCGController, count int) {
// 发送给别人隐藏卡牌信息的消息包 为了安全
for _, c := range g.controllerMap {
if c == controller {
g.AddMsgPack(c, controller.controllerId, proto.GCGActionType_GCG_ACTION_TYPE_DRAW, msgList...)
g.AddMsgPack(c, controller.controllerId, proto.GCGActionType_GCG_ACTION_DRAW, msgList...)
} else {
g.AddMsgPack(c, controller.controllerId, proto.GCGActionType_GCG_ACTION_TYPE_DRAW, otherMsgList...)
g.AddMsgPack(c, controller.controllerId, proto.GCGActionType_GCG_ACTION_DRAW, otherMsgList...)
}
}
}
@@ -660,7 +656,7 @@ func (g *GCGGame) InitGame(playerList []*model.Player) {
// TODO 验证玩家人数是否符合
// 游戏开始阶段
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_TYPE_START)
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_START)
}
// StartGame 开始GCG游戏
@@ -673,9 +669,9 @@ func (g *GCGGame) StartGame() {
// 游戏开始设置所有玩家不允许操作
g.SetAllControllerAllow(false, true)
// 分配先手
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_TYPE_PHASE_EXIT, g.GCGMsgClientPerform(proto.GCGClientPerformType_GCG_CLIENT_PERFORM_TYPE_FIRST_HAND, []uint32{g.roundInfo.firstController}))
g.AddAllMsgPack(0, proto.GCGActionType_GCG_ACTION_PHASE_EXIT, g.GCGMsgClientPerform(proto.GCGClientPerformType_GCG_PERFORM_FIRST_HAND, []uint32{g.roundInfo.firstController}))
// 游戏抽取手牌阶段
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_TYPE_DRAW)
g.ChangePhase(proto.GCGPhaseType_GCG_PHASE_DRAW)
}
// CheckAllInitFinish 检查所有玩家是否加载完成
@@ -755,7 +751,7 @@ func (g *GCGGame) SendAllMsgPack() {
}
// GCGMsgPhaseChange GCG消息阶段改变
func (g *GCGGame) GCGMsgPhaseChange(beforePhase proto.GCGPhaseType, afterPhase proto.GCGPhaseType, allowControllerMap []*proto.Uint32Pair) *proto.GCGMessage {
func (g *GCGGame) GCGMsgPhaseChange(beforePhase proto.GCGPhaseType, afterPhase proto.GCGPhaseType, allowControllerMap map[uint32]uint32) *proto.GCGMessage {
gcgMsgPhaseChange := &proto.GCGMsgPhaseChange{
BeforePhase: beforePhase,
AfterPhase: afterPhase,
@@ -783,19 +779,15 @@ func (g *GCGGame) GCGMsgPhaseContinue() *proto.GCGMessage {
// GCGMsgUpdateController GCG消息更新操控者
func (g *GCGGame) GCGMsgUpdateController() *proto.GCGMessage {
gcgMsgUpdateController := &proto.GCGMsgUpdateController{
AllowControllerMap: make([]*proto.Uint32Pair, 0, len(g.controllerMap)),
AllowControllerMap: make(map[uint32]uint32),
}
// 操控者的是否允许操作
for _, controller := range g.controllerMap {
// 如果处于行动阶段只发送允许操作的
if g.roundInfo.phaseType == proto.GCGPhaseType_GCG_PHASE_TYPE_MAIN && controller.allow == 0 {
if g.roundInfo.phaseType == proto.GCGPhaseType_GCG_PHASE_MAIN && controller.allow == 0 {
continue
}
pair := &proto.Uint32Pair{
Key: controller.controllerId,
Value: controller.allow,
}
gcgMsgUpdateController.AllowControllerMap = append(gcgMsgUpdateController.AllowControllerMap, pair)
gcgMsgUpdateController.AllowControllerMap[controller.controllerId] = controller.allow
}
gcgMessage := &proto.GCGMessage{
Message: &proto.GCGMessage_UpdateController{
@@ -963,15 +955,12 @@ func (g *GCGGame) GCGMsgCostRevise(controller *GCGController) *proto.GCGMessage
return new(proto.GCGMessage)
}
gcgAttackCostInfo := &proto.GCGAttackCostInfo{
CostMap: make([]*proto.Uint32Pair, len(gcgSkillConfig.CostMap)),
CostMap: make(map[uint32]uint32),
SkillId: skillInfo.skillId,
}
// 技能消耗
for costType, costValue := range gcgSkillConfig.CostMap {
gcgAttackCostInfo.CostMap = append(gcgAttackCostInfo.CostMap, &proto.Uint32Pair{
Key: costType,
Value: costValue,
})
gcgAttackCostInfo.CostMap[costType] = costValue
}
gcgMsgCostRevise.CostRevise.AttackCostList = append(gcgMsgCostRevise.CostRevise.AttackCostList, gcgAttackCostInfo)
}
@@ -983,11 +972,8 @@ func (g *GCGGame) GCGMsgCostRevise(controller *GCGController) *proto.GCGMessage
}
gcgSelectOnStageCostInfo := &proto.GCGSelectOnStageCostInfo{
CardGuid: cardInfo.guid,
CostMap: []*proto.Uint32Pair{
{
Key: 10,
Value: 1,
},
CostMap: map[uint32]uint32{
10: 1,
},
}
gcgMsgCostRevise.CostRevise.SelectOnStageCostList = append(gcgMsgCostRevise.CostRevise.SelectOnStageCostList, gcgSelectOnStageCostInfo)
@@ -1045,11 +1031,11 @@ func (g *GCGGame) GCGMsgTokenChange(cardGuid uint32, reason proto.GCGReason, tok
gcgMsgTokenChange := &proto.GCGMsgTokenChange{
TokenType: tokenType,
// token改变为的值
Unk3300_LLGHGEALDDI: tokenChangeValue,
Reason: reason,
After: tokenChangeValue,
Reason: reason,
// 可能是改变之前的值 无所谓就算是0也能跑
Unk3300_LCNKBFBJDFM: 0, // Unk
CardGuid: cardGuid,
Before: 0, // Unk
CardGuid: cardGuid,
}
gcgMessage := &proto.GCGMessage{
Message: &proto.GCGMessage_TokenChange{
@@ -1080,15 +1066,15 @@ func (g *GCGGame) GCGMsgSkillResult(selectedCharCardGuid uint32, skillId uint32)
}
gcgMsgSkillResult := &proto.GCGMsgSkillResult{
// 攻击附带的元素特效
Unk3300_NIGDCIGLAKE: gcgSkillConfig.ElementType,
TargetCardGuid: resultTargetCardGuid,
Unk3300_PDBAGJINFPF: 0, // Unk
DetailList: []*proto.GCGDamageDetail{},
SkillId: skillId,
Damage: gcgSkillConfig.Damage,
Unk3300_EPNDCIAJOJP: 0,
Unk3300_NNJAOEHNPPD: 0,
Unk3300_LPGLOCDDPCL: 0,
EffectElement: gcgSkillConfig.ElementType,
TargetCardGuid: resultTargetCardGuid,
// Unk3300_PDBAGJINFPF: 0, // Unk
DetailList: []*proto.GCGDamageDetail{},
SkillId: skillId,
Damage: gcgSkillConfig.Damage,
// Unk3300_EPNDCIAJOJP: 0,
// Unk3300_NNJAOEHNPPD: 0,
// Unk3300_LPGLOCDDPCL: 0,
}
gcgMessage := &proto.GCGMessage{
Message: &proto.GCGMessage_SkillResult{

View File

@@ -216,9 +216,9 @@ func (g *GameManager) PacketAvatarEquipChangeNotify(avatar *model.Avatar, weapon
Level: uint32(weapon.Level),
AbilityInfo: new(proto.AbilitySyncStateInfo),
}
itemDataConfig, ok := gdconf.CONF.ItemDataMap[int32(weapon.ItemId)]
if ok {
avatarEquipChangeNotify.EquipType = uint32(itemDataConfig.EquipType)
itemDataConfig, exist := gdconf.CONF.ItemDataMap[int32(weapon.ItemId)]
if exist {
avatarEquipChangeNotify.EquipType = uint32(itemDataConfig.Type)
}
return avatarEquipChangeNotify
}
@@ -227,9 +227,9 @@ func (g *GameManager) PacketAvatarEquipTakeOffNotify(avatar *model.Avatar, weapo
avatarEquipChangeNotify := &proto.AvatarEquipChangeNotify{
AvatarGuid: avatar.Guid,
}
itemDataConfig, ok := gdconf.CONF.ItemDataMap[int32(weapon.ItemId)]
if ok {
avatarEquipChangeNotify.EquipType = uint32(itemDataConfig.EquipType)
itemDataConfig, exist := gdconf.CONF.ItemDataMap[int32(weapon.ItemId)]
if exist {
avatarEquipChangeNotify.EquipType = uint32(itemDataConfig.Type)
}
return avatarEquipChangeNotify
}

View File

@@ -46,7 +46,7 @@ func (g *GameManager) QueryPathReq(player *model.Player, payloadMsg pb.Message)
queryPathRsp := &proto.QueryPathRsp{
QueryId: req.QueryId,
QueryStatus: proto.QueryPathRsp_PATH_STATUS_TYPE_SUCC,
QueryStatus: proto.QueryPathRsp_STATUS_SUCC,
Corners: []*proto.Vector{req.DestinationPos[0]},
}
g.SendMsg(cmd.QueryPathRsp, player.PlayerID, player.ClientSeq, queryPathRsp)
@@ -166,7 +166,7 @@ func (g *GameManager) ServerAppidBindNotify(userId uint32, fightAppId string, jo
// 进入场景
player.SceneJump = true
player.SceneLoadState = model.SceneNone
g.SendMsg(cmd.PlayerEnterSceneNotify, userId, player.ClientSeq, g.PacketPlayerEnterSceneNotifyLogin(player, proto.EnterType_ENTER_TYPE_SELF))
g.SendMsg(cmd.PlayerEnterSceneNotify, userId, player.ClientSeq, g.PacketPlayerEnterSceneNotifyLogin(player, proto.EnterType_ENTER_SELF))
}
func (g *GameManager) ObstacleModifyNotify(player *model.Player, payloadMsg pb.Message) {

View File

@@ -102,7 +102,7 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
scene := world.GetSceneById(player.SceneId)
for _, entry := range req.InvokeList {
switch entry.ArgumentType {
case proto.CombatTypeArgument_COMBAT_TYPE_ARGUMENT_EVT_BEING_HIT:
case proto.CombatTypeArgument_COMBAT_EVT_BEING_HIT:
hitInfo := new(proto.EvtBeingHitInfo)
if appConfig.CONF.Hk4e.ClientProtoProxyEnable {
clientProtoObj := g.GetClientProtoObjByName("EvtBeingHitInfo")
@@ -151,7 +151,7 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
}
g.SendToWorldA(world, cmd.EntityFightPropUpdateNotify, player.ClientSeq, entityFightPropUpdateNotify)
if currHp == 0 && target.avatarEntity == nil {
scene.SetEntityLifeState(target, constant.LifeStateConst.LIFE_DEAD, proto.PlayerDieType_PLAYER_DIE_TYPE_GM)
scene.SetEntityLifeState(target, constant.LifeStateConst.LIFE_DEAD, proto.PlayerDieType_PLAYER_DIE_GM)
}
combatData, err := pb.Marshal(hitInfo)
if err != nil {
@@ -159,7 +159,7 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
}
entry.CombatData = combatData
player.CombatInvokeHandler.AddEntry(entry.ForwardType, entry)
case proto.CombatTypeArgument_COMBAT_TYPE_ARGUMENT_ENTITY_MOVE:
case proto.CombatTypeArgument_ENTITY_MOVE:
entityMoveInfo := new(proto.EntityMoveInfo)
if appConfig.CONF.Hk4e.ClientProtoProxyEnable {
clientProtoObj := g.GetClientProtoObjByName("EntityMoveInfo")
@@ -225,7 +225,7 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
sceneEntity.lastMoveReliableSeq = entityMoveInfo.ReliableSeq
player.CombatInvokeHandler.AddEntry(entry.ForwardType, entry)
case proto.CombatTypeArgument_COMBAT_TYPE_ARGUMENT_ANIMATOR_STATE_CHANGED:
case proto.CombatTypeArgument_COMBAT_ANIMATOR_STATE_CHANGED:
evtAnimatorStateChangedInfo := new(proto.EvtAnimatorStateChangedInfo)
if appConfig.CONF.Hk4e.ClientProtoProxyEnable {
clientProtoObj := g.GetClientProtoObjByName("EvtAnimatorStateChangedInfo")
@@ -303,9 +303,9 @@ func (g *GameManager) AoiPlayerMove(player *model.Player, oldPos *model.Vector,
addEntityIdList = append(addEntityIdList, entityId)
}
// 发送已消失格子里的实体消失通知
g.RemoveSceneEntityNotifyToPlayer(player, proto.VisionType_VISION_TYPE_MISS, delEntityIdList)
g.RemoveSceneEntityNotifyToPlayer(player, proto.VisionType_VISION_MISS, delEntityIdList)
// 发送新出现格子里的实体出现通知
g.AddSceneEntityNotify(player, proto.VisionType_VISION_TYPE_MEET, addEntityIdList, false, false)
g.AddSceneEntityNotify(player, proto.VisionType_VISION_MEET, addEntityIdList, false, false)
}
}
}
@@ -384,7 +384,7 @@ func (g *GameManager) ClientAbilityChangeNotify(player *model.Player, payloadMsg
}
for _, abilityInvokeEntry := range req.Invokes {
switch abilityInvokeEntry.ArgumentType {
case proto.AbilityInvokeArgument_ABILITY_INVOKE_ARGUMENT_META_ADD_NEW_ABILITY:
case proto.AbilityInvokeArgument_ABILITY_META_ADD_NEW_ABILITY:
abilityMetaAddAbility := new(proto.AbilityMetaAddAbility)
if appConfig.CONF.Hk4e.ClientProtoProxyEnable {
clientProtoObj := g.GetClientProtoObjByName("AbilityMetaAddAbility")
@@ -411,7 +411,7 @@ func (g *GameManager) ClientAbilityChangeNotify(player *model.Player, payloadMsg
continue
}
worldAvatar.abilityList = append(worldAvatar.abilityList, abilityMetaAddAbility.Ability)
case proto.AbilityInvokeArgument_ABILITY_INVOKE_ARGUMENT_META_MODIFIER_CHANGE:
case proto.AbilityInvokeArgument_ABILITY_META_MODIFIER_CHANGE:
abilityMetaModifierChange := new(proto.AbilityMetaModifierChange)
if appConfig.CONF.Hk4e.ClientProtoProxyEnable {
clientProtoObj := g.GetClientProtoObjByName("AbilityMetaModifierChange")
@@ -529,7 +529,7 @@ func (g *GameManager) EvtCreateGadgetNotify(player *model.Player, payloadMsg pb.
Y: float64(req.InitEulerAngles.Y),
Z: float64(req.InitEulerAngles.Z),
}, req.EntityId, req.ConfigId, req.CampId, req.CampType, req.OwnerEntityId, req.TargetEntityId, req.PropOwnerEntityId)
g.AddSceneEntityNotify(player, proto.VisionType_VISION_TYPE_BORN, []uint32{req.EntityId}, true, true)
g.AddSceneEntityNotify(player, proto.VisionType_VISION_BORN, []uint32{req.EntityId}, true, true)
}
func (g *GameManager) EvtDestroyGadgetNotify(player *model.Player, payloadMsg pb.Message) {
@@ -542,5 +542,5 @@ func (g *GameManager) EvtDestroyGadgetNotify(player *model.Player, payloadMsg pb
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
scene := world.GetSceneById(player.SceneId)
scene.DestroyEntity(req.EntityId)
g.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_TYPE_MISS, []uint32{req.EntityId})
g.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_MISS, []uint32{req.EntityId})
}

View File

@@ -55,7 +55,8 @@ func (g *GameManager) GCGStartChallenge(player *model.Player) {
game := GCG_MANAGER.CreateGame(30101, []*model.Player{player})
// GCG游戏简要信息通知
GAME_MANAGER.SendMsg(cmd.GCGGameBriefDataNotify, player.PlayerID, player.ClientSeq, g.PacketGCGGameBriefDataNotify(player, proto.GCGGameBusinessType_GCG_GAME_BUSINESS_TYPE_GUIDE_GROUP, game))
GAME_MANAGER.SendMsg(cmd.GCGGameBriefDataNotify, player.PlayerID, player.ClientSeq,
g.PacketGCGGameBriefDataNotify(player, proto.GCGGameBusinessType_GCG_GAME_GUIDE_GROUP, game))
// 玩家进入GCG界面
g.TeleportPlayer(player, constant.EnterReasonConst.DungeonEnter, 79999, new(model.Vector), new(model.Vector), 2162)
@@ -89,8 +90,8 @@ func (g *GameManager) GCGAskDuelReq(player *model.Player, payloadMsg pb.Message)
ShowInfoList: make([]*proto.GCGControllerShowInfo, 0, len(game.controllerMap)),
ForbidFinishChallengeList: nil,
// CardList 卡牌列表
CardList: make([]*proto.GCGCard, 0, 0),
Unk3300_BIANMOPDEHO: 1, // Unk
CardList: make([]*proto.GCGCard, 0, 0),
// Unk3300_BIANMOPDEHO: 1, // Unk
CostRevise: &proto.GCGCostReviseInfo{ // 暂无数据
CanUseHandCardIdList: nil,
SelectOnStageCostList: nil,
@@ -100,10 +101,10 @@ func (g *GameManager) GCGAskDuelReq(player *model.Player, payloadMsg pb.Message)
},
GameId: 0, // 官服是0
// FieldList 玩家牌盒信息 卡牌显示相关
FieldList: make([]*proto.GCGPlayerField, 0, len(game.controllerMap)),
Unk3300_CDCMBOKBLAK: make([]*proto.Unk3300_ADHENCIFKNI, 0, len(game.controllerMap)),
BusinessType: 0,
IntentionList: nil, // empty
FieldList: make([]*proto.GCGPlayerField, 0, len(game.controllerMap)),
// Unk3300_CDCMBOKBLAK: make([]*proto.Unk3300_ADHENCIFKNI, 0, len(game.controllerMap)),
BusinessType: 0,
IntetionList: nil, // empty
// ChallengeList 可能是挑战目标
ChallengeList: []*proto.GCGDuelChallenge{
// TODO 暂时写死
@@ -148,14 +149,14 @@ func (g *GameManager) GCGAskDuelReq(player *model.Player, payloadMsg pb.Message)
TotalProgress: 0,
},
},
HistoryCardList: make([]*proto.GCGCard, 0, len(gameController.historyCardList)),
Round: game.roundInfo.roundNum,
ControllerId: gameController.controllerId,
HistoryMsgPackList: gameController.historyMsgPackList,
Unk3300_JHDDNKFPINA: 0,
HistoryCardList: make([]*proto.GCGCard, 0, len(gameController.historyCardList)),
Round: game.roundInfo.roundNum,
ControllerId: gameController.controllerId,
HistoryMsgPackList: gameController.historyMsgPackList,
// Unk3300_JHDDNKFPINA: 0,
// CardIdList 游戏内的所有卡牌Id
CardIdList: make([]uint32, 0, 0),
Unk3300_JBBMBKGOONO: 0, // Unk
CardIdList: make([]uint32, 0, 0),
// Unk3300_JBBMBKGOONO: 0, // Unk
// 阶段数据
Phase: &proto.GCGPhase{
PhaseType: game.roundInfo.phaseType,
@@ -180,41 +181,41 @@ func (g *GameManager) GCGAskDuelReq(player *model.Player, payloadMsg pb.Message)
for _, controller := range game.controllerMap {
// FieldList 玩家牌盒信息 卡牌显示相关
playerField := &proto.GCGPlayerField{
Unk3300_IKJMGAHCFPM: 0,
CurWaitingIndex: 0,
// 卡牌图片
ModifyZoneMap: make(map[uint32]*proto.GCGZone, len(controller.cardMap[CardInfoType_Char])),
Unk3300_GGHKFFADEAL: 0,
Unk3300_AOPJIOHMPOF: &proto.GCGZone{
ModifyZoneMap: make(map[uint32]*proto.GCGZone, len(controller.cardMap[CardInfoType_Char])),
FieldShowId: 0,
SummonZone: &proto.GCGZone{
CardList: []uint32{},
},
Unk3300_FDFPHNDOJML: 0,
CardBackShowId: 0,
// 卡牌技能?
Unk3300_IPLMHKCNDLE: &proto.GCGZone{
OnStageZone: &proto.GCGZone{
CardList: []uint32{}, // 官服CardList: []uint32{5},
},
Unk3300_EIHOMDLENMK: &proto.GCGZone{
AssistZone: &proto.GCGZone{
CardList: []uint32{},
},
WaitingList: []*proto.GCGWaitingCharacter{},
Unk3300_PBECINKKHND: 0,
ControllerId: controller.controllerId,
WaitingList: []*proto.GCGWaitingCharacter{},
DiceCount: 0,
ControllerId: controller.controllerId,
// 卡牌位置
Unk3300_INDJNJJJNKL: &proto.GCGZone{
CharacterZone: &proto.GCGZone{
CardList: make([]uint32, 0, len(controller.cardMap[CardInfoType_Char])),
},
Unk3300_EFNAEFBECHD: &proto.GCGZone{
HandZone: &proto.GCGZone{
CardList: []uint32{},
},
IsPassed: false,
IntentionList: []*proto.GCGPVEIntention{},
DiceSideList: []proto.GCGDiceSideType{},
// 牌堆卡牌数量
DeckCardNum: uint32(len(controller.cardMap[CardInfoType_Deck])),
Unk3300_GLNIFLOKBPM: 0,
DeckCardNum: uint32(len(controller.cardMap[CardInfoType_Deck])),
OnStageCharacterGuid: 0,
}
for _, info := range controller.cardMap[CardInfoType_Char] {
playerField.ModifyZoneMap[info.guid] = &proto.GCGZone{CardList: []uint32{}}
playerField.Unk3300_INDJNJJJNKL.CardList = append(playerField.Unk3300_INDJNJJJNKL.CardList, info.guid)
playerField.CharacterZone.CardList = append(playerField.CharacterZone.CardList, info.guid)
}
// 添加完所有卡牌的位置之类的信息后添加这个牌盒
gcgAskDuelRsp.Duel.FieldList = append(gcgAskDuelRsp.Duel.FieldList, playerField)
@@ -243,14 +244,14 @@ func (g *GameManager) GCGAskDuelReq(player *model.Player, payloadMsg pb.Message)
}
}
}
// Unk3300_CDCMBOKBLAK 你问我这是啥? 我也不知道
for _, controller := range game.controllerMap {
gcgAskDuelRsp.Duel.Unk3300_CDCMBOKBLAK = append(gcgAskDuelRsp.Duel.Unk3300_CDCMBOKBLAK, &proto.Unk3300_ADHENCIFKNI{
BeginTime: 0,
TimeStamp: 0,
ControllerId: controller.controllerId,
})
}
// // Unk3300_CDCMBOKBLAK 你问我这是啥? 我也不知道
// for _, controller := range game.controllerMap {
// gcgAskDuelRsp.Duel.Unk3300_CDCMBOKBLAK = append(gcgAskDuelRsp.Duel.Unk3300_CDCMBOKBLAK, &proto.GCGMsgOpTimer{
// BeginTime: 0,
// TimeStamp: 0,
// ControllerId: controller.controllerId,
// })
// }
GAME_MANAGER.SendMsg(cmd.GCGAskDuelRsp, player.PlayerID, player.ClientSeq, gcgAskDuelRsp)
}
@@ -394,20 +395,20 @@ func (g *GameManager) PacketGCGSkillPreviewNotify(game *GCGGame, controller *GCG
}
gcgSkillPreviewInfo := &proto.GCGSkillPreviewInfo{
ChangeOnstageCharacterList: nil,
Unk3300_DAJFJEDNLKK: nil,
AddCardList: nil,
SkillId: skillInfo.skillId,
// 技能造成的血量预览信息
HpInfoMap: make(map[uint32]*proto.GCGSkillPreviewHpInfo, 1),
Unk3300_AGNONGELFGC: nil,
ExtraInfo: nil,
ReactionInfoMap: nil,
HpInfoMap: make(map[uint32]*proto.GCGSkillPreviewHpInfo, 1),
RmCardList: nil,
ExtraInfo: nil,
ReactionInfoMap: nil,
// 技能对自身改变预览信息
CardTokenChangeMap: make(map[uint32]*proto.GCGSkillPreviewTokenChangeInfo, 1),
}
// HpInfoMap
// key -> 显示对哪个角色卡造成伤害
gcgSkillPreviewInfo.HpInfoMap[targetSelectedCharCard.guid] = &proto.GCGSkillPreviewHpInfo{
ChangeType: proto.GCGSkillHpChangeType_GCG_SKILL_HP_CHANGE_TYPE_DAMAGE,
ChangeType: proto.GCGSkillHpChangeType_GCG_SKILL_HP_CHANGE_DAMAGE,
HpChangeValue: gcgSkillConfig.Damage,
}
// CardTokenChangeMap
@@ -416,10 +417,10 @@ func (g *GameManager) PacketGCGSkillPreviewNotify(game *GCGGame, controller *GCG
TokenChangeList: []*proto.GCGSkillPreviewTokenInfo{
{
// Token类型
TokenType: constant.GCGTokenConst.TOKEN_CUR_ELEM,
Unk3300_MMIKPPJMHAD: 0,
TokenType: constant.GCGTokenConst.TOKEN_CUR_ELEM,
BeforeValue: 0,
// 更改为的值
Unk3300_IKICJMEFEON: selectedCharCard.tokenMap[constant.GCGTokenConst.TOKEN_CUR_ELEM] + 1,
AfterValue: selectedCharCard.tokenMap[constant.GCGTokenConst.TOKEN_CUR_ELEM] + 1,
},
},
}
@@ -469,8 +470,8 @@ func (g *GameManager) SendGCGMessagePackNotify(controller *GCGController, server
func (g *GameManager) PacketGCGGameBriefDataNotify(player *model.Player, businessType proto.GCGGameBusinessType, game *GCGGame) *proto.GCGGameBriefDataNotify {
gcgGameBriefDataNotify := &proto.GCGGameBriefDataNotify{
GcgBriefData: &proto.GCGGameBriefData{
BusinessType: businessType,
PlatformType: uint32(proto.PlatformType_PLATFORM_TYPE_PC), // TODO 根据玩家设备修改
BusinessType: businessType,
// PlatformType: uint32(proto.PlatformType_PC), // TODO 根据玩家设备修改
GameId: game.gameId,
PlayerBriefList: make([]*proto.GCGPlayerBriefData, 0, len(game.controllerMap)),
},
@@ -501,8 +502,8 @@ func (g *GameManager) PacketGCGGameBriefDataNotify(player *model.Player, busines
// PacketGCGTavernNpcInfoNotify GCG酒馆NPC信息通知
func (g *GameManager) PacketGCGTavernNpcInfoNotify(player *model.Player) *proto.GCGTavernNpcInfoNotify {
gcgTavernNpcInfoNotify := &proto.GCGTavernNpcInfoNotify{
Unk3300_FKAKHMMIEBC: make([]*proto.GCGTavernNpcInfo, 0, 0),
Unk3300_BAMLNENDLCM: make([]*proto.GCGTavernNpcInfo, 0, 0),
WeekNpcList: make([]*proto.GCGTavernNpcInfo, 0, 0),
ConstNpcList: make([]*proto.GCGTavernNpcInfo, 0, 0),
CharacterNpc: &proto.GCGTavernNpcInfo{
Id: 0,
ScenePointId: 0,
@@ -515,13 +516,13 @@ func (g *GameManager) PacketGCGTavernNpcInfoNotify(player *model.Player) *proto.
// PacketGCGTCTavernInfoNotify GCG酒馆信息通知
func (g *GameManager) PacketGCGTCTavernInfoNotify(player *model.Player) *proto.GCGTCTavernInfoNotify {
gcgTCTavernInfoNotify := &proto.GCGTCTavernInfoNotify{
LevelId: 0,
Unk3300_IMFJBNFMCHM: false,
Unk3300_MBGMHBNBKBK: false,
PointId: 0,
ElementType: 8,
AvatarId: 10000007,
CharacterId: 0,
LevelId: 0,
IsLastDuelWin: false,
IsOwnerInDuel: false,
PointId: 0,
ElementType: 8,
AvatarId: 10000007,
CharacterId: 0,
}
return gcgTCTavernInfoNotify
}

View File

@@ -59,7 +59,7 @@ func (g *GameManager) AddUserItem(userId uint32, itemList []*UserItem, isHint bo
}
storeItemChangeNotify := &proto.StoreItemChangeNotify{
StoreType: proto.StoreType_STORE_TYPE_PACK,
StoreType: proto.StoreType_STORE_PACK,
ItemList: make([]*proto.Item, 0),
}
for _, userItem := range itemList {
@@ -126,7 +126,7 @@ func (g *GameManager) CostUserItem(userId uint32, itemList []*UserItem) {
}
storeItemChangeNotify := &proto.StoreItemChangeNotify{
StoreType: proto.StoreType_STORE_TYPE_PACK,
StoreType: proto.StoreType_STORE_PACK,
ItemList: make([]*proto.Item, 0),
}
for _, userItem := range itemList {
@@ -150,7 +150,7 @@ func (g *GameManager) CostUserItem(userId uint32, itemList []*UserItem) {
}
storeItemDelNotify := &proto.StoreItemDelNotify{
StoreType: proto.StoreType_STORE_TYPE_PACK,
StoreType: proto.StoreType_STORE_PACK,
GuidList: make([]uint64, 0),
}
for _, userItem := range itemList {

View File

@@ -177,7 +177,7 @@ func (g *GameManager) PacketPlayerDataNotify(player *model.Player) *proto.Player
func (g *GameManager) PacketStoreWeightLimitNotify() *proto.StoreWeightLimitNotify {
storeWeightLimitNotify := &proto.StoreWeightLimitNotify{
StoreType: proto.StoreType_STORE_TYPE_PACK,
StoreType: proto.StoreType_STORE_PACK,
// 背包容量限制
WeightLimit: 30000,
WeaponCountLimit: 2000,
@@ -190,7 +190,7 @@ func (g *GameManager) PacketStoreWeightLimitNotify() *proto.StoreWeightLimitNoti
func (g *GameManager) PacketPlayerStoreNotify(player *model.Player) *proto.PlayerStoreNotify {
playerStoreNotify := &proto.PlayerStoreNotify{
StoreType: proto.StoreType_STORE_TYPE_PACK,
StoreType: proto.StoreType_STORE_PACK,
WeightLimit: 30000,
}
itemDataMapConfig := gdconf.CONF.ItemDataMap

View File

@@ -51,9 +51,9 @@ func (g *GameManager) MarkMapReq(player *model.Player, payloadMsg pb.Message) {
logger.Debug("user mark map, uid: %v", player.PlayerID)
req := payloadMsg.(*proto.MarkMapReq)
operation := req.Op
if operation == proto.MarkMapReq_OPERATION_ADD {
if operation == proto.MarkMapReq_ADD {
logger.Debug("user mark type: %v", req.Mark.PointType)
if req.Mark.PointType == proto.MapMarkPointType_MAP_MARK_POINT_TYPE_NPC {
if req.Mark.PointType == proto.MapMarkPointType_MONSTER {
posYInt, err := strconv.ParseInt(req.Mark.Name, 10, 64)
if err != nil {
logger.Error("parse pos y error: %v", err)
@@ -87,7 +87,7 @@ func (g *GameManager) TeleportPlayer(player *model.Player, enterReason uint16, s
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
oldScene := world.GetSceneById(oldSceneId)
activeAvatarId := world.GetPlayerActiveAvatarId(player)
g.RemoveSceneEntityNotifyBroadcast(oldScene, proto.VisionType_VISION_TYPE_REMOVE, []uint32{world.GetPlayerWorldAvatarEntityId(player, activeAvatarId)})
g.RemoveSceneEntityNotifyBroadcast(oldScene, proto.VisionType_VISION_REMOVE, []uint32{world.GetPlayerWorldAvatarEntityId(player, activeAvatarId)})
if jumpScene {
delTeamEntityNotify := g.PacketDelTeamEntityNotify(oldScene, player)
g.SendMsg(cmd.DelTeamEntityNotify, player.PlayerID, player.ClientSeq, delTeamEntityNotify)
@@ -109,14 +109,14 @@ func (g *GameManager) TeleportPlayer(player *model.Player, enterReason uint16, s
switch enterReason {
case constant.EnterReasonConst.DungeonEnter:
logger.Debug("player dungeon scene, scene: %v, pos: %v", player.SceneId, player.Pos)
enterType = proto.EnterType_ENTER_TYPE_DUNGEON
enterType = proto.EnterType_ENTER_DUNGEON
default:
if jumpScene {
logger.Debug("player jump scene, scene: %v, pos: %v", player.SceneId, player.Pos)
enterType = proto.EnterType_ENTER_TYPE_JUMP
enterType = proto.EnterType_ENTER_JUMP
} else {
logger.Debug("player goto scene, scene: %v, pos: %v", player.SceneId, player.Pos)
enterType = proto.EnterType_ENTER_TYPE_GOTO
enterType = proto.EnterType_ENTER_GOTO
}
}
playerEnterSceneNotify := g.PacketPlayerEnterSceneNotifyTp(player, enterType, uint32(enterReason), oldSceneId, oldPos, dungeonId)

View File

@@ -90,7 +90,7 @@ func (g *GameManager) JoinOtherWorld(player *model.Player, hostPlayer *model.Pla
player.Rot.Z = hostPlayer.Rot.Z
g.UserWorldAddPlayer(hostWorld, player)
playerEnterSceneNotify := g.PacketPlayerEnterSceneNotifyLogin(player, proto.EnterType_ENTER_TYPE_OTHER)
playerEnterSceneNotify := g.PacketPlayerEnterSceneNotifyLogin(player, proto.EnterType_ENTER_OTHER)
g.SendMsg(cmd.PlayerEnterSceneNotify, player.PlayerID, player.ClientSeq, playerEnterSceneNotify)
} else {
hostWorld.waitEnterPlayerMap[player.PlayerID] = time.Now().UnixMilli()
@@ -180,7 +180,7 @@ func (g *GameManager) UserApplyEnterWorld(player *model.Player, targetUid uint32
TargetUid: targetUid,
TargetNickname: "",
IsAgreed: false,
Reason: proto.PlayerApplyEnterMpResultNotify_REASON_PLAYER_CANNOT_ENTER_MP,
Reason: proto.PlayerApplyEnterMpResultNotify_PLAYER_CANNOT_ENTER_MP,
}
g.SendMsg(cmd.PlayerApplyEnterMpResultNotify, player.PlayerID, player.ClientSeq, playerApplyEnterMpResultNotify)
}
@@ -286,7 +286,7 @@ func (g *GameManager) UserDealEnterWorld(hostPlayer *model.Player, otherUid uint
TargetUid: hostPlayer.PlayerID,
TargetNickname: hostPlayer.NickName,
IsAgreed: false,
Reason: proto.PlayerApplyEnterMpResultNotify_REASON_PLAYER_CANNOT_ENTER_MP,
Reason: proto.PlayerApplyEnterMpResultNotify_PLAYER_CANNOT_ENTER_MP,
}
g.SendMsg(cmd.PlayerApplyEnterMpResultNotify, otherPlayer.PlayerID, otherPlayer.ClientSeq, playerApplyEnterMpResultNotify)
return
@@ -296,7 +296,7 @@ func (g *GameManager) UserDealEnterWorld(hostPlayer *model.Player, otherUid uint
TargetUid: hostPlayer.PlayerID,
TargetNickname: hostPlayer.NickName,
IsAgreed: agree,
Reason: proto.PlayerApplyEnterMpResultNotify_REASON_PLAYER_JUDGE,
Reason: proto.PlayerApplyEnterMpResultNotify_PLAYER_JUDGE,
}
g.SendMsg(cmd.PlayerApplyEnterMpResultNotify, otherPlayer.PlayerID, otherPlayer.ClientSeq, playerApplyEnterMpResultNotify)
}
@@ -325,7 +325,7 @@ func (g *GameManager) HostEnterMpWorld(hostPlayer *model.Player, otherUid uint32
hostPlayerEnterSceneNotify := g.PacketPlayerEnterSceneNotifyMp(
hostPlayer,
hostPlayer,
proto.EnterType_ENTER_TYPE_GOTO,
proto.EnterType_ENTER_GOTO,
uint32(constant.EnterReasonConst.HostFromSingleToMp),
hostPlayer.SceneId,
hostPlayer.Pos,
@@ -341,7 +341,7 @@ func (g *GameManager) HostEnterMpWorld(hostPlayer *model.Player, otherUid uint32
// 仅仅把当前的场上角色的实体消失掉
activeAvatarId := world.GetPlayerActiveAvatarId(hostPlayer)
g.RemoveSceneEntityNotifyToPlayer(hostPlayer, proto.VisionType_VISION_TYPE_MISS, []uint32{world.GetPlayerWorldAvatarEntityId(hostPlayer, activeAvatarId)})
g.RemoveSceneEntityNotifyToPlayer(hostPlayer, proto.VisionType_VISION_MISS, []uint32{world.GetPlayerWorldAvatarEntityId(hostPlayer, activeAvatarId)})
}
func (g *GameManager) UserLeaveWorld(player *model.Player) bool {
@@ -389,19 +389,19 @@ func (g *GameManager) UserWorldRemovePlayer(world *World, player *model.Player)
// 仅仅把当前的场上角色的实体消失掉
activeAvatarId := world.GetPlayerActiveAvatarId(player)
g.RemoveSceneEntityNotifyToPlayer(player, proto.VisionType_VISION_TYPE_MISS, []uint32{world.GetPlayerWorldAvatarEntityId(player, activeAvatarId)})
g.RemoveSceneEntityNotifyToPlayer(player, proto.VisionType_VISION_MISS, []uint32{world.GetPlayerWorldAvatarEntityId(player, activeAvatarId)})
delTeamEntityNotify := g.PacketDelTeamEntityNotify(scene, player)
g.SendMsg(cmd.DelTeamEntityNotify, player.PlayerID, player.ClientSeq, delTeamEntityNotify)
if world.multiplayer {
playerQuitFromMpNotify := &proto.PlayerQuitFromMpNotify{
Reason: proto.PlayerQuitFromMpNotify_QUIT_REASON_BACK_TO_MY_WORLD,
Reason: proto.PlayerQuitFromMpNotify_BACK_TO_MY_WORLD,
}
g.SendMsg(cmd.PlayerQuitFromMpNotify, player.PlayerID, player.ClientSeq, playerQuitFromMpNotify)
activeAvatarId := world.GetPlayerActiveAvatarId(player)
g.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_TYPE_REMOVE, []uint32{world.GetPlayerWorldAvatarEntityId(player, activeAvatarId)})
g.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_REMOVE, []uint32{world.GetPlayerWorldAvatarEntityId(player, activeAvatarId)})
}
world.RemovePlayer(player)
@@ -430,7 +430,7 @@ func (g *GameManager) UpdateWorldPlayerInfo(hostWorld *World, excludePlayer *mod
}
playerPreEnterMpNotify := &proto.PlayerPreEnterMpNotify{
State: proto.PlayerPreEnterMpNotify_STATE_START,
State: proto.PlayerPreEnterMpNotify_START,
Uid: excludePlayer.PlayerID,
Nickname: excludePlayer.NickName,
}
@@ -588,7 +588,7 @@ func (g *GameManager) ServerUserMpReq(userMpInfo *mq.UserMpInfo, gsAppId string)
TargetUid: userMpInfo.HostUserId,
TargetNickname: userMpInfo.HostNickname,
IsAgreed: false,
Reason: proto.PlayerApplyEnterMpResultNotify_REASON_PLAYER_CANNOT_ENTER_MP,
Reason: proto.PlayerApplyEnterMpResultNotify_PLAYER_CANNOT_ENTER_MP,
}
g.SendMsg(cmd.PlayerApplyEnterMpResultNotify, applyPlayer.PlayerID, applyPlayer.ClientSeq, playerApplyEnterMpResultNotify)
return
@@ -598,7 +598,7 @@ func (g *GameManager) ServerUserMpReq(userMpInfo *mq.UserMpInfo, gsAppId string)
TargetUid: userMpInfo.HostUserId,
TargetNickname: userMpInfo.HostNickname,
IsAgreed: userMpInfo.Agreed,
Reason: proto.PlayerApplyEnterMpResultNotify_REASON_PLAYER_JUDGE,
Reason: proto.PlayerApplyEnterMpResultNotify_PLAYER_JUDGE,
}
g.SendMsg(cmd.PlayerApplyEnterMpResultNotify, applyPlayer.PlayerID, applyPlayer.ClientSeq, playerApplyEnterMpResultNotify)
}
@@ -617,7 +617,7 @@ func (g *GameManager) ServerUserMpRsp(userMpInfo *mq.UserMpInfo) {
TargetUid: userMpInfo.HostUserId,
TargetNickname: "",
IsAgreed: false,
Reason: proto.PlayerApplyEnterMpResultNotify_REASON_PLAYER_CANNOT_ENTER_MP,
Reason: proto.PlayerApplyEnterMpResultNotify_PLAYER_CANNOT_ENTER_MP,
}
g.SendMsg(cmd.PlayerApplyEnterMpResultNotify, player.PlayerID, player.ClientSeq, playerApplyEnterMpResultNotify)
}

View File

@@ -245,13 +245,13 @@ func (g *GameManager) EnterSceneDoneReq(player *model.Player, payloadMsg pb.Mess
g.SendMsg(cmd.GuestPostEnterSceneNotify, world.owner.PlayerID, world.owner.ClientSeq, guestPostEnterSceneNotify)
}
var visionType = proto.VisionType_VISION_TYPE_NONE
var visionType = proto.VisionType_VISION_NONE
activeAvatarId := world.GetPlayerActiveAvatarId(player)
if player.SceneJump {
visionType = proto.VisionType_VISION_TYPE_BORN
visionType = proto.VisionType_VISION_BORN
} else {
visionType = proto.VisionType_VISION_TYPE_TRANSPORT
visionType = proto.VisionType_VISION_TRANSPORT
}
activeAvatarEntityId := world.GetPlayerWorldAvatarEntityId(player, activeAvatarId)
g.AddSceneEntityNotify(player, visionType, []uint32{activeAvatarEntityId}, true, false)
@@ -264,9 +264,9 @@ func (g *GameManager) EnterSceneDoneReq(player *model.Player, payloadMsg pb.Mess
}
}
if player.SceneJump {
visionType = proto.VisionType_VISION_TYPE_MEET
visionType = proto.VisionType_VISION_MEET
} else {
visionType = proto.VisionType_VISION_TYPE_TRANSPORT
visionType = proto.VisionType_VISION_TRANSPORT
}
entityMap := scene.GetAllEntity()
entityIdList := make([]uint32, 0)
@@ -552,8 +552,8 @@ func (g *GameManager) AddSceneEntityNotify(player *model.Player, visionType prot
continue
}
switch entity.entityType {
case uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_AVATAR):
if visionType == proto.VisionType_VISION_TYPE_MEET && entity.avatarEntity.uid == player.PlayerID {
case uint32(proto.ProtEntityType_PROT_ENTITY_AVATAR):
if visionType == proto.VisionType_VISION_MEET && entity.avatarEntity.uid == player.PlayerID {
continue
}
scenePlayer := USER_MANAGER.GetOnlineUser(entity.avatarEntity.uid)
@@ -566,14 +566,14 @@ func (g *GameManager) AddSceneEntityNotify(player *model.Player, visionType prot
}
sceneEntityInfoAvatar := g.PacketSceneEntityInfoAvatar(scene, scenePlayer, world.GetPlayerActiveAvatarId(scenePlayer))
entityList = append(entityList, sceneEntityInfoAvatar)
case uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_WEAPON):
case uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_MONSTER):
case uint32(proto.ProtEntityType_PROT_ENTITY_WEAPON):
case uint32(proto.ProtEntityType_PROT_ENTITY_MONSTER):
sceneEntityInfoMonster := g.PacketSceneEntityInfoMonster(scene, entity.id)
entityList = append(entityList, sceneEntityInfoMonster)
case uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_NPC):
case uint32(proto.ProtEntityType_PROT_ENTITY_NPC):
sceneEntityInfoNpc := g.PacketSceneEntityInfoNpc(scene, entity.id)
entityList = append(entityList, sceneEntityInfoNpc)
case uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_GADGET):
case uint32(proto.ProtEntityType_PROT_ENTITY_GADGET):
sceneEntityInfoGadget := g.PacketSceneEntityInfoGadget(scene, entity.id)
entityList = append(entityList, sceneEntityInfoGadget)
}
@@ -655,7 +655,7 @@ func (g *GameManager) PacketSceneEntityInfoAvatar(scene *Scene, player *model.Pl
}
worldAvatar := scene.world.GetWorldAvatarByEntityId(entity.id)
sceneEntityInfo := &proto.SceneEntityInfo{
EntityType: proto.ProtEntityType_PROT_ENTITY_TYPE_AVATAR,
EntityType: proto.ProtEntityType_PROT_ENTITY_AVATAR,
EntityId: entity.id,
MotionInfo: &proto.MotionInfo{
Pos: pos,
@@ -712,7 +712,7 @@ func (g *GameManager) PacketSceneEntityInfoMonster(scene *Scene, entityId uint32
Z: float32(entity.pos.Z),
}
sceneEntityInfo := &proto.SceneEntityInfo{
EntityType: proto.ProtEntityType_PROT_ENTITY_TYPE_MONSTER,
EntityType: proto.ProtEntityType_PROT_ENTITY_MONSTER,
EntityId: entity.id,
MotionInfo: &proto.MotionInfo{
Pos: pos,
@@ -760,7 +760,7 @@ func (g *GameManager) PacketSceneEntityInfoNpc(scene *Scene, entityId uint32) *p
Z: float32(entity.pos.Z),
}
sceneEntityInfo := &proto.SceneEntityInfo{
EntityType: proto.ProtEntityType_PROT_ENTITY_TYPE_NPC,
EntityType: proto.ProtEntityType_PROT_ENTITY_NPC,
EntityId: entity.id,
MotionInfo: &proto.MotionInfo{
Pos: pos,
@@ -808,7 +808,7 @@ func (g *GameManager) PacketSceneEntityInfoGadget(scene *Scene, entityId uint32)
Z: float32(entity.pos.Z),
}
sceneEntityInfo := &proto.SceneEntityInfo{
EntityType: proto.ProtEntityType_PROT_ENTITY_TYPE_GADGET,
EntityType: proto.ProtEntityType_PROT_ENTITY_GADGET,
EntityId: entity.id,
MotionInfo: &proto.MotionInfo{
Pos: pos,
@@ -900,7 +900,7 @@ func (g *GameManager) PacketSceneMonsterInfo(entity *Entity) *proto.SceneMonster
sceneMonsterInfo := &proto.SceneMonsterInfo{
MonsterId: entity.monsterEntity.monsterId,
AuthorityPeerId: 1,
BornType: proto.MonsterBornType_MONSTER_BORN_TYPE_DEFAULT,
BornType: proto.MonsterBornType_MONSTER_BORN_DEFAULT,
// BlockId: 3001,
// TitleId: 3001,
// SpecialNameId: 40,

View File

@@ -167,9 +167,9 @@ func (g *GameManager) GetPlayerFriendListReq(player *model.Player, payloadMsg pb
}
var onlineState proto.FriendOnlineState = 0
if online {
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_ONLINE
onlineState = proto.FriendOnlineState_FRIEND_ONLINE
} else {
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_DISCONNECT
onlineState = proto.FriendOnlineState_FREIEND_DISCONNECT
}
friendBrief := &proto.FriendBrief{
Uid: friendPlayer.PlayerID,
@@ -184,7 +184,7 @@ func (g *GameManager) GetPlayerFriendListReq(player *model.Player, payloadMsg pb
NameCardId: friendPlayer.NameCard,
Param: (uint32(time.Now().Unix()) - player.OfflineTime) / 3600 / 24,
IsGameSource: true,
PlatformType: proto.PlatformType_PLATFORM_TYPE_PC,
PlatformType: proto.PlatformType_PC,
}
getPlayerFriendListRsp.FriendList = append(getPlayerFriendListRsp.FriendList, friendBrief)
}
@@ -205,9 +205,9 @@ func (g *GameManager) GetPlayerAskFriendListReq(player *model.Player, payloadMsg
}
var onlineState proto.FriendOnlineState
if online {
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_ONLINE
onlineState = proto.FriendOnlineState_FRIEND_ONLINE
} else {
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_DISCONNECT
onlineState = proto.FriendOnlineState_FREIEND_DISCONNECT
}
friendBrief := &proto.FriendBrief{
Uid: friendPlayer.PlayerID,
@@ -222,7 +222,7 @@ func (g *GameManager) GetPlayerAskFriendListReq(player *model.Player, payloadMsg
NameCardId: friendPlayer.NameCard,
Param: (uint32(time.Now().Unix()) - player.OfflineTime) / 3600 / 24,
IsGameSource: true,
PlatformType: proto.PlatformType_PLATFORM_TYPE_PC,
PlatformType: proto.PlatformType_PC,
}
getPlayerAskFriendListRsp.AskFriendList = append(getPlayerAskFriendListRsp.AskFriendList, friendBrief)
}
@@ -305,13 +305,13 @@ func (g *GameManager) AskAddFriendReq(player *model.Player, payloadMsg pb.Messag
ProfilePicture: &proto.ProfilePicture{AvatarId: player.HeadImage},
WorldLevel: player.PropertiesMap[constant.PlayerPropertyConst.PROP_PLAYER_WORLD_LEVEL],
Signature: player.Signature,
OnlineState: proto.FriendOnlineState_FRIEND_ONLINE_STATE_ONLINE,
OnlineState: proto.FriendOnlineState_FRIEND_ONLINE,
IsMpModeAvailable: true,
LastActiveTime: player.OfflineTime,
NameCardId: player.NameCard,
Param: (uint32(time.Now().Unix()) - player.OfflineTime) / 3600 / 24,
IsGameSource: true,
PlatformType: proto.PlatformType_PLATFORM_TYPE_PC,
PlatformType: proto.PlatformType_PC,
}
g.SendMsg(cmd.AskAddFriendNotify, targetPlayer.PlayerID, targetPlayer.ClientSeq, askAddFriendNotify)
}
@@ -323,7 +323,7 @@ func (g *GameManager) DealAddFriendReq(player *model.Player, payloadMsg pb.Messa
result := req.DealAddFriendResult
agree := false
if result == proto.DealAddFriendResultType_DEAL_ADD_FRIEND_RESULT_TYPE_ACCEPT {
if result == proto.DealAddFriendResultType_DEAL_ADD_FRIEND_ACCEPT {
agree = true
}
if agree {
@@ -387,7 +387,7 @@ func (g *GameManager) GetOnlinePlayerListReq(player *model.Player, payloadMsg pb
Uid: BigWorldAiUid,
Nickname: BigWorldAiName,
PlayerLevel: 1,
MpSettingType: proto.MpSettingType_MP_SETTING_TYPE_ENTER_AFTER_APPLY,
MpSettingType: proto.MpSettingType_MP_SETTING_ENTER_AFTER_APPLY,
NameCardId: 210001,
Signature: BigWorldAiSign,
ProfilePicture: &proto.ProfilePicture{AvatarId: 10000007},
@@ -499,13 +499,13 @@ func (g *GameManager) ServerAddFriendNotify(addFriendInfo *mq.AddFriendInfo) {
ProfilePicture: &proto.ProfilePicture{AvatarId: addFriendInfo.ApplyPlayerOnlineInfo.HeadImageId},
WorldLevel: addFriendInfo.ApplyPlayerOnlineInfo.WorldLevel,
Signature: addFriendInfo.ApplyPlayerOnlineInfo.Signature,
OnlineState: proto.FriendOnlineState_FRIEND_ONLINE_STATE_ONLINE,
OnlineState: proto.FriendOnlineState_FRIEND_ONLINE,
IsMpModeAvailable: true,
LastActiveTime: 0,
NameCardId: addFriendInfo.ApplyPlayerOnlineInfo.NameCardId,
Param: 0,
IsGameSource: true,
PlatformType: proto.PlatformType_PLATFORM_TYPE_PC,
PlatformType: proto.PlatformType_PC,
}
g.SendMsg(cmd.AskAddFriendNotify, targetPlayer.PlayerID, targetPlayer.ClientSeq, askAddFriendNotify)
case "DealAddFriendReq":

View File

@@ -20,7 +20,7 @@ import (
// HandleAbilityStamina 处理来自ability的耐力消耗
func (g *GameManager) HandleAbilityStamina(player *model.Player, entry *proto.AbilityInvokeEntry) {
switch entry.ArgumentType {
case proto.AbilityInvokeArgument_ABILITY_INVOKE_ARGUMENT_MIXIN_COST_STAMINA:
case proto.AbilityInvokeArgument_ABILITY_MIXIN_COST_STAMINA:
// 大剑重击 或 持续技能 耐力消耗
costStamina := new(proto.AbilityMixinCostStamina)
if appConfig.CONF.Hk4e.ClientProtoProxyEnable {
@@ -42,7 +42,7 @@ func (g *GameManager) HandleAbilityStamina(player *model.Player, entry *proto.Ab
}
// 处理持续耐力消耗
g.SkillSustainStamina(player, costStamina.IsSwim)
case proto.AbilityInvokeArgument_ABILITY_INVOKE_ARGUMENT_META_MODIFIER_CHANGE:
case proto.AbilityInvokeArgument_ABILITY_META_MODIFIER_CHANGE:
// 普通角色重击耐力消耗
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
// 获取世界中的角色实体
@@ -91,7 +91,7 @@ func (g *GameManager) SceneAvatarStaminaStepReq(player *model.Player, payloadMsg
// 根据动作状态消耗耐力
switch player.StaminaInfo.State {
case proto.MotionState_MOTION_STATE_CLIMB:
case proto.MotionState_MOTION_CLIMB:
// 缓慢攀爬
var angleRevise int32 // 角度修正值 归一化为-90到+90范围内的角
// rotX ∈ [0,90) angle = rotX
@@ -118,7 +118,7 @@ func (g *GameManager) SceneAvatarStaminaStepReq(player *model.Player, payloadMsg
}
logger.Debug("stamina climbing, rotX: %v, costRevise: %v, cost: %v", req.Rot.X, costRevise, constant.StaminaCostConst.CLIMBING_BASE-costRevise)
g.UpdatePlayerStamina(player, constant.StaminaCostConst.CLIMBING_BASE-costRevise)
case proto.MotionState_MOTION_STATE_SWIM_MOVE:
case proto.MotionState_MOTION_SWIM_MOVE:
// 缓慢游泳
g.UpdatePlayerStamina(player, constant.StaminaCostConst.SWIMMING)
}
@@ -152,16 +152,16 @@ func (g *GameManager) ImmediateStamina(player *model.Player, motionState proto.M
// 根据玩家的状态立刻消耗耐力
switch motionState {
case proto.MotionState_MOTION_STATE_CLIMB:
case proto.MotionState_MOTION_CLIMB:
// 攀爬开始
g.UpdatePlayerStamina(player, constant.StaminaCostConst.CLIMB_START)
case proto.MotionState_MOTION_STATE_DASH_BEFORE_SHAKE:
case proto.MotionState_MOTION_DASH_BEFORE_SHAKE:
// 冲刺
g.UpdatePlayerStamina(player, constant.StaminaCostConst.SPRINT)
case proto.MotionState_MOTION_STATE_CLIMB_JUMP:
case proto.MotionState_MOTION_CLIMB_JUMP:
// 攀爬跳跃
g.UpdatePlayerStamina(player, constant.StaminaCostConst.CLIMB_JUMP)
case proto.MotionState_MOTION_STATE_SWIM_DASH:
case proto.MotionState_MOTION_SWIM_DASH:
// 快速游泳开始
g.UpdatePlayerStamina(player, constant.StaminaCostConst.SWIM_DASH_START)
}
@@ -358,7 +358,7 @@ func (g *GameManager) UpdateVehicleStamina(player *model.Player, vehicleEntity *
// 添加的耐力大于0为恢复
if staminaCost > 0 {
// 耐力延迟2s(10 ticks)恢复 动作状态为加速将立刻恢复耐力
if staminaInfo.VehicleRestoreDelay < 10 && staminaInfo.State != proto.MotionState_MOTION_STATE_SKIFF_POWERED_DASH {
if staminaInfo.VehicleRestoreDelay < 10 && staminaInfo.State != proto.MotionState_MOTION_SKIFF_POWERED_DASH {
// logger.Debug("stamina delay add, restoreDelay: %v", staminaInfo.RestoreDelay)
staminaInfo.VehicleRestoreDelay++
return // 不恢复耐力
@@ -399,7 +399,7 @@ func (g *GameManager) UpdatePlayerStamina(player *model.Player, staminaCost int3
// 添加的耐力大于0为恢复
if staminaCost > 0 {
// 耐力延迟2s(10 ticks)恢复 动作状态为加速将立刻恢复耐力
if staminaInfo.PlayerRestoreDelay < 10 && staminaInfo.State != proto.MotionState_MOTION_STATE_POWERED_FLY {
if staminaInfo.PlayerRestoreDelay < 10 && staminaInfo.State != proto.MotionState_MOTION_POWERED_FLY {
// logger.Debug("stamina delay add, restoreDelay: %v", staminaInfo.RestoreDelay)
staminaInfo.PlayerRestoreDelay++
return // 不恢复耐力
@@ -460,7 +460,7 @@ func (g *GameManager) DrownBackHandler(player *model.Player) {
// 先传送玩家再设置角色存活否则同时设置会传送前显示角色实体
if player.StaminaInfo.DrownBackDelay > 20 && player.SceneLoadState == model.SceneEnterDone {
// 设置角色存活
scene.SetEntityLifeState(avatarEntity, constant.LifeStateConst.LIFE_REVIVE, proto.PlayerDieType_PLAYER_DIE_TYPE_NONE)
scene.SetEntityLifeState(avatarEntity, constant.LifeStateConst.LIFE_REVIVE, proto.PlayerDieType_PLAYER_DIE_NONE)
// 重置溺水返回时间
player.StaminaInfo.DrownBackDelay = 0
} else if player.StaminaInfo.DrownBackDelay == 20 {
@@ -516,10 +516,10 @@ func (g *GameManager) HandleDrown(player *model.Player, stamina uint32) {
}
// 确保玩家正在游泳
if player.StaminaInfo.State == proto.MotionState_MOTION_STATE_SWIM_MOVE || player.StaminaInfo.State == proto.MotionState_MOTION_STATE_SWIM_DASH {
if player.StaminaInfo.State == proto.MotionState_MOTION_SWIM_MOVE || player.StaminaInfo.State == proto.MotionState_MOTION_SWIM_DASH {
logger.Debug("player drown, curStamina: %v, state: %v", stamina, player.StaminaInfo.State)
// 设置角色为死亡
scene.SetEntityLifeState(avatarEntity, constant.LifeStateConst.LIFE_DEAD, proto.PlayerDieType_PLAYER_DIE_TYPE_DRAWN)
scene.SetEntityLifeState(avatarEntity, constant.LifeStateConst.LIFE_DEAD, proto.PlayerDieType_PLAYER_DIE_DRAWN)
// 溺水返回安全点 计时开始
player.StaminaInfo.DrownBackDelay = 1
}

View File

@@ -39,10 +39,10 @@ func (g *GameManager) ChangeAvatarReq(player *model.Player, payloadMsg pb.Messag
logger.Error("can not find old avatar entity, entity id: %v", oldAvatarEntityId)
return
}
oldAvatarEntity.moveState = uint16(proto.MotionState_MOTION_STATE_STANDBY)
oldAvatarEntity.moveState = uint16(proto.MotionState_MOTION_STANDBY)
sceneEntityDisappearNotify := &proto.SceneEntityDisappearNotify{
DisappearType: proto.VisionType_VISION_TYPE_REPLACE,
DisappearType: proto.VisionType_VISION_REPLACE,
EntityList: []uint32{oldAvatarEntity.id},
}
for _, scenePlayer := range scene.playerMap {
@@ -52,7 +52,7 @@ func (g *GameManager) ChangeAvatarReq(player *model.Player, payloadMsg pb.Messag
newAvatarId := world.GetPlayerActiveAvatarId(player)
newAvatarEntity := g.PacketSceneEntityInfoAvatar(scene, player, newAvatarId)
sceneEntityAppearNotify := &proto.SceneEntityAppearNotify{
AppearType: proto.VisionType_VISION_TYPE_REPLACE,
AppearType: proto.VisionType_VISION_REPLACE,
Param: oldAvatarEntity.id,
EntityList: []*proto.SceneEntityInfo{newAvatarEntity},
}

View File

@@ -17,7 +17,7 @@ func (g *GameManager) VehicleDestroyMotion(player *model.Player, entity *Entity,
scene := world.GetSceneById(player.SceneId)
// 状态等于 MOTION_STATE_DESTROY_VEHICLE 代表请求销毁
if state == proto.MotionState_MOTION_STATE_DESTROY_VEHICLE {
if state == proto.MotionState_MOTION_DESTROY_VEHICLE {
g.DestroyVehicleEntity(player, scene, entity.gadgetEntity.gadgetVehicleEntity.vehicleId, entity.id)
}
}
@@ -55,7 +55,7 @@ func (g *GameManager) CreateVehicleReq(player *model.Player, payloadMsg pb.Messa
g.CommonRetError(cmd.VehicleInteractRsp, player, &proto.VehicleInteractRsp{})
return
}
GAME_MANAGER.AddSceneEntityNotify(player, proto.VisionType_VISION_TYPE_BORN, []uint32{entityId}, true, false)
GAME_MANAGER.AddSceneEntityNotify(player, proto.VisionType_VISION_BORN, []uint32{entityId}, true, false)
// 记录创建的载具信息
player.VehicleInfo.LastCreateEntityIdMap[req.VehicleId] = entityId
player.VehicleInfo.LastCreateTime = time.Now().UnixMilli()
@@ -107,7 +107,7 @@ func (g *GameManager) DestroyVehicleEntity(player *model.Player, scene *Scene, v
}
// 删除已创建的载具
scene.DestroyEntity(entity.id)
g.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_TYPE_MISS, []uint32{entity.id})
g.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_MISS, []uint32{entity.id})
}
// EnterVehicle 进入载具
@@ -136,7 +136,7 @@ func (g *GameManager) EnterVehicle(player *model.Player, entity *Entity, avatarG
// PacketVehicleInteractRsp
vehicleInteractRsp := &proto.VehicleInteractRsp{
InteractType: proto.VehicleInteractType_VEHICLE_INTERACT_TYPE_IN,
InteractType: proto.VehicleInteractType_VEHICLE_INTERACT_IN,
Member: &proto.VehicleMember{
Uid: player.PlayerID,
AvatarGuid: avatarGuid,
@@ -168,7 +168,7 @@ func (g *GameManager) ExitVehicle(player *model.Player, entity *Entity, avatarGu
// PacketVehicleInteractRsp
vehicleInteractRsp := &proto.VehicleInteractRsp{
InteractType: proto.VehicleInteractType_VEHICLE_INTERACT_TYPE_OUT,
InteractType: proto.VehicleInteractType_VEHICLE_INTERACT_OUT,
Member: &proto.VehicleMember{
Uid: player.PlayerID,
AvatarGuid: avatarGuid,
@@ -203,10 +203,10 @@ func (g *GameManager) VehicleInteractReq(player *model.Player, payloadMsg pb.Mes
avatarGuid := player.AvatarMap[player.TeamConfig.GetActiveAvatarId()].Guid
switch req.InteractType {
case proto.VehicleInteractType_VEHICLE_INTERACT_TYPE_IN:
case proto.VehicleInteractType_VEHICLE_INTERACT_IN:
// 进入载具
g.EnterVehicle(player, entity, avatarGuid)
case proto.VehicleInteractType_VEHICLE_INTERACT_TYPE_OUT:
case proto.VehicleInteractType_VEHICLE_INTERACT_OUT:
// 离开载具
g.ExitVehicle(player, entity, avatarGuid)
}

View File

@@ -11,7 +11,7 @@ import (
func (g *GameManager) GetAllWeaponDataConfig() map[int32]*gdconf.ItemData {
allWeaponDataConfig := make(map[int32]*gdconf.ItemData)
for itemId, itemData := range gdconf.CONF.ItemDataMap {
if uint16(itemData.EquipType) != constant.EquipTypeConst.EQUIP_WEAPON {
if uint16(itemData.Type) != constant.ItemTypeConst.ITEM_WEAPON {
continue
}
if (itemId >= 10000 && itemId <= 10008) ||
@@ -52,7 +52,7 @@ func (g *GameManager) AddUserWeapon(userId uint32, itemId uint32) uint64 {
}
storeItemChangeNotify := &proto.StoreItemChangeNotify{
StoreType: proto.StoreType_STORE_TYPE_PACK,
StoreType: proto.StoreType_STORE_PACK,
ItemList: make([]*proto.Item, 0),
}
affixMap := make(map[uint32]uint32)

View File

@@ -337,10 +337,10 @@ func (t *TickManager) onTickSecond(now int64) {
GAME_MANAGER.SendMsg(cmd.WorldPlayerRTTNotify, player.PlayerID, 0, worldPlayerRTTNotify)
// 玩家安全位置更新
switch player.StaminaInfo.State {
case proto.MotionState_MOTION_STATE_DANGER_RUN, proto.MotionState_MOTION_STATE_RUN,
proto.MotionState_MOTION_STATE_DANGER_STANDBY_MOVE, proto.MotionState_MOTION_STATE_DANGER_STANDBY, proto.MotionState_MOTION_STATE_LADDER_TO_STANDBY, proto.MotionState_MOTION_STATE_STANDBY_MOVE, proto.MotionState_MOTION_STATE_STANDBY,
proto.MotionState_MOTION_STATE_DANGER_WALK, proto.MotionState_MOTION_STATE_WALK,
proto.MotionState_MOTION_STATE_DASH:
case proto.MotionState_MOTION_DANGER_RUN, proto.MotionState_MOTION_RUN,
proto.MotionState_MOTION_DANGER_STANDBY_MOVE, proto.MotionState_MOTION_DANGER_STANDBY, proto.MotionState_MOTION_LADDER_TO_STANDBY, proto.MotionState_MOTION_STANDBY_MOVE, proto.MotionState_MOTION_STANDBY,
proto.MotionState_MOTION_DANGER_WALK, proto.MotionState_MOTION_WALK,
proto.MotionState_MOTION_DASH:
// 仅在陆地时更新玩家安全位置
player.SafePos.X = player.Pos.X
player.SafePos.Y = player.Pos.Y

View File

@@ -226,7 +226,7 @@ func (g *GameManager) VideoPlayerUpdate(rgb bool) {
for _, v := range SCREEN_ENTITY_ID_LIST {
scene.DestroyEntity(v)
}
GAME_MANAGER.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_TYPE_REMOVE, SCREEN_ENTITY_ID_LIST)
GAME_MANAGER.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_REMOVE, SCREEN_ENTITY_ID_LIST)
SCREEN_ENTITY_ID_LIST = make([]uint32, 0)
leftTopPos := &model.Vector{
X: BASE_POS.X + float64(float64(SCREEN_WIDTH)*SCREEN_DPI/2),
@@ -256,5 +256,5 @@ func (g *GameManager) VideoPlayerUpdate(rgb bool) {
}
}
}
GAME_MANAGER.AddSceneEntityNotify(world.owner, proto.VisionType_VISION_TYPE_BORN, SCREEN_ENTITY_ID_LIST, true, false)
GAME_MANAGER.AddSceneEntityNotify(world.owner, proto.VisionType_VISION_BORN, SCREEN_ENTITY_ID_LIST, true, false)
}

View File

@@ -845,7 +845,7 @@ func (s *Scene) SetEntityLifeState(entity *Entity, lifeState uint16, dieType pro
// 删除实体
s.DestroyEntity(entity.id)
GAME_MANAGER.RemoveSceneEntityNotifyBroadcast(s, proto.VisionType_VISION_TYPE_DIE, []uint32{entity.id})
GAME_MANAGER.RemoveSceneEntityNotifyBroadcast(s, proto.VisionType_VISION_DIE, []uint32{entity.id})
}
}
@@ -857,11 +857,11 @@ func (s *Scene) CreateEntityAvatar(player *model.Player, avatarId uint32) uint32
lifeState: constant.LifeStateConst.LIFE_ALIVE,
pos: player.Pos,
rot: player.Rot,
moveState: uint16(proto.MotionState_MOTION_STATE_NONE),
moveState: uint16(proto.MotionState_MOTION_NONE),
lastMoveSceneTimeMs: 0,
lastMoveReliableSeq: 0,
fightProp: player.AvatarMap[avatarId].FightPropMap,
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_AVATAR),
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_AVATAR),
level: player.AvatarMap[avatarId].Level,
avatarEntity: &AvatarEntity{
uid: player.PlayerID,
@@ -891,11 +891,11 @@ func (s *Scene) CreateEntityWeapon() uint32 {
lifeState: constant.LifeStateConst.LIFE_ALIVE,
pos: new(model.Vector),
rot: new(model.Vector),
moveState: uint16(proto.MotionState_MOTION_STATE_NONE),
moveState: uint16(proto.MotionState_MOTION_NONE),
lastMoveSceneTimeMs: 0,
lastMoveReliableSeq: 0,
fightProp: nil,
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_WEAPON),
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_WEAPON),
level: 0,
}
s.entityMap[entity.id] = entity
@@ -914,11 +914,11 @@ func (s *Scene) CreateEntityMonster(pos, rot *model.Vector, monsterId uint32, le
lifeState: constant.LifeStateConst.LIFE_ALIVE,
pos: pos,
rot: rot,
moveState: uint16(proto.MotionState_MOTION_STATE_NONE),
moveState: uint16(proto.MotionState_MOTION_NONE),
lastMoveSceneTimeMs: 0,
lastMoveReliableSeq: 0,
fightProp: fightProp,
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_MONSTER),
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_MONSTER),
level: level,
monsterEntity: &MonsterEntity{
monsterId: monsterId,
@@ -952,7 +952,7 @@ func (s *Scene) CreateEntityNpc(pos, rot *model.Vector, npcId, roomId, parentQue
lifeState: constant.LifeStateConst.LIFE_ALIVE,
pos: pos,
rot: rot,
moveState: uint16(proto.MotionState_MOTION_STATE_NONE),
moveState: uint16(proto.MotionState_MOTION_NONE),
lastMoveSceneTimeMs: 0,
lastMoveReliableSeq: 0,
fightProp: map[uint32]float32{
@@ -960,7 +960,7 @@ func (s *Scene) CreateEntityNpc(pos, rot *model.Vector, npcId, roomId, parentQue
uint32(constant.FightPropertyConst.FIGHT_PROP_MAX_HP): math.MaxFloat32,
uint32(constant.FightPropertyConst.FIGHT_PROP_BASE_HP): float32(1),
},
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_NPC),
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_NPC),
level: 0,
npcEntity: &NpcEntity{
NpcId: npcId,
@@ -988,7 +988,7 @@ func (s *Scene) CreateEntityGadgetNormal(pos, rot *model.Vector, gadgetId uint32
lifeState: constant.LifeStateConst.LIFE_ALIVE,
pos: pos,
rot: rot,
moveState: uint16(proto.MotionState_MOTION_STATE_NONE),
moveState: uint16(proto.MotionState_MOTION_NONE),
lastMoveSceneTimeMs: 0,
lastMoveReliableSeq: 0,
fightProp: map[uint32]float32{
@@ -996,7 +996,7 @@ func (s *Scene) CreateEntityGadgetNormal(pos, rot *model.Vector, gadgetId uint32
uint32(constant.FightPropertyConst.FIGHT_PROP_MAX_HP): math.MaxFloat32,
uint32(constant.FightPropertyConst.FIGHT_PROP_BASE_HP): float32(1),
},
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_GADGET),
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_GADGET),
level: 0,
gadgetEntity: &GadgetEntity{
gadgetId: gadgetId,
@@ -1022,7 +1022,7 @@ func (s *Scene) CreateEntityGadgetGather(pos, rot *model.Vector, gadgetId uint32
lifeState: constant.LifeStateConst.LIFE_ALIVE,
pos: pos,
rot: rot,
moveState: uint16(proto.MotionState_MOTION_STATE_NONE),
moveState: uint16(proto.MotionState_MOTION_NONE),
lastMoveSceneTimeMs: 0,
lastMoveReliableSeq: 0,
fightProp: map[uint32]float32{
@@ -1030,7 +1030,7 @@ func (s *Scene) CreateEntityGadgetGather(pos, rot *model.Vector, gadgetId uint32
uint32(constant.FightPropertyConst.FIGHT_PROP_MAX_HP): math.MaxFloat32,
uint32(constant.FightPropertyConst.FIGHT_PROP_BASE_HP): float32(1),
},
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_GADGET),
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_GADGET),
level: 0,
gadgetEntity: &GadgetEntity{
gadgetId: gadgetId,
@@ -1054,7 +1054,7 @@ func (s *Scene) CreateEntityGadgetClient(pos, rot *model.Vector, entityId uint32
lifeState: constant.LifeStateConst.LIFE_ALIVE,
pos: pos,
rot: rot,
moveState: uint16(proto.MotionState_MOTION_STATE_NONE),
moveState: uint16(proto.MotionState_MOTION_NONE),
lastMoveSceneTimeMs: 0,
lastMoveReliableSeq: 0,
fightProp: map[uint32]float32{
@@ -1062,7 +1062,7 @@ func (s *Scene) CreateEntityGadgetClient(pos, rot *model.Vector, entityId uint32
uint32(constant.FightPropertyConst.FIGHT_PROP_MAX_HP): math.MaxFloat32,
uint32(constant.FightPropertyConst.FIGHT_PROP_BASE_HP): float32(1),
},
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_GADGET),
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_GADGET),
level: 0,
gadgetEntity: &GadgetEntity{
gadgetType: GADGET_TYPE_CLIENT,
@@ -1092,7 +1092,7 @@ func (s *Scene) CreateEntityGadgetVehicle(uid uint32, pos, rot *model.Vector, ve
lifeState: constant.LifeStateConst.LIFE_ALIVE,
pos: pos,
rot: rot,
moveState: uint16(proto.MotionState_MOTION_STATE_NONE),
moveState: uint16(proto.MotionState_MOTION_NONE),
lastMoveSceneTimeMs: 0,
lastMoveReliableSeq: 0,
fightProp: map[uint32]float32{
@@ -1101,7 +1101,7 @@ func (s *Scene) CreateEntityGadgetVehicle(uid uint32, pos, rot *model.Vector, ve
uint32(constant.FightPropertyConst.FIGHT_PROP_MAX_HP): 114514,
uint32(constant.FightPropertyConst.FIGHT_PROP_BASE_HP): float32(1),
},
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_TYPE_GADGET),
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_GADGET),
level: 0,
gadgetEntity: &GadgetEntity{
gadgetType: GADGET_TYPE_VEHICLE,

View File

@@ -125,15 +125,15 @@ func (i *InvokeHandler[T]) InitInvokeHandler() {
func (i *InvokeHandler[T]) AddEntry(forward proto.ForwardType, entry *T) {
switch forward {
case proto.ForwardType_FORWARD_TYPE_TO_ALL:
case proto.ForwardType_FORWARD_TO_ALL:
i.EntryListForwardAll = append(i.EntryListForwardAll, entry)
case proto.ForwardType_FORWARD_TYPE_TO_ALL_EXCEPT_CUR:
case proto.ForwardType_FORWARD_TO_ALL_EXCEPT_CUR:
fallthrough
case proto.ForwardType_FORWARD_TYPE_TO_ALL_EXIST_EXCEPT_CUR:
case proto.ForwardType_FORWARD_TO_ALL_EXIST_EXCEPT_CUR:
i.EntryListForwardAllExceptCur = append(i.EntryListForwardAllExceptCur, entry)
case proto.ForwardType_FORWARD_TYPE_TO_HOST:
case proto.ForwardType_FORWARD_TO_HOST:
i.EntryListForwardHost = append(i.EntryListForwardHost, entry)
case proto.ForwardType_FORWARD_TYPE_ONLY_SERVER:
case proto.ForwardType_FORWARD_ONLY_SERVER:
i.EntryListForwardServer = append(i.EntryListForwardServer, entry)
// logger.Error("forward server entry: %v", entry)
default:

View File

@@ -20,6 +20,7 @@ type Reliquary struct {
func (p *Player) InitReliquary(reliquary *Reliquary) {
reliquary.Guid = p.GetNextGameObjectGuid()
p.GameObjectGuidMap[reliquary.Guid] = GameObject(reliquary)
p.ReliquaryMap[reliquary.ReliquaryId] = reliquary
if reliquary.AvatarId != 0 {
avatar := p.AvatarMap[reliquary.AvatarId]

View File

@@ -23,39 +23,39 @@ func (s *StaminaInfo) SetStaminaCost(state proto.MotionState) {
// TODO 角色天赋 食物 会影响耐力消耗
switch state {
// 消耗耐力
case proto.MotionState_MOTION_STATE_DASH:
case proto.MotionState_MOTION_DASH:
// 快速跑步
s.CostStamina = constant.StaminaCostConst.DASH
case proto.MotionState_MOTION_STATE_FLY, proto.MotionState_MOTION_STATE_FLY_FAST, proto.MotionState_MOTION_STATE_FLY_SLOW:
case proto.MotionState_MOTION_FLY, proto.MotionState_MOTION_FLY_FAST, proto.MotionState_MOTION_FLY_SLOW:
// 滑翔
s.CostStamina = constant.StaminaCostConst.FLY
case proto.MotionState_MOTION_STATE_SWIM_DASH:
case proto.MotionState_MOTION_SWIM_DASH:
// 快速游泳
s.CostStamina = constant.StaminaCostConst.SWIM_DASH
case proto.MotionState_MOTION_STATE_SKIFF_DASH:
case proto.MotionState_MOTION_SKIFF_DASH:
// 浪船加速
s.CostStamina = constant.StaminaCostConst.SKIFF_DASH
// 恢复耐力
case proto.MotionState_MOTION_STATE_DANGER_RUN, proto.MotionState_MOTION_STATE_RUN:
case proto.MotionState_MOTION_DANGER_RUN, proto.MotionState_MOTION_RUN:
// 正常跑步
s.CostStamina = constant.StaminaCostConst.RUN
case proto.MotionState_MOTION_STATE_DANGER_STANDBY_MOVE, proto.MotionState_MOTION_STATE_DANGER_STANDBY, proto.MotionState_MOTION_STATE_LADDER_TO_STANDBY, proto.MotionState_MOTION_STATE_STANDBY_MOVE, proto.MotionState_MOTION_STATE_STANDBY:
case proto.MotionState_MOTION_DANGER_STANDBY_MOVE, proto.MotionState_MOTION_DANGER_STANDBY, proto.MotionState_MOTION_LADDER_TO_STANDBY, proto.MotionState_MOTION_STANDBY_MOVE, proto.MotionState_MOTION_STANDBY:
// 站立
s.CostStamina = constant.StaminaCostConst.STANDBY
case proto.MotionState_MOTION_STATE_DANGER_WALK, proto.MotionState_MOTION_STATE_WALK:
case proto.MotionState_MOTION_DANGER_WALK, proto.MotionState_MOTION_WALK:
// 走路
s.CostStamina = constant.StaminaCostConst.WALK
case proto.MotionState_MOTION_STATE_SKIFF_BOARDING, proto.MotionState_MOTION_STATE_SKIFF_NORMAL:
case proto.MotionState_MOTION_SKIFF_BOARDING, proto.MotionState_MOTION_SKIFF_NORMAL:
// 浪船正常移动或停下
s.CostStamina = constant.StaminaCostConst.SKIFF_NORMAL
case proto.MotionState_MOTION_STATE_POWERED_FLY:
case proto.MotionState_MOTION_POWERED_FLY:
// 滑翔加速 (风圈等)
s.CostStamina = constant.StaminaCostConst.POWERED_FLY
case proto.MotionState_MOTION_STATE_SKIFF_POWERED_DASH:
case proto.MotionState_MOTION_SKIFF_POWERED_DASH:
// 浪船加速 (风圈等)
s.CostStamina = constant.StaminaCostConst.POWERED_SKIFF
// 缓慢动作将在客户端发送消息后消耗
case proto.MotionState_MOTION_STATE_CLIMB, proto.MotionState_MOTION_STATE_SWIM_MOVE:
case proto.MotionState_MOTION_CLIMB, proto.MotionState_MOTION_SWIM_MOVE:
// 缓慢攀爬 或 缓慢游泳
s.CostStamina = 0
}