Documentation
¶
Overview ¶
common.go
Index ¶
Constants ¶
View Source
const ( // tick milliseconds TickInterval = int64(100) // queue service channel capacity QueueCapacity = int(10000) // check interval to broadcast position in queue. in seconds QueueCheckInterval = int64(2) )
QueueService const config
View Source
const ( // Listen port Port = ":9001" // simulate validate token sleep time in milliseconds ValidateTokenSleep = int64(100) )
TcpServer const
View Source
const ( // max online player count MaxOnline int32 = 20000 )
======================================================================= constant config start you can modify these const ======================================================================= PlayerManager const config
Variables ¶
This section is empty.
Functions ¶
func GetNowTimeMilli ¶
func GetNowTimeMilli() int64
----------------------------------------------------------- utils
func PlayerManagerIns ¶
func PlayerManagerIns() *playerManager
Types ¶
type MsgWrap ¶
type MsgWrap struct {
// contains filtered or unexported fields
}
func NewMsgWrap ¶
func NewMsgWrap(session *Session, data proto.ProtoMessage) *MsgWrap
func (*MsgWrap) Data ¶
func (m *MsgWrap) Data() proto.ProtoMessage
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
----------------------------------------------------------- just a sample
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(conn net.Conn, obj interface{}, rw *bufio.ReadWriter) *Session
func (*Session) ReaderWriter ¶
func (s *Session) ReaderWriter() *bufio.ReadWriter
Click to show internal directories.
Click to hide internal directories.