login

package
v0.0.0-...-3ed2db9 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Room

type Room struct {
	Name           string `json:"name"`
	PlayersPerGame int    `json:"playersPerGame"`
	PlayersCount   int    `json:"playersCount"`
	// contains filtered or unexported fields
}

Room each room runs one game

func NewRoom

func NewRoom(s RoomSettings) *Room

NewRoom creates new room

func (*Room) AddClient

func (r *Room) AddClient(c *core.Client)

AddClient into game room

type RoomSettings

type RoomSettings struct {
	Name           string
	PlayersPerGame int
}

RoomSettings contains setting for room creation

type Server

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

Server (login) is entry point for players

func NewServer

func NewServer(pattern string) *Server

NewServer creates new game server instance

func (*Server) Handlers

func (s *Server) Handlers() []*core.CommandHandler

Handlers returns GameServer handlers

func (*Server) Listen

func (s *Server) Listen()

Listen starts the server

func (*Server) OnJoin

func (s *Server) OnJoin(d *json.RawMessage, c *core.Client) *core.Result

OnJoin - player is trying to enter room

func (*Server) OnRooms

func (s *Server) OnRooms(d *json.RawMessage, p *core.Client) *core.Result

OnRooms - player is quering rooms

Jump to

Keyboard shortcuts

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