gen_lobby

package
v0.0.0-...-8d9cb7d Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPeer

func AddPeer(peer *LobbyPeer) error

func InitGameDB

func InitGameDB(mongoConf string) error

func JoinLobby

func JoinLobby(peerId string, lobbyId string) error

func LeaveLobby

func LeaveLobby(peerId string, lobbyId string) error

func RemovePeer

func RemovePeer(peerId string) error

func RoomPubDomain

func RoomPubDomain(info *gen_server.NodeInfo) (string, bool)

Types

type LiteRoomEntity

type LiteRoomEntity struct {
	RoomId    string            `bson:"roomid"`
	Nick      string            `bson:"nick"`
	LobbyId   string            `bson:"lobbyid"`
	NodeId    string            `bson:"nodeid"`
	PeerCount int               `bson:"peercount"`
	MaxPeers  int               `bson:"maxpeers"`
	UsrDatas  map[string]string `bson:"usrdatas"`
}

func CreateRoom

func CreateRoom(peerId string, roomId string) (*LiteRoomEntity, error)

func JoinRandomRoom

func JoinRandomRoom(peerId string) (*LiteRoomEntity, error)

func JoinRoom

func JoinRoom(peerId string, roomId string) (*LiteRoomEntity, error)

func NewLiteRoomEntity

func NewLiteRoomEntity(roomId string, lobbyId string, nodeId string) *LiteRoomEntity

func RoomList

func RoomList(lobbyId string, startIndex int, endIndex int) ([]*LiteRoomEntity, error)

type LobbyEntity

type LobbyEntity struct {
	LobbyId string `bson:"lobbyid"`
	Nick    string `bson:"nick"`
}

func CreateLobby

func CreateLobby(lobbyId string) (*LobbyEntity, error)

func DisposeLobby

func DisposeLobby(lobbyId string) (*LobbyEntity, error)

func LobbyStats

func LobbyStats(lobbyId string) (*LobbyEntity, error)

func NewLobbyEntity

func NewLobbyEntity(lobbyId string) *LobbyEntity

func (*LobbyEntity) CreateRoom

func (l *LobbyEntity) CreateRoom(roomId string) (*LiteRoomEntity, error)

func (*LobbyEntity) FindRoom

func (l *LobbyEntity) FindRoom(roomId string) (*LiteRoomEntity, error)

func (*LobbyEntity) MasterCount

func (l *LobbyEntity) MasterCount() (int, error)

func (*LobbyEntity) PeerCount

func (l *LobbyEntity) PeerCount() (int, error)

func (*LobbyEntity) RandomRoom

func (l *LobbyEntity) RandomRoom() (*LiteRoomEntity, error)

func (*LobbyEntity) RoomCount

func (l *LobbyEntity) RoomCount() (int, error)

func (*LobbyEntity) Rooms

func (l *LobbyEntity) Rooms(startIndex int, endIndex int) ([]*LiteRoomEntity, error)

func (*LobbyEntity) SetNick

func (l *LobbyEntity) SetNick(nick string) error

type LobbyManager

type LobbyManager struct {
}

func NewLobbyManager

func NewLobbyManager() *LobbyManager

func (*LobbyManager) CreateLobby

func (l *LobbyManager) CreateLobby(lobbyId string) (*LobbyEntity, error)

func (*LobbyManager) DisposeLobby

func (l *LobbyManager) DisposeLobby(lobbyId string) error

func (*LobbyManager) FindLobby

func (l *LobbyManager) FindLobby(lobbyId string) (*LobbyEntity, error)

type LobbyPeer

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

func GetPeer

func GetPeer(peerId string) (*LobbyPeer, bool)

func NewLobbyPeer

func NewLobbyPeer(peerId string) *LobbyPeer

func (*LobbyPeer) LobbyId

func (l *LobbyPeer) LobbyId() string

func (*LobbyPeer) PeerId

func (l *LobbyPeer) PeerId() string

func (*LobbyPeer) SetDefaultLobby

func (l *LobbyPeer) SetDefaultLobby()

func (*LobbyPeer) SetLobbyId

func (l *LobbyPeer) SetLobbyId(lobbyId string)

type LobbyServerInfo

type LobbyServerInfo struct {
	RegDC     string
	NameSpace string
	NodeId    string
	EndPoints []string
	GameDB    string
}

func (*LobbyServerInfo) ExpandToNodeInfo

func (serverInfo *LobbyServerInfo) ExpandToNodeInfo() *gen_server.NodeInfo

Jump to

Keyboard shortcuts

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