gate

package
v0.0.0-...-2995741 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LoginAccountResponse = proto.MessageName(&message.LoginAccountResponse{})
	SelectPlayerResponse = proto.MessageName(&message.SelectPlayerResponse{})
)
View Source
var (
	CONF   Config
	SERVER ServerMgr
)

Functions

func DispatchPacket

func DispatchPacket(packet rpc.Packet) bool

func IsCheckClient

func IsCheckClient(msg string) bool

func SendToClient

func SendToClient(socketId uint32, packet proto.Message)

Types

type Config

type Config struct {
	common.Server `yaml:"gate"`
	common.Etcd   `yaml:"etcd"`
	common.Nats   `yaml:"nats"`
	common.Raft   `yaml:"raft"`
	common.Stub   `yaml:"stub"`
}

type EventProcess

type EventProcess struct {
	actor.Actor
}

func (*EventProcess) G_Player_Login

func (e *EventProcess) G_Player_Login(ctx context.Context, socketId uint32, mailbox rpc.MailBox)

func (*EventProcess) Init

func (e *EventProcess) Init()

type IEventProcess

type IEventProcess interface {
	actor.IActor
}

type IPlayerMgr

type IPlayerMgr interface {
	actor.IActor
	AddPlayerMap(uint32, rpc.MailBox) int
	ReleaseSocketMap(uint32, bool)
	GetSocket(int64) uint32
	GetPlayerId(uint32) int64
	GetPlayer(uint32) *Player
}

type IServerMgr

type IServerMgr interface {
	Init() bool
	GetServer() *network.ServerSocket
	GetCluster() *cluster.Cluster
	GetPlayerMgr() *PlayerMgr
	OnServerStart()
}

type IUserProcess

type IUserProcess interface {
	actor.IActor

	CheckClientEx(uint32, string, rpc.RpcHead) bool
	CheckClient(uint32, string, rpc.RpcHead) *Player
	SwitchSendToGame(uint32, string, rpc.RpcHead, []byte)
	SwitchSendToZone(uint32, string, rpc.RpcHead, []byte)
	// contains filtered or unexported methods
}

type Player

type Player struct {
	PlayerId   int64
	LastTime   int64
	SocketId   uint32
	GClusterId uint32
	ZClusterId uint32
}

func NewPlayer

func NewPlayer(socketId uint32, playerId int64) *Player

type PlayerMgr

type PlayerMgr struct {
	actor.Actor
	// contains filtered or unexported fields
}

func (*PlayerMgr) ADD_ACCOUNT

func (p *PlayerMgr) ADD_ACCOUNT(ctx context.Context, socketId uint32, mailbox rpc.MailBox)

func (*PlayerMgr) AddPlayerMap

func (p *PlayerMgr) AddPlayerMap(socketId uint32, mailbox rpc.MailBox) int

func (*PlayerMgr) DEL_ACCOUNT

func (p *PlayerMgr) DEL_ACCOUNT(ctx context.Context, socketid uint32)

func (*PlayerMgr) GetPlayer

func (p *PlayerMgr) GetPlayer(socketId uint32) *Player

func (*PlayerMgr) GetPlayerId

func (p *PlayerMgr) GetPlayerId(socketId uint32) int64

func (*PlayerMgr) GetSocket

func (p *PlayerMgr) GetSocket(playerId int64) uint32

func (*PlayerMgr) Init

func (p *PlayerMgr) Init()

func (*PlayerMgr) ReleaseSocketMap

func (p *PlayerMgr) ReleaseSocketMap(socketId uint32, bClose bool)

type ServerMgr

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

func (*ServerMgr) GetCluster

func (s *ServerMgr) GetCluster() *cluster.Cluster

func (*ServerMgr) GetPlayerMgr

func (s *ServerMgr) GetPlayerMgr() *PlayerMgr

func (*ServerMgr) GetServer

func (s *ServerMgr) GetServer() *network.ServerSocket

func (*ServerMgr) Init

func (s *ServerMgr) Init() bool

func (*ServerMgr) OnServerStart

func (s *ServerMgr) OnServerStart()

type UserProcess

type UserProcess struct {
	actor.Actor
	// contains filtered or unexported fields
}

func (*UserProcess) CheckClient

func (u *UserProcess) CheckClient(sockId uint32, packetName string, head rpc.RpcHead) *Player

func (*UserProcess) CheckClientEx

func (u *UserProcess) CheckClientEx(sockId uint32, packetName string, head rpc.RpcHead) bool

func (*UserProcess) Init

func (u *UserProcess) Init()

func (*UserProcess) PacketFunc

func (u *UserProcess) PacketFunc(pkg rpc.Packet) bool

func (*UserProcess) SwitchSendToGame

func (u *UserProcess) SwitchSendToGame(socketId uint32, packetName string, head rpc.RpcHead, packet rpc.Packet)

func (*UserProcess) SwitchSendToZone

func (u *UserProcess) SwitchSendToZone(socketId uint32, packetName string, head rpc.RpcHead, packet rpc.Packet)

Jump to

Keyboard shortcuts

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