Documentation
¶
Index ¶
- Constants
- func AfterReLoadConfig(pconfig *Config, old_config *FileConfig, new_config *FileConfig)
- func CheckClientTimeout(arg interface{})
- func CommSet(pconfig *Config) bool
- func DirecToConnect(pconfig *Config, proto_id ss.SS_PROTO_TYPE, from int, msg []byte)
- func DirecToDb(pconfig *Config, proto_id ss.SS_PROTO_TYPE, from int, msg []byte)
- func HandleReportCmd(pconfig *Config, pmsg *comm.ReportMsg)
- func InitUserDepot(pconfig *Config, pdepot *ss.UserDepot, uid int64)
- func InitUserInfo(pconfig *Config, pinfo *ss.UserInfo, uid int64)
- func LocalSet(pconfig *Config) bool
- func RecvDispMsg(pconfig *Config, pdisp *ss.MsgDisp)
- func RecvDupUserKick(pconfig *Config, pmsg *ss.MsgDispKickDupUser, from int)
- func RecvHeartBeatReq(pconfig *Config, preq *ss.MsgHeartBeatReq, from int)
- func RecvLoginReq(pconfig *Config, preq *ss.MsgLoginReq, msg []byte, from int)
- func RecvLoginRsp(pconfig *Config, prsp *ss.MsgLoginRsp, msg []byte)
- func RecvLogoutReq(pconfig *Config, plogout *ss.MsgLogoutReq)
- func RecvMsg(pconfig *Config) int64
- func RecvPingReq(pconfig *Config, preq *ss.MsgPingReq, from int)
- func RecvReportCmd(arg interface{})
- func RegistTableMap(pconfig *Config) bool
- func ReportSyncServer(arg interface{})
- func SaveRolesOnExit(pconfig *Config)
- func SendDupUserKick(pconfig *Config, prsp *ss.MsgLoginRsp)
- func SendHeartBeatMsg(arg interface{})
- func SendLogoutRsp(pconfig *Config, uid int64, reason ss.USER_LOGOUT_REASON, msg string)
- func SendToConnect(pconfig *Config, v interface{}) bool
- func SendToDb(pconfig *Config, v interface{}) bool
- func SendToDisp(pconfig *Config, hash_v int64, buff []byte) bool
- func SendToServ(pconfig *Config, target_serv int, v interface{}) bool
- func ServerExit(pconfig *Config)
- func ServerStart(pconfig *Config)
- func UserLogout(pconfig *Config, uid int64, reason ss.USER_LOGOUT_REASON)
- type Config
- type FileConfig
- type Msg
- type OnLineList
- type UserOnLine
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 DirecToConnect ¶
func DirecToConnect(pconfig *Config, proto_id ss.SS_PROTO_TYPE, from int, msg []byte)
func HandleReportCmd ¶
func RecvDispMsg ¶
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 RecvPingReq ¶
func RecvPingReq(pconfig *Config, preq *ss.MsgPingReq, from int)
func RecvReportCmd ¶
func RecvReportCmd(arg interface{})
func RegistTableMap ¶
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 SendToDisp ¶
send to disp hash if hash_v>0 use hash first; or use rand method
func SendToServ ¶
@v only support []byte and *ss.SSMsg
func ServerExit ¶
func ServerExit(pconfig *Config)
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 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
Click to show internal directories.
Click to hide internal directories.