lib

package
v0.0.0-...-0e6f1c7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TAB_FILE_ITEM        = "item.json"
	TAB_FILE_GAME_CONFIG = "game_config.json"
)

TABLE_FILE_NAME

View Source
const (
	MESSAGE_LEN = ss.MAX_SS_MSG_SIZE //200k
)

Variables

This section is empty.

Functions

func AfterReLoadConfig

func AfterReLoadConfig(pconfig *Config, old_config *FileConfig, new_config *FileConfig)

After ReLoad Config If Need Handle

func CheckClientTimeout

func CheckClientTimeout(arg interface{})

check client timeout without heartbeat

func CommSet

func CommSet(pconfig *Config) bool

Comm Config Setting

func DirecToConnect

func DirecToConnect(pconfig *Config, proto_id ss.SS_PROTO_TYPE, from int, msg []byte)

func DirecToDb

func DirecToDb(pconfig *Config, proto_id ss.SS_PROTO_TYPE, from int, msg []byte)

func HandleReportCmd

func HandleReportCmd(pconfig *Config, pmsg *comm.ReportMsg)

func InitUserDepot

func InitUserDepot(pconfig *Config, pdepot *ss.UserDepot, uid int64)

func InitUserInfo

func InitUserInfo(pconfig *Config, pinfo *ss.UserInfo, uid int64)

func LocalSet

func LocalSet(pconfig *Config) bool

Local Proc Setting

func RecvDispMsg

func RecvDispMsg(pconfig *Config, pdisp *ss.MsgDisp)

func RecvDupUserKick

func RecvDupUserKick(pconfig *Config, pmsg *ss.MsgDispKickDupUser, from int)

recv kickout from other logic-serv

func RecvHeartBeatReq

func RecvHeartBeatReq(pconfig *Config, preq *ss.MsgHeartBeatReq, from int)

func RecvLoginReq

func RecvLoginReq(pconfig *Config, preq *ss.MsgLoginReq, msg []byte, from int)

func RecvLoginRsp

func RecvLoginRsp(pconfig *Config, prsp *ss.MsgLoginRsp, msg []byte)

func RecvLogoutReq

func RecvLogoutReq(pconfig *Config, plogout *ss.MsgLogoutReq)

func RecvMsg

func RecvMsg(pconfig *Config) int64

func RecvPingReq

func RecvPingReq(pconfig *Config, preq *ss.MsgPingReq, from int)

func RecvReportCmd

func RecvReportCmd(arg interface{})

func RegistTableMap

func RegistTableMap(pconfig *Config) bool

func ReportSyncServer

func ReportSyncServer(arg interface{})

func SaveRolesOnExit

func SaveRolesOnExit(pconfig *Config)

func SendDupUserKick

func SendDupUserKick(pconfig *Config, prsp *ss.MsgLoginRsp)

func SendHeartBeatMsg

func SendHeartBeatMsg(arg interface{})

func SendLogoutRsp

func SendLogoutRsp(pconfig *Config, uid int64, reason ss.USER_LOGOUT_REASON, msg string)

send logout rsp to connect

func SendToConnect

func SendToConnect(pconfig *Config, v interface{}) bool

send to connect server

func SendToDb

func SendToDb(pconfig *Config, v interface{}) bool

send to db server

func SendToDisp

func SendToDisp(pconfig *Config, hash_v int64, buff []byte) bool

send to disp hash if hash_v>0 use hash first; or use rand method

func SendToServ

func SendToServ(pconfig *Config, target_serv int, v interface{}) bool

@v only support []byte and *ss.SSMsg

func ServerExit

func ServerExit(pconfig *Config)

func ServerStart

func ServerStart(pconfig *Config)

Main Proc

func UserLogout

func UserLogout(pconfig *Config, uid int64, reason ss.USER_LOGOUT_REASON)

Types

type Config

type Config struct {
	//comm
	NameSpace      string
	ProcId         int
	ProcName       string
	ConfigFile     string
	Daemon         bool
	FileConfig     *FileConfig
	Comm           *comm.CommConfig
	ReportCmd      string //used for report cmd
	ReportCmdToken int64
	ReportServ     *comm.ReportServ //report to manger
	//local
	NetLog   llog.NetLog
	TableMap comm.TableMap
	Users    *OnLineList
}

type FileConfig

type FileConfig struct {
	//	ProcName string `json:"proc_name"`
	ConnServ      int      `json:"conn_serv"`
	DispServList  []int    `json:"disp_serv_list"`
	DbServ        int      `json:"db_serv"`
	LogFile       string   `json:"log_file"`
	ManageAddr    []string `json:"manage_addr"`
	NetLogAddr    []string `json:"net_log_addr"`   //net log recver addr list
	NetLogMethod  int      `json:"net_log_method"` //refer NETLOG_METHOD_XX
	MaxOnline     int      `json:"max_online"`
	ClientTimeout int      `json:"client_timeout"`
	MonitorInv    int      `json:"monitor_inv"` //monitor interval seconds
}

type Msg

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

type OnLineList

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

type UserOnLine

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

func GetUserInfo

func GetUserInfo(pconfig *Config, uid int64) *UserOnLine

Get UserOnLine Info by Uid

Jump to

Keyboard shortcuts

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