package sessions import ( cproto "github.com/cherry-game/cherry/net/proto" ) // 根据session对象获取以下值 const ( UID = "uid" // int64 uid SID = "sid" // string sid AgentPath = "agent_path" // agent path GameNodeID = "game_node_id" // int32 游戏服务器ID OpenID = "open_id" // string 第三方登录sdk的用户唯一标识 PID = "pid" // int32 sdk安装包id PlayerID = "player_id" // int64 玩家id IsNewPlayer = "is_new_player" // bool 是否为新玩家 LeagueID = "league_id" // int64 联盟ID Language = "language" // string 语言 MapNodeID = "map_node_id" // string 地图节点ID IsOnline = "is_online" // bool 是否在线 ) func GetGameNodeID(session *cproto.Session) string { return session.GetString(GameNodeID) } func GetOpenID(session *cproto.Session) string { return session.GetString(OpenID) } func GetPID(session *cproto.Session) int32 { return session.GetInt32(PID) } func GetPlayerID(session *cproto.Session) int64 { return session.GetInt64(PlayerID) } func GetPlayerIDValue(session *cproto.Session) string { return session.GetString(PlayerID) } func GetLeagueID(session *cproto.Session) int64 { return session.GetInt64(LeagueID) } func GetMapNodeID(session *cproto.Session) string { return session.GetString(MapNodeID) }