app

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C_max_session_count    = 10000
	C_heart_beat_timeout   = 20 * 60 * 1000 //millisecond
	C_session_timeout      = 2 * 60
	C_session_timeout_tick = 10
)
View Source
const (
	SessionState_None = iota
	SessionState_Authenticating
	SessionState_LoggedIn
)
View Source
const (
	// center
	C_tabname_svrlist  = "svrlist"
	C_tabname_userinfo = "userinfo"
	C_tabname_names    = "names"
)
View Source
const (
	C_player_name_maxlen = 18
)

Variables

View Source
var NetMgr = &netmgr_t{
	sessions: make(map[uint64]*Session),
	connectq: tcp.NewConnectQ(),
}

Functions

func C_Login

func C_Login(message MPB.Message, ctx interface{})

func C_Reconnect

func C_Reconnect(message MPB.Message, ctx interface{})

func Center_GetServerMergeName added in v1.1.1

func Center_GetServerMergeName(svr0 string) string

func Center_GetServerUserLimit added in v1.1.1

func Center_GetServerUserLimit(svr0 string) int32

func DatabaseOpen added in v1.1.1

func DatabaseOpen()

func GS_Kick

func GS_Kick(message MPB.Message, ctx interface{})

func InitSession

func InitSession()

func SetDefaults added in v1.1.1

func SetDefaults(input interface{})

Types

type Handlers added in v1.1.1

type Handlers struct{}

func (*Handlers) ActCalendarChange added in v1.1.1

func (e *Handlers) ActCalendarChange(ctx context.Context, in *MPB.GS_ActCalendarChange, out *MPB.Response) error

func (*Handlers) ActConfChange added in v1.1.1

func (e *Handlers) ActConfChange(ctx context.Context, in *MPB.GS_ActConfChange, out *MPB.Response) error

func (*Handlers) ActStageChange added in v1.1.1

func (e *Handlers) ActStageChange(ctx context.Context, in *MPB.GS_ActStageChange, out *MPB.Response) error

func (*Handlers) GetRank added in v1.1.1

func (e *Handlers) GetRank(ctx context.Context, in *MPB.C_GetRank, out *MPB.GS_GetRank_R) error

func (*Handlers) MailChange added in v1.1.1

func (e *Handlers) MailChange(ctx context.Context, in *MPB.GS_MailChange, out *MPB.Response) error

func (*Handlers) MailDel added in v1.1.1

func (e *Handlers) MailDel(ctx context.Context, in *MPB.GS_MailDel, out *MPB.Response) error

func (*Handlers) MailNew added in v1.1.1

func (e *Handlers) MailNew(ctx context.Context, in *MPB.GS_MailNew, out *MPB.Response) error

type Rc4

type Rc4 rc4.Cipher

func NewRc4

func NewRc4() *Rc4

func (*Rc4) Decrypt

func (self *Rc4) Decrypt(dst, src []byte)

func (*Rc4) Encrypt

func (self *Rc4) Encrypt(dst, src []byte)

type Session

type Session struct {
	// contains filtered or unexported fields
}

func (*Session) BeginAuth

func (self *Session) BeginAuth() bool

func (*Session) Close

func (self *Session) Close()

func (*Session) Dispatch

func (self *Session) Dispatch(p packet.Packet)

func (*Session) EndAuth

func (self *Session) EndAuth()

func (*Session) GetIP

func (self *Session) GetIP() string

func (*Session) GetId

func (self *Session) GetId() uint64

func (*Session) LoginPlayer

func (self *Session) LoginPlayer(m *MPB.GW_UserOnline)

func (*Session) LogoutPlayer

func (self *Session) LogoutPlayer()

func (*Session) ReconnectPlayer

func (self *Session) ReconnectPlayer(old uint64, m *MPB.GW_UserReconnect) MPB.RetType

func (*Session) SendMsg

func (self *Session) SendMsg(message MPB.Message)

func (*Session) SendPacket

func (self *Session) SendPacket(p packet.Packet)

func (*Session) SetForceRemove

func (self *Session) SetForceRemove()

type UserInfo added in v1.1.1

type UserInfo struct {
	UserId   uint64    `bson:"_id"`
	AuthId   string    `bson:"authid"`
	Svr0     string    `bson:"svr0"`
	Svr      string    `bson:"svr"`
	Sdk      string    `bson:"sdk"`
	Plat     string    `bson:"plat"`
	DevId    string    `bson:"devid"`
	IP       string    `bson:"ip"`
	CreateTs time.Time `bson:"cts"`
	BanTs    time.Time `bson:"ban_ts"`
	Name     string    `bson:"name"`
	Lv       int32     `bson:"lv"`
	Vip      int32     `bson:"vip"`
	Tutorial int32     `bson:"tut"`
}

func Center_GetUserInfo added in v1.1.1

func Center_GetUserInfo(auth_id string, sdk string, svr0 string, on_create func(*UserInfo)) (*UserInfo, bool)

func Center_GetUserInfoById added in v1.1.1

func Center_GetUserInfoById(user_id uint64) *UserInfo

Jump to

Keyboard shortcuts

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