Documentation ¶
Index ¶
- func DecodeWin1251(encoded []byte) string
- func EncodeWin1251(decoded string) []byte
- func ReadGameInfo(r io.Reader, full bool, game *EIGameInfo) error
- func ReadMasterResponse(r io.Reader, game *EIGameInfo) error
- func ReadServerInfo(r io.Reader, full bool, srv *EIServerInfo) error
- func ReadServersList(r io.Reader, full bool, res *[]EIServerInfo) error
- func WriteGameInfo(w io.Writer, full bool, game *EIGameInfo) error
- func WriteMasterResponse(w io.Writer, game *EIGameInfo) error
- func WriteServerInfo(w io.Writer, full bool, srv *EIServerInfo) error
- func WriteServersList(w io.Writer, full bool, servers []EIServerInfo) error
- type EIGameInfo
- type EIServerAddr
- type EIServerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeWin1251 ¶
func EncodeWin1251 ¶
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 `json:"-"` MasterToken uint32 `json:"-"` Name string `json:"name"` Quest string `json:"quest"` PlayersCount uint8 `json:"players_count"` MaxPlayersCount uint8 `json:"max_players_count"` HasPassword bool `json:"has_password"` AllodIndex uint8 `json:"allod_index"` PlayerNames []string `json:"player_names,omitempty"` }
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 ¶
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) String ¶
func (addr *EIServerAddr) String() string
type EIServerInfo ¶
type EIServerInfo struct { Addr net.UDPAddr `json:"addr"` EIGameInfo AppearTime time.Time `json:"appear_time"` LastUpdate time.Time `json:"last_update"` Ping int `json:"ping"` LastSuccessfulPing time.Time `json:"last_successful_ping"` }
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) StrictEquals ¶
func (srv *EIServerInfo) StrictEquals(srv2 *EIServerInfo) bool
func (*EIServerInfo) String ¶
func (srv *EIServerInfo) String() string
Click to show internal directories.
Click to hide internal directories.