gamesocket

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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) Close

func (s *GameSocket) Close()

Close socket

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

Jump to

Keyboard shortcuts

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