0
0
Fork 0
This repository has been archived on 2024-05-09. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
game-server/pkg/gsinterfaces/gsinterfaces.go
2018-09-18 08:35:41 -05:00

28 lines
630 B
Go

package gsinterfaces
type Server interface {
GetUser(uuid string, name string) User
Shutdown(timeout int)
DebugAddUser(user User)
DebugAddGame(game Game)
}
type User interface {
SetFromHandler(func(userUUID string, b []byte))
AddConnection(params ...interface{}) error
RemoveConnection(params ...interface{}) error
SendData(b []byte)
SetName(n string) error
Name() string
ID() string
Shutdown()
}
type Game interface {
ID() string
Name() string
StartGameLoop()
FromUserHandler(uuid string, payload map[string]interface{})
SetFromGameHandler(func(userUUID string, gameuuid string, e interface{}))
Shutdown()
}