server

package
v0.0.0-...-bd21981 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Generated with cb-generator. DO NOT EDIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessXMLMessage

func ProcessXMLMessage(message string, c Controller) (err error)

func ProcessXMLNode

func ProcessXMLNode(node *parser.Node, c Controller) (err error)

Types

type Answer

type Answer int
const (
	AnswerSkip      Answer = iota
	AnswerPon              // 1
	AnswerOpenedKan        // 2
	AnswerChi              // 3
	AnswerClosedKan        // 4
	AnswerChankan          // 5
	AnswerRon              // 6
	AnswerTsumo            // 7
	Answer8                // What is 8???
	AnswerDraw             // 9
	AnswerSanmaDora        // 10
)

type Callbacks

type Callbacks struct {
	CbAuth               func(string)
	CbBye                func()
	CbCall               func(Answer, tile.Instances)
	CbCancelJoin         func()
	CbChat               func(string)
	CbDrop               func(tile.Instance)
	CbGoOK               func()
	CbHello              func(string, string, tbase.Sex)
	CbJoin               func(int, int, bool)
	CbNextReady          func()
	CbPing               func()
	CbReach              func(tile.Instance)
	CbRequestLobbyStatus func(int, int)

	Default func()
}

func (*Callbacks) Auth

func (c *Callbacks) Auth(a0 string)

func (*Callbacks) Bye

func (c *Callbacks) Bye()

func (*Callbacks) Call

func (c *Callbacks) Call(a0 Answer, a1 tile.Instances)

func (*Callbacks) CancelJoin

func (c *Callbacks) CancelJoin()

func (*Callbacks) Chat

func (c *Callbacks) Chat(a0 string)

func (*Callbacks) Drop

func (c *Callbacks) Drop(a0 tile.Instance)

func (*Callbacks) GoOK

func (c *Callbacks) GoOK()

func (*Callbacks) Hello

func (c *Callbacks) Hello(a0 string, a1 string, a2 tbase.Sex)

func (*Callbacks) Join

func (c *Callbacks) Join(a0 int, a1 int, a2 bool)

func (*Callbacks) NextReady

func (c *Callbacks) NextReady()

func (*Callbacks) Ping

func (c *Callbacks) Ping()

func (*Callbacks) Reach

func (c *Callbacks) Reach(a0 tile.Instance)

func (*Callbacks) RequestLobbyStatus

func (c *Callbacks) RequestLobbyStatus(a0 int, a1 int)

type Controller

type Controller interface {
	Hello(name string, tid string, sex tbase.Sex)
	Auth(value string)
	// TODO: research values
	// Could be both big and small
	RequestLobbyStatus(v, V int) // PXR
	Join(lobbyNumber int, lobbyType int, rejoin bool)
	CancelJoin()
	Drop(t tile.Instance)
	Call(a Answer, tiles tile.Instances)
	Reach(t tile.Instance)
	Ping() // Z
	GoOK()
	NextReady()
	Bye()
	Chat(message string)
}

This is how server looks from client point of view

type XMLWriter

type XMLWriter struct {
	util.XMLWriter
}

func NewXMLWriter

func NewXMLWriter() XMLWriter

func (XMLWriter) Auth

func (w XMLWriter) Auth(value string)

func (XMLWriter) Bye

func (w XMLWriter) Bye()

func (XMLWriter) Call

func (w XMLWriter) Call(t Answer, tiles tile.Instances)

func (XMLWriter) CancelJoin

func (w XMLWriter) CancelJoin()

func (XMLWriter) Chat

func (w XMLWriter) Chat(message string)

func (XMLWriter) Drop

func (w XMLWriter) Drop(t tile.Instance)

func (XMLWriter) GoOK

func (w XMLWriter) GoOK()

func (XMLWriter) Hello

func (w XMLWriter) Hello(name string, tid string, sex tbase.Sex)

func (XMLWriter) Join

func (w XMLWriter) Join(lobbyNumber int, lobbyType int, rejoin bool)

func (XMLWriter) NextReady

func (w XMLWriter) NextReady()

func (XMLWriter) Ping

func (w XMLWriter) Ping()

func (XMLWriter) Reach

func (w XMLWriter) Reach(t tile.Instance)

func (XMLWriter) RequestLobbyStatus

func (w XMLWriter) RequestLobbyStatus(v, V int)

Jump to

Keyboard shortcuts

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