face

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 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 IConnection

type IConnection interface {
	AddSession(conn *kcp.UDPSession)
	DeleteSession(sid uint32)
	GetSession(sid uint32) ISession
	GenerateUniqueSessionID() uint32
	AddRoom(room IRoom)
	DeleteRoom(roomId uint32)
	GetRoom(roomId uint32) IRoom
}

type IMatchSystem

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

type IMessageHandle

type IMessageHandle[T any] interface {
	Response(session ISession, message *pb.PbMessage, data T)
}

type IRequest

type IRequest interface {
	GetMessage() []byte
	GetSid() uint32
	GetSession() ISession
	GetRoom() IRoom
}

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

type IRoom

type IRoom interface {
	Start()
	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()
	ListenUDP()
	ListenKCP()
}

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 {
	DoMessageHandler(request IRequest) //处理该信息
	Start()                            //启动工作池
	AddToTaskQueue(request IRequest)   //将消息添加到 某个工作池队列

}

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

Jump to

Keyboard shortcuts

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