Documentation
¶
Index ¶
Constants ¶
View Source
const ( PREPROCCESS_NONE = iota PREPROCCESS_COFFEE = iota PREPROCCESS_LESS = iota PREPROCCESS_UGLY = iota )
View Source
const ( MODE_DEVELOPMENT = "development" MODE_PRODUCTION = "production" GAME_PORT = 9001 CLIENT_PORT = 8080 DEF_SLOTS = 0 )
View Source
const ( CLOSE_NO_SLOTS = 4502 CLOSE_INVALID_PASS = 4503 CLOSE_INVALID_USER = 4504 CLOSE_INVALID_PROTO = 4505 )
View Source
const ( PLAYER_LEFT = iota PLAYER_DISCONNECT = iota GROUP_ALL = iota MESSAGE_INVALID = 0 MESSAGE_CHAT = 1 )
View Source
const (
LOCATION_LOBBY = "lobby"
)
Variables ¶
This section is empty.
Functions ¶
func ChatMessage ¶
func MessageType ¶
Types ¶
type ClientConfig ¶
type ClientConfig struct {
SeedServers []SeedServer `json:"seed_servers"`
}
type ClientServer ¶
type ClientServer struct {
// contains filtered or unexported fields
}
func NewClientServer ¶
func NewClientServer(conf ServerConfig) *ClientServer
func (*ClientServer) Serve ¶
func (c *ClientServer) Serve()
type FlagConfig ¶
type FlagConfig struct {
Mode string
HostName string
GamePort int
ClientPort int
InfoPort int
ConfigFile string
Register string
}
var Flags *FlagConfig
type GameServer ¶
func NewGameServer ¶
func NewGameServer(conf ServerConfig) (*GameServer, error)
func (*GameServer) Cleanup ¶
func (g *GameServer) Cleanup()
func (*GameServer) RegisterWith ¶
func (g *GameServer) RegisterWith(otherServer string) error
func (*GameServer) Serve ¶
func (g *GameServer) Serve() error
func (*GameServer) ServerStatus ¶
func (g *GameServer) ServerStatus()
type Player ¶
func (*Player) AddReader ¶
func (p *Player) AddReader(pl PlayerReader)
func (*Player) RemoveReader ¶
func (p *Player) RemoveReader(pl PlayerReader)
func (*Player) Unregister ¶
type PlayerMessage ¶
type PlayerReader ¶
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
func (*Room) Channel ¶
func (r *Room) Channel() chan<- PlayerMessage
func (*Room) Unregister ¶
type SeedServer ¶
type ServerConfig ¶
type ServerConfig struct {
Mode string `yaml:"mode"`
ServerName string `yaml:"name"`
HostName string `yaml:"hostname"`
ListenAddress string `yaml:"listen_address"`
GamePort int `yaml:"gameport"`
ClientPort int `yaml:"clientport"`
ClientAssets string `yaml:"clientassets"`
CompiledAssetPath string `yaml:"compiledassets"`
CoffeePath string `yaml:"coffee"`
LessPath string `yaml:"less"`
UglifyPath string `yaml:"uglify"`
Slots int `yaml:"slots"`
ForceAuth bool `yaml:"force_auth"`
Origin []string `yaml:"origin"`
Datastore string `yaml:"datastore"`
DatastoreConf map[string]string `yaml:"datastore_conf"`
SeedServers []string `yaml:"seed_servers"`
RegisterWith []string `yaml:"register_with"`
TmpDir []string `yaml:"-"`
Quit func() `yaml:"-"`
}
func ReadConfig ¶
func ReadConfig() (ServerConfig, error)
func (ServerConfig) GetHostname ¶
func (sc ServerConfig) GetHostname() string
Click to show internal directories.
Click to hide internal directories.