Documentation ¶
Index ¶
- func NewGameSocket(c net.Conn, accountRepo repo.AccountRepo, params session.GameSessionParams) sockets.Socket
- type GameSocket
- func (s *GameSocket) Address() string
- func (s *GameSocket) AuthSession(p *packet.Packet) error
- func (s *GameSocket) Close()
- func (s *GameSocket) Handshake() error
- func (s *GameSocket) ListenAndProcess(ctx context.Context) error
- func (s *GameSocket) ReadChannel() <-chan *packet.Packet
- func (s *GameSocket) Send(p *packet.Writer)
- func (s *GameSocket) SendPacket(p *packet.Packet)
- func (s *GameSocket) WriteChannel() chan<- *packet.Packet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGameSocket ¶
func NewGameSocket( c net.Conn, accountRepo repo.AccountRepo, params session.GameSessionParams, ) sockets.Socket
Types ¶
type GameSocket ¶
type GameSocket struct {
// contains filtered or unexported fields
}
GameSocket socket between game client and load balancer
func (*GameSocket) Address ¶
func (s *GameSocket) Address() string
func (*GameSocket) AuthSession ¶
func (s *GameSocket) AuthSession(p *packet.Packet) error
AuthSession handles CMsgAuthSession and creates session object that takes control over the packets.
func (*GameSocket) Handshake ¶
func (s *GameSocket) Handshake() error
Handshake sends handshake request
func (*GameSocket) ListenAndProcess ¶
func (s *GameSocket) ListenAndProcess(ctx context.Context) error
ListenAndProcess listen for incoming messages and starts to handle them from here BLOCKS WHILE CONNECTION IS OPEN
func (*GameSocket) ReadChannel ¶
func (s *GameSocket) ReadChannel() <-chan *packet.Packet
ReadChannel returns channel with packets from game client
func (*GameSocket) Send ¶
func (s *GameSocket) Send(p *packet.Writer)
Send sends writer to the game client
func (*GameSocket) SendPacket ¶
func (s *GameSocket) SendPacket(p *packet.Packet)
SendPacket sends packet to the game client
func (*GameSocket) WriteChannel ¶
func (s *GameSocket) WriteChannel() chan<- *packet.Packet
WriteChannel returns channel that consumes packets that needs to be sent to the game client
Click to show internal directories.
Click to hide internal directories.