mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 16:02:26 +08:00
完善了protobuf协议文件
This commit is contained in:
@@ -21,7 +21,7 @@ func (g *GameManager) SceneTransToPointReq(player *model.Player, payloadMsg pb.M
|
||||
transPointConfig, exist := gdc.CONF.ScenePointEntries[transPointId]
|
||||
if !exist {
|
||||
sceneTransToPointRsp := &proto.SceneTransToPointRsp{
|
||||
Retcode: int32(proto.Retcode_RETCODE_RET_SVR_ERROR),
|
||||
Retcode: int32(proto.Retcode_RET_SVR_ERROR),
|
||||
}
|
||||
g.SendMsg(cmd.SceneTransToPointRsp, player.PlayerID, player.ClientSeq, sceneTransToPointRsp)
|
||||
return
|
||||
|
||||
@@ -62,9 +62,9 @@ func (g *GameManager) PlayerGetForceQuitBanInfoReq(player *model.Player, payload
|
||||
|
||||
playerGetForceQuitBanInfoRsp := new(proto.PlayerGetForceQuitBanInfoRsp)
|
||||
if result {
|
||||
playerGetForceQuitBanInfoRsp.Retcode = int32(proto.Retcode_RETCODE_RET_SUCC)
|
||||
playerGetForceQuitBanInfoRsp.Retcode = int32(proto.Retcode_RET_SUCC)
|
||||
} else {
|
||||
playerGetForceQuitBanInfoRsp.Retcode = int32(proto.Retcode_RETCODE_RET_MP_TARGET_PLAYER_IN_TRANSFER)
|
||||
playerGetForceQuitBanInfoRsp.Retcode = int32(proto.Retcode_RET_MP_TARGET_PLAYER_IN_TRANSFER)
|
||||
}
|
||||
g.SendMsg(cmd.PlayerGetForceQuitBanInfoRsp, player.PlayerID, player.ClientSeq, playerGetForceQuitBanInfoRsp)
|
||||
}
|
||||
@@ -76,9 +76,9 @@ func (g *GameManager) BackMyWorldReq(player *model.Player, payloadMsg pb.Message
|
||||
|
||||
backMyWorldRsp := new(proto.BackMyWorldRsp)
|
||||
if ok {
|
||||
backMyWorldRsp.Retcode = int32(proto.Retcode_RETCODE_RET_SUCC)
|
||||
backMyWorldRsp.Retcode = int32(proto.Retcode_RET_SUCC)
|
||||
} else {
|
||||
backMyWorldRsp.Retcode = int32(proto.Retcode_RETCODE_RET_MP_TARGET_PLAYER_IN_TRANSFER)
|
||||
backMyWorldRsp.Retcode = int32(proto.Retcode_RET_MP_TARGET_PLAYER_IN_TRANSFER)
|
||||
}
|
||||
g.SendMsg(cmd.BackMyWorldRsp, player.PlayerID, player.ClientSeq, backMyWorldRsp)
|
||||
}
|
||||
@@ -90,9 +90,9 @@ func (g *GameManager) ChangeWorldToSingleModeReq(player *model.Player, payloadMs
|
||||
|
||||
changeWorldToSingleModeRsp := new(proto.ChangeWorldToSingleModeRsp)
|
||||
if ok {
|
||||
changeWorldToSingleModeRsp.Retcode = int32(proto.Retcode_RETCODE_RET_SUCC)
|
||||
changeWorldToSingleModeRsp.Retcode = int32(proto.Retcode_RET_SUCC)
|
||||
} else {
|
||||
changeWorldToSingleModeRsp.Retcode = int32(proto.Retcode_RETCODE_RET_MP_TARGET_PLAYER_IN_TRANSFER)
|
||||
changeWorldToSingleModeRsp.Retcode = int32(proto.Retcode_RET_MP_TARGET_PLAYER_IN_TRANSFER)
|
||||
}
|
||||
g.SendMsg(cmd.ChangeWorldToSingleModeRsp, player.PlayerID, player.ClientSeq, changeWorldToSingleModeRsp)
|
||||
}
|
||||
@@ -103,7 +103,7 @@ func (g *GameManager) SceneKickPlayerReq(player *model.Player, payloadMsg pb.Mes
|
||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||
if player.PlayerID != world.owner.PlayerID {
|
||||
sceneKickPlayerRsp := &proto.SceneKickPlayerRsp{
|
||||
Retcode: int32(proto.Retcode_RETCODE_RET_SVR_ERROR),
|
||||
Retcode: int32(proto.Retcode_RET_SVR_ERROR),
|
||||
}
|
||||
g.SendMsg(cmd.SceneKickPlayerRsp, player.PlayerID, player.ClientSeq, sceneKickPlayerRsp)
|
||||
return
|
||||
@@ -125,7 +125,7 @@ func (g *GameManager) SceneKickPlayerReq(player *model.Player, payloadMsg pb.Mes
|
||||
if ok {
|
||||
sceneKickPlayerRsp.TargetUid = targetUid
|
||||
} else {
|
||||
sceneKickPlayerRsp.Retcode = int32(proto.Retcode_RETCODE_RET_MP_TARGET_PLAYER_IN_TRANSFER)
|
||||
sceneKickPlayerRsp.Retcode = int32(proto.Retcode_RET_MP_TARGET_PLAYER_IN_TRANSFER)
|
||||
}
|
||||
g.SendMsg(cmd.SceneKickPlayerRsp, player.PlayerID, player.ClientSeq, sceneKickPlayerRsp)
|
||||
}
|
||||
@@ -141,7 +141,7 @@ func (g *GameManager) JoinPlayerSceneReq(player *model.Player, payloadMsg pb.Mes
|
||||
}
|
||||
|
||||
joinPlayerSceneRsp := new(proto.JoinPlayerSceneRsp)
|
||||
joinPlayerSceneRsp.Retcode = int32(proto.Retcode_RETCODE_RET_JOIN_OTHER_WAIT)
|
||||
joinPlayerSceneRsp.Retcode = int32(proto.Retcode_RET_JOIN_OTHER_WAIT)
|
||||
g.SendMsg(cmd.JoinPlayerSceneRsp, player.PlayerID, player.ClientSeq, joinPlayerSceneRsp)
|
||||
|
||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||
|
||||
@@ -40,7 +40,7 @@ func (g *GameManager) GetPlayerSocialDetailReq(player *model.Player, payloadMsg
|
||||
}
|
||||
getPlayerSocialDetailRsp.DetailData = socialDetail
|
||||
} else {
|
||||
getPlayerSocialDetailRsp.Retcode = int32(proto.Retcode_RETCODE_RET_PLAYER_NOT_EXIST)
|
||||
getPlayerSocialDetailRsp.Retcode = int32(proto.Retcode_RET_PLAYER_NOT_EXIST)
|
||||
}
|
||||
g.SendMsg(cmd.GetPlayerSocialDetailRsp, player.PlayerID, player.ClientSeq, getPlayerSocialDetailRsp)
|
||||
}
|
||||
@@ -80,9 +80,9 @@ func (g *GameManager) SetPlayerSignatureReq(player *model.Player, payloadMsg pb.
|
||||
|
||||
setPlayerSignatureRsp := new(proto.SetPlayerSignatureRsp)
|
||||
if !object.IsUtf8String(signature) {
|
||||
setPlayerSignatureRsp.Retcode = int32(proto.Retcode_RETCODE_RET_SIGNATURE_ILLEGAL)
|
||||
setPlayerSignatureRsp.Retcode = int32(proto.Retcode_RET_SIGNATURE_ILLEGAL)
|
||||
} else if utf8.RuneCountInString(signature) > 50 {
|
||||
setPlayerSignatureRsp.Retcode = int32(proto.Retcode_RETCODE_RET_SIGNATURE_ILLEGAL)
|
||||
setPlayerSignatureRsp.Retcode = int32(proto.Retcode_RET_SIGNATURE_ILLEGAL)
|
||||
} else {
|
||||
player.Signature = signature
|
||||
setPlayerSignatureRsp.Signature = player.Signature
|
||||
@@ -97,13 +97,13 @@ func (g *GameManager) SetPlayerNameReq(player *model.Player, payloadMsg pb.Messa
|
||||
|
||||
setPlayerNameRsp := new(proto.SetPlayerNameRsp)
|
||||
if len(nickName) == 0 {
|
||||
setPlayerNameRsp.Retcode = int32(proto.Retcode_RETCODE_RET_NICKNAME_IS_EMPTY)
|
||||
setPlayerNameRsp.Retcode = int32(proto.Retcode_RET_NICKNAME_IS_EMPTY)
|
||||
} else if !object.IsUtf8String(nickName) {
|
||||
setPlayerNameRsp.Retcode = int32(proto.Retcode_RETCODE_RET_NICKNAME_UTF8_ERROR)
|
||||
setPlayerNameRsp.Retcode = int32(proto.Retcode_RET_NICKNAME_UTF8_ERROR)
|
||||
} else if utf8.RuneCountInString(nickName) > 14 {
|
||||
setPlayerNameRsp.Retcode = int32(proto.Retcode_RETCODE_RET_NICKNAME_TOO_LONG)
|
||||
setPlayerNameRsp.Retcode = int32(proto.Retcode_RET_NICKNAME_TOO_LONG)
|
||||
} else if len(regexp.MustCompile(`\d`).FindAllString(nickName, -1)) > 6 {
|
||||
setPlayerNameRsp.Retcode = int32(proto.Retcode_RETCODE_RET_NICKNAME_TOO_MANY_DIGITS)
|
||||
setPlayerNameRsp.Retcode = int32(proto.Retcode_RET_NICKNAME_TOO_MANY_DIGITS)
|
||||
} else {
|
||||
player.NickName = nickName
|
||||
setPlayerNameRsp.NickName = player.NickName
|
||||
@@ -153,7 +153,7 @@ func (g *GameManager) GetPlayerFriendListReq(player *model.Player, payloadMsg pb
|
||||
if online {
|
||||
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_ONLINE
|
||||
} else {
|
||||
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_FREIEND_DISCONNECT
|
||||
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_DISCONNECT
|
||||
}
|
||||
friendPlayer := USER_MANAGER.LoadTempOfflineUserSync(uid)
|
||||
if friendPlayer == nil {
|
||||
@@ -193,7 +193,7 @@ func (g *GameManager) GetPlayerAskFriendListReq(player *model.Player, payloadMsg
|
||||
if online {
|
||||
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_ONLINE
|
||||
} else {
|
||||
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_FREIEND_DISCONNECT
|
||||
onlineState = proto.FriendOnlineState_FRIEND_ONLINE_STATE_DISCONNECT
|
||||
}
|
||||
friendPlayer := USER_MANAGER.LoadTempOfflineUserSync(uid)
|
||||
if friendPlayer == nil {
|
||||
|
||||
@@ -51,9 +51,9 @@ func (g *GameManager) SceneAvatarStaminaStepReq(player *model.Player, payloadMsg
|
||||
sceneAvatarStaminaStepRsp := new(proto.SceneAvatarStaminaStepRsp)
|
||||
// 角度超过范围返回值为错误
|
||||
if (req.Rot.X >= 0 && req.Rot.X < 90) || (req.Rot.X > 270 && req.Rot.X < 360) {
|
||||
sceneAvatarStaminaStepRsp.Retcode = int32(proto.Retcode_RETCODE_RET_SUCC)
|
||||
sceneAvatarStaminaStepRsp.Retcode = int32(proto.Retcode_RET_SUCC)
|
||||
} else {
|
||||
sceneAvatarStaminaStepRsp.Retcode = int32(proto.Retcode_RETCODE_RET_FAIL)
|
||||
sceneAvatarStaminaStepRsp.Retcode = int32(proto.Retcode_RET_FAIL)
|
||||
}
|
||||
sceneAvatarStaminaStepRsp.UseClientRot = true
|
||||
sceneAvatarStaminaStepRsp.Rot = req.Rot
|
||||
|
||||
@@ -67,7 +67,7 @@ func (g *GameManager) ChangeAvatarReq(player *model.Player, payloadMsg pb.Messag
|
||||
}
|
||||
|
||||
changeAvatarRsp := &proto.ChangeAvatarRsp{
|
||||
Retcode: int32(proto.Retcode_RETCODE_RET_SUCC),
|
||||
Retcode: int32(proto.Retcode_RET_SUCC),
|
||||
CurGuid: targetAvatarGuid,
|
||||
}
|
||||
g.SendMsg(cmd.ChangeAvatarRsp, player.PlayerID, player.ClientSeq, changeAvatarRsp)
|
||||
@@ -80,7 +80,7 @@ func (g *GameManager) SetUpAvatarTeamReq(player *model.Player, payloadMsg pb.Mes
|
||||
teamId := req.TeamId
|
||||
if teamId <= 0 || teamId >= 5 {
|
||||
setUpAvatarTeamRsp := &proto.SetUpAvatarTeamRsp{
|
||||
Retcode: int32(proto.Retcode_RETCODE_RET_SVR_ERROR),
|
||||
Retcode: int32(proto.Retcode_RET_SVR_ERROR),
|
||||
}
|
||||
g.SendMsg(cmd.SetUpAvatarTeamRsp, player.PlayerID, player.ClientSeq, setUpAvatarTeamRsp)
|
||||
return
|
||||
@@ -90,7 +90,7 @@ func (g *GameManager) SetUpAvatarTeamReq(player *model.Player, payloadMsg pb.Mes
|
||||
selfTeam := teamId == uint32(player.TeamConfig.GetActiveTeamId())
|
||||
if (selfTeam && len(avatarGuidList) == 0) || len(avatarGuidList) > 4 || world.multiplayer {
|
||||
setUpAvatarTeamRsp := &proto.SetUpAvatarTeamRsp{
|
||||
Retcode: int32(proto.Retcode_RETCODE_RET_SVR_ERROR),
|
||||
Retcode: int32(proto.Retcode_RET_SVR_ERROR),
|
||||
}
|
||||
g.SendMsg(cmd.SetUpAvatarTeamRsp, player.PlayerID, player.ClientSeq, setUpAvatarTeamRsp)
|
||||
return
|
||||
@@ -110,7 +110,7 @@ func (g *GameManager) SetUpAvatarTeamReq(player *model.Player, payloadMsg pb.Mes
|
||||
|
||||
if world.multiplayer {
|
||||
setUpAvatarTeamRsp := &proto.SetUpAvatarTeamRsp{
|
||||
Retcode: int32(proto.Retcode_RETCODE_RET_SVR_ERROR),
|
||||
Retcode: int32(proto.Retcode_RET_SVR_ERROR),
|
||||
}
|
||||
g.SendMsg(cmd.SetUpAvatarTeamRsp, player.PlayerID, player.ClientSeq, setUpAvatarTeamRsp)
|
||||
return
|
||||
@@ -209,7 +209,7 @@ func (g *GameManager) ChangeMpTeamAvatarReq(player *model.Player, payloadMsg pb.
|
||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||
if len(avatarGuidList) == 0 || len(avatarGuidList) > 4 || !world.multiplayer {
|
||||
changeMpTeamAvatarRsp := &proto.ChangeMpTeamAvatarRsp{
|
||||
Retcode: int32(proto.Retcode_RETCODE_RET_SVR_ERROR),
|
||||
Retcode: int32(proto.Retcode_RET_SVR_ERROR),
|
||||
}
|
||||
g.SendMsg(cmd.ChangeMpTeamAvatarRsp, player.PlayerID, player.ClientSeq, changeMpTeamAvatarRsp)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user