eimasterlib

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeWin1251

func DecodeWin1251(encoded []byte) string

func EncodeWin1251

func EncodeWin1251(decoded string) []byte

func ReadGameInfo

func ReadGameInfo(r io.Reader, full bool, game *EIGameInfo) error

func ReadMasterResponse

func ReadMasterResponse(r io.Reader, game *EIGameInfo) error

func ReadServerInfo

func ReadServerInfo(r io.Reader, full bool, srv *EIServerInfo) error

func ReadServersList

func ReadServersList(r io.Reader, full bool, res *[]EIServerInfo) error

func WriteGameInfo

func WriteGameInfo(w io.Writer, full bool, game *EIGameInfo) error

func WriteMasterResponse

func WriteMasterResponse(w io.Writer, game *EIGameInfo) error

func WriteServerInfo

func WriteServerInfo(w io.Writer, full bool, srv *EIServerInfo) error

func WriteServersList

func WriteServersList(w io.Writer, full bool, servers []EIServerInfo) error

Types

type EIGameInfo

type EIGameInfo struct {
	ClientID        uint32
	MasterToken     uint32
	Name            string
	Quest           string
	PlayersCount    uint8
	MaxPlayersCount uint8
	HasPassword     bool
	AllodIndex      uint8
	PlayerNames     []string
}

func (*EIGameInfo) Copy

func (game *EIGameInfo) Copy() *EIGameInfo

Copy makes a full copy of the this EIGameInfo struct

func (*EIGameInfo) IsSentByOrigGame

func (game *EIGameInfo) IsSentByOrigGame() bool

IsSentByOrigGame returns true if this game info looks like produced by original game

type EIServerAddr

type EIServerAddr struct {
	Family uint16
	Data   [14]uint8
}

EIServerAddr represents server address. Maybe it makes sense to get rid of this and use net.Addr instead

func NewEIServerAddr

func NewEIServerAddr(addr *net.UDPAddr) (eiAddr *EIServerAddr, err error)

func (*EIServerAddr) GetUDPAddr

func (addr *EIServerAddr) GetUDPAddr() *net.UDPAddr

func (*EIServerAddr) Read

func (addr *EIServerAddr) Read(r io.Reader) error

func (*EIServerAddr) String

func (addr *EIServerAddr) String() string

func (*EIServerAddr) Write

func (addr *EIServerAddr) Write(w io.Writer) error

type EIServerInfo

type EIServerInfo struct {
	Addr net.UDPAddr
	EIGameInfo
	AppearTime time.Time
	LastUpdate time.Time
	Ping       int
}

func (*EIServerInfo) Copy

func (srv *EIServerInfo) Copy() *EIServerInfo

Copy makes a full copy of this EIServerInfo struct

func (*EIServerInfo) Equals

func (srv *EIServerInfo) Equals(srv2 *EIServerInfo) bool

func (*EIServerInfo) IP

func (srv *EIServerInfo) IP() string

func (*EIServerInfo) String

func (srv *EIServerInfo) String() string

Jump to

Keyboard shortcuts

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