Documentation ¶
Index ¶
Constants ¶
View Source
const ( UNKNOWN = byte(iota) OFF_FREE OFF_RAID OFF_PROT ON_FREE ON_PROT )
------------------------------------------------ 状态机定义
View Source
const ( SESS_LOGGED_IN = 0x1 SESS_KICKED_OUT = 0x2 SESS_REGISTERED = 0x4 SESS_KEYEXCG = 0x8 SESS_ENCRYPT = 0x10 )
View Source
const (
SYS_USR = 0
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IPCObject ¶
type IPCObject struct { SrcID int32 // 发送方用户ID DestID int32 // 接收放用户ID AuxIDs []int32 `bson:",omitempty"` // 目标用户ID集合(用于组播) Service int16 // 服务号 Object []byte // 投递的 JSON STRING Time int64 // 发送时间 MarkDelete bool // 数据库标记删除 }
---------------------------------------------------------- IPCObject 定义
type Session ¶
type Session struct { IP net.IP MQ chan IPCObject // Player's Internal Message Queue Encoder *pike.Pike Decoder *pike.Pike // TODO: all user data structure User *User // session related LoggedIn bool // flag for weather the user is logged in KickOut bool // flag for player is kicked out // session flag Flag int32 // time related variables ConnectTime time.Time // tcp connection establish time, in millsecond(ms) PacketTime time.Time // last packet time LastPacketTime time.Time // last packet arrive time, in seconds(s) // packet rate control PacketCount int64 // count packets // contains filtered or unexported fields }
func (*Session) DirtyCount ¶
type User ¶
type User struct { Id int32 // 用户id Domain string // 玩家所在分服 Name string // 用户名 Flag int32 // 状态标记 Pass []byte // 密码(MD5 Hash) Score int32 // 分数 ProtectTimeout int64 // 护盾截止时间 Mac string // 玩家MAC地址 CountryCode string // 国家代码 Language string // 界面语言 DeviceType string // 设备类型 LastSaveTime int64 // 服务器最后一次刷入数据库的时间 CreatedAt int64 // 注册时间 }
Click to show internal directories.
Click to hide internal directories.