character

package
v0.0.0-...-34f5af7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Constants and structs associated with character data.

Index

Constants

View Source
const (
	NumCharacterClasses = 12
	// Amount of meseta new characters are given when created.
	StartingMeseta = 300
)
View Source
const (

	// Id sent in the menu selection packet to tell the client
	// that the selection was made on the ship menu.
	ShipSelectionMenuId uint16 = 0x12
)

Variables

View Source
var BaseKeyConfig = [420]byte{}/* 420 elements not displayed */

Default keyboard/joystick configuration used for players who are logging in for the first time.

View Source
var (

	// Starting stats for any new character. The CharClass constants can be used
	// to index into this array to obtain the base stats for each class.
	BaseStats [NumCharacterClasses]stats
)
View Source
var BaseSymbolChats = [1248]byte{}/* 1248 elements not displayed */

Functions

This section is empty.

Types

type Cache

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

Cache is an instance of a key-value store with contents specific to each instance and are not shared between instances. By default its entries do not expire without a TTL.

func NewCache

func NewCache() *Cache

func (*Cache) Get

func (c *Cache) Get(key string) (interface{}, bool)

Get fetches a value from the cache, returning the value as well as whether or not the value was found (semantics similar to map).

func (*Cache) Put

func (c *Cache) Put(key string, value interface{}, ttl time.Duration)

Put sets a key/value pair in the cache with an optional duration. Passing 0 for ttl will cause the default expiration to be used and -1 will not set a ttl.

type GuildcardData

type GuildcardData struct {
	Unknown  [0x114]uint8
	Blocked  [0x1DE8]uint8 //This should be a struct once implemented
	Unknown2 [0x78]uint8
	Entries  [104]GuildcardDataEntry
	Unknown3 [0x1BC]uint8
}

GuildcardData is the per-player guildcard data chunk.

type GuildcardDataEntry

type GuildcardDataEntry struct {
	Guildcard   uint32
	Name        [48]byte
	TeamName    [32]byte
	Description [176]byte
	Reserved    uint8
	Language    uint8
	SectionID   uint8
	CharClass   uint8
	Padding     uint32
	Comment     [176]byte
}

GuildcardDataEntry is the per-player friend guildcard entries.

type Server

type Server struct {
	Name   string
	Config *core.Config
	Logger *logrus.Logger
	// contains filtered or unexported fields
}

Server is the CHARACTER server implementation. Clients are sent to this server

after authenticating with LOGIN. Each client connects to the server in four

different phases (each one is a new connection):

  1. Data download (login options, guildcard, and character previews).
  2. Character selection
  3. (Optional) Character creation/modification (recreate and dressing room)
  4. Confirmation and ship selection

The ship list is obtained by communicating with the shipgate server since ships do not directly connect to this server.

func (*Server) Handle

func (s *Server) Handle(ctx context.Context, c *client.Client, data []byte) error

func (*Server) Handshake

func (s *Server) Handshake(c *client.Client) error

func (*Server) Identifier

func (s *Server) Identifier() string

func (*Server) Init

func (s *Server) Init(ctx context.Context) error

func (*Server) SetUpClient

func (s *Server) SetUpClient(c *client.Client)

Jump to

Keyboard shortcuts

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