face

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMatchSystem

type IMatchSystem interface {
	Init()
	EnterMatchQueue(session ISession)
	QuitMatchQueue(session ISession)
	UpdateMatchQueue(message *pb.PbMessage, session ISession)
}

type IMessageHandle

type IMessageHandle interface {
	Init()
	Response(session ISession, message *pb.PbMessage)
}

type IRequest

type IRequest interface {
	GetMessage() []byte
	GetSession() ISession
}

判断此时玩家在对局里还是在大厅里

type IRoom

type IRoom interface {
	Init()
	Delete()
	Broadcast(data []byte)

	ChangeRoomState(newState int)
	ChangePlayersRoomId()
	// GetState() IRoomState
	GetCurrentState() IRoomState
	GetPlayerIndex(session ISession) int
	SetSelectData(selectArr []int)
	GetSelectData() []int

	GetRoomPlayerCount() int
	GetRoomId() uint32
}

type IRoomState

type IRoomState interface {
	Enter()
	Exit()
	Update(session ISession, mes *pb.PbMessage)
}

type IServer

type IServer interface {
	Start()
	Stop()
	Serve()

	GetRoom(roomId uint32) IRoom
	AddRoom(roomId uint32, room IRoom)
	RemoveRoom(roomId uint32)

	GetSession(sid uint32) ISession
	AddSession(conn *kcp.UDPSession)
	RemoveSession(sid uint32)

	HandleMessage(request IRequest)
	SendMessageToClient(sid uint32, data []byte)

	GetMatchSystem() IMatchSystem

	GetAllPlayer() map[uint32]ISession
}

type ISession

type ISession interface {
	Start()
	Stop()
	GetConnection() net.Conn
	GetSid() uint32
	ChangeRoomId(roomId uint32)
	GetCurrentRoomId() uint32

	GetRemoteAddress() string
	SendMessage(data []byte)
}

type ISingletonItem

type ISingletonItem interface {
	Init()
}

type ITest

type ITest interface {
	Test()
	Print()
}

type IWorkerPool

type IWorkerPool interface {
	Init()
	DoMessageHandler(request IRequest) //处理该信息
	StartWorkerPool()                  //启动工作池
	AddToTaskQueue(request IRequest)   //将消息添加到 某个工作池队列

}

判断此时玩家在对局里还是在大厅里

Jump to

Keyboard shortcuts

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