ifc

package
v0.0.0-...-eba1a7b Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Created by xuzhuoxi on 2019-03-23. @author xuzhuoxi

Created by xuzhuoxi on 2019-04-02. @author xuzhuoxi

Created by xuzhuoxi on 2019-02-18. @author xuzhuoxi

Created by xuzhuoxi on 2019-02-19. @author xuzhuoxi

Index

Constants

View Source
const (
	//通知Route间隔(默认60秒)
	GameNotifyRouteInterval = time.Second * 60
	//统计时间区间
	DefaultStatsInterval = int64(5 * time.Minute)
)

Variables

View Source
var (
	AddressProxy     = netx.NewIAddressProxy()            //uid与address的交叉映射,整个game模块共享
	DataBlockHandler = bytex.NewDefaultDataBlockHandler() //数据封包处理
)
View Source
var (
	// block(带长度的[]byte) -> []byte
	PoolBuffToData = bytex.NewPoolBuffToData()
	// []byte -> block(带长度的[]byte)
	PoolBuffToBlock = bytex.NewPoolBuffToBlock()
	// Gob序列化与反序列化
	// 暂时用于通知Route的对象序列化与反序列
	PoolBuffEncoder = lang.NewObjectPoolSync()
	PoolBuffDecoder = lang.NewObjectPoolSync()
	// Json序列化与反序列化
	// 暂时用于Extension的对象序列化与反序列化
	PoolJsonCodingHandler = lang.NewObjectPoolSync()
	// 用于记录日志:Extension响应时间
	LoggerExtension = logx.NewLogger()
)

Functions

func ForeachExtensionConstructor

func ForeachExtensionConstructor(eachFunc func(constructor GameExtensionConstructor))

func HandleBuffDecodeFromPool

func HandleBuffDecodeFromPool(handler func(encodingx.IBuffDecoder))

func HandleBuffEncodeFromPool

func HandleBuffEncodeFromPool(handler func(encodingx.IBuffEncoder))

func HandleBuffToBlockFromPool

func HandleBuffToBlockFromPool(handler func(bytex.IBuffToBlock))

func HandleBuffToDataFromPool

func HandleBuffToDataFromPool(handler func(bytex.IBuffToData))

func HandleJsonCodingFromPool

func HandleJsonCodingFromPool(handler func(codingHandler encodingx.ICodingHandler))

func RegisterExtension

func RegisterExtension(constructor GameExtensionConstructor)

Types

type GameExtensionConstructor

type GameExtensionConstructor func() IGameExtension

type IGameExtension

type IGameExtension interface {
	protox.IProtocolExtension
	IGameSingleCaseSetter
}

type IGameExtensionContainer

type IGameExtensionContainer = protox.IProtocolExtensionContainer

func NewGameExtensionContainer

func NewGameExtensionContainer() IGameExtensionContainer

type IGameSingleCase

type IGameSingleCase interface {
	logx.ILoggerGetter
	logx.ILoggerSetter

	Init()
}

type IGameSingleCaseSetter

type IGameSingleCaseSetter interface {
	SetSingleCase(singleCase IGameSingleCase)
}

type ILoginServer

type ILoginServer interface {
	//登录
	Login()
	//登出
	Logout()
}

type IServerSockState

type IServerSockState interface {
	//服务器运行时间(秒)
	GetPassSecond() int64
	//服务器详细状态
	GetSockStateDetail() imodule.ISockStateDetail
	//服务器简单状态
	GetSockState() imodule.SockState
}

Jump to

Keyboard shortcuts

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