Documentation ¶
Index ¶
- func AddPeer(peer *LobbyPeer) error
- func InitGameDB(mongoConf string) error
- func JoinLobby(peerId string, lobbyId string) error
- func LeaveLobby(peerId string, lobbyId string) error
- func RemovePeer(peerId string) error
- func RoomPubDomain(info *gen_server.NodeInfo) (string, bool)
- type LiteRoomEntity
- func CreateRoom(peerId string, roomId string) (*LiteRoomEntity, error)
- func JoinRandomRoom(peerId string) (*LiteRoomEntity, error)
- func JoinRoom(peerId string, roomId string) (*LiteRoomEntity, error)
- func NewLiteRoomEntity(roomId string, lobbyId string, nodeId string) *LiteRoomEntity
- func RoomList(lobbyId string, startIndex int, endIndex int) ([]*LiteRoomEntity, error)
- type LobbyEntity
- func (l *LobbyEntity) CreateRoom(roomId string) (*LiteRoomEntity, error)
- func (l *LobbyEntity) FindRoom(roomId string) (*LiteRoomEntity, error)
- func (l *LobbyEntity) MasterCount() (int, error)
- func (l *LobbyEntity) PeerCount() (int, error)
- func (l *LobbyEntity) RandomRoom() (*LiteRoomEntity, error)
- func (l *LobbyEntity) RoomCount() (int, error)
- func (l *LobbyEntity) Rooms(startIndex int, endIndex int) ([]*LiteRoomEntity, error)
- func (l *LobbyEntity) SetNick(nick string) error
- type LobbyManager
- type LobbyPeer
- type LobbyServerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGameDB ¶
func LeaveLobby ¶
func RemovePeer ¶
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 NewLiteRoomEntity ¶
func NewLiteRoomEntity(roomId string, lobbyId string, nodeId string) *LiteRoomEntity
type LobbyEntity ¶
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 NewLobbyPeer ¶
func (*LobbyPeer) SetDefaultLobby ¶
func (l *LobbyPeer) SetDefaultLobby()
func (*LobbyPeer) SetLobbyId ¶
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
Click to show internal directories.
Click to hide internal directories.