server

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Boot

func Boot() error

Types

type Goroutine

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

func (*Goroutine) InAllPlayers

func (gb *Goroutine) InAllPlayers(task func(id int))

func (*Goroutine) Submit

func (gb *Goroutine) Submit(task func())

type ServerBuild

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

func Builder

func Builder() *ServerBuild

func (*ServerBuild) Expulse

func (rb *ServerBuild) Expulse(cb *chat.ChatBuilder) *ServerBuild

func (*ServerBuild) Goroutine

func (rb *ServerBuild) Goroutine() *Goroutine

func (*ServerBuild) MessageLoop

func (rb *ServerBuild) MessageLoop(msg string) *ServerBuild

Define a mensagem que será enviada durante a contagem regresiva para reiniciar

Exemplo: "O servidor reiniciará"

# Resultado:

  • O servidor reiniciará - 5
  • O servidor reiniciará - 4
  • O servidor reiniciará - 3
  • O servidor reiniciará - 2
  • O servidor reiniciará - 1
  • O servidor reiniciará - 0

func (*ServerBuild) Player

func (rb *ServerBuild) Player(playerid int) *ServerBuild

func (*ServerBuild) RestartNow

func (rb *ServerBuild) RestartNow(cb *chat.ChatBuilder) *ServerBuild

Efetiva a ordem de reinício, recebendo um objeto builder

# Exemplo:

cb := chat.Build()

cb.PlayerID(chat.global). Tag("servidor"). Color(common.WarnColorStr). Message("ordem de reinício")

server. Build(). MessageLoop("O servidor reiniciará"). RestartNow(cb)

* Resultado do chat:

  • [SERVIDOR] ordem de reínicio
  • [SERVIDOR] o servidor reiniciará - 5
  • [SERVIDOR] o servidor reiniciará - 4
  • [SERVIDOR] o servidor reiniciará - 3
  • [SERVIDOR] o servidor reiniciará - 2
  • [SERVIDOR] o servidor reiniciará - 1
  • [SERVIDOR] o servidor reiniciará - 0

... servidor reiniciou

func (*ServerBuild) Spawn

func (rb *ServerBuild) Spawn(cb *chat.ChatBuilder) *ServerBuild

func (*ServerBuild) Wait

func (rb *ServerBuild) Wait(wait ...time.Duration) *ServerBuild

Jump to

Keyboard shortcuts

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