misc

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientHeartBeatInterval = 5 * time.Second
	ClientExpiryThreshold   = 6 * ClientHeartBeatInterval //10 * ClientHeartBeatInterval
	MaxTransNumber          = 10000
	MainSvrTickInterval     = 100 * time.Millisecond
	MaxOrmLruCacheLimitNum  = 100
)
View Source
const (
	ServerType_ConnSvr       = 1  // 网关,连接服
	ServerType_MainSvr       = 2  // 主逻辑服,玩家的大部分单机逻辑都在这里
	ServerType_InfoSvr       = 3  // 获取玩家简要信息的服,玩家数据分三个层级:1 RoleInfo(玩家详细数据)2.BriefInfo(玩家简要信息,客户端查看别人数据的时候拉取) 3.IconDesc (展示玩家头像需要的数据)
	ServerType_MysqlSvr      = 4  // 读写mysql,orm
	ServerType_GmSvr         = 5  // 类似于wsConn,提供http restApi接口,GM工具与运营系统连接这个Connsvr
	ServerType_MailSvr       = 6  // 邮件服
	ServerType_ChatSvr       = 7  // 聊天服
	ServerType_FriendSvr     = 8  // 好友服
	ServerType_RankSvr       = 9  // 排行榜
	ServerType_GuildSvr      = 10 // 公会(俱乐部)
	ServerType_RoomCenterSvr = 11 // 房间中心服
	ServerType_WebSvr        = 12 // web服,提供http restApi接口,供web端使用

	//----- 游戏玩法服务 start-----
	ServerType_TexasGameSvr = 0x50 // porker 德州游戏服
	ServerType_RummyGameSvr = 0x51 // porker 拉米牌游戏服

)

Variables

各种类型svr的路由规则配置

Functions

func GetIconDescFromRoleBrief

func GetIconDescFromRoleBrief(brief *g1protocol.PbRoleBriefInfo) *g1protocol.PbIconDesc

func GetRoleIconDesc

func GetRoleIconDesc(role *g1protocol.RoleInfo) (iconDesc *g1protocol.PbIconDesc)

func IsClientCmd

func IsClientCmd(cmd uint32) bool

判断命令字时候是客户端发来

func IsGmCmd

func IsGmCmd(cmd uint32) bool

判断命令字是否是GM命令

func IsInnerCmd

func IsInnerCmd(cmd uint32) bool

判断命令字是否为内部命令

func IsRobot

func IsRobot(uid uint64) bool

func MsgTypeInCmd

func MsgTypeInCmd(cmd uint32) uint32

从命令字中获取命令字类型

func ServerTypeInCmd

func ServerTypeInCmd(cmd uint32) uint32

从命令字中获取目标svr

func SplitItemFromArray

func SplitItemFromArray(a []int32) *[]*g1protocol.PbItem

这里一般是一个id,接一个数量

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL