Documentation ¶
Index ¶
- Constants
- func AddPeer(peer *RoomPeer) error
- func BindEventCallback(eventer IGenRoomEventer)
- func ClrEventCache(roomId string, peerId string) error
- func CreateRoom(peerId string, roomId string, lobbyId string, maxPeers byte) (*RoomEntity, *Actor, error)
- func DisposeRoom(roomId string) error
- func GetActorInRoom(peerId string, roomId string) (*RoomEntity, *Actor, error)
- func InitGameDB(mongoConf string) error
- func JoinRoom(peerId string, roomId string) (*RoomEntity, *Actor, error)
- func LeaveRoom(peerId string, roomId string) (*RoomEntity, *Actor, error)
- func RaiseEvent(peerId string, roomId string, data []byte, rcvGroup byte, addToRoomCache bool) error
- func RcvCacheEvent(peerId string, roomId string) error
- func RemovePeer(peerId string) error
- type Actor
- type ActorsManager
- func (a *ActorsManager) ActorsCount() int
- func (a *ActorsManager) AddNewActor(peerId string) (*Actor, error)
- func (a *ActorsManager) ClearAll()
- func (a *ActorsManager) CreateActorNr() int32
- func (a *ActorsManager) GetActorByIndex(index int) (*Actor, bool)
- func (a *ActorsManager) GetActorByNr(actorNr int32) (*Actor, bool)
- func (a *ActorsManager) GetActorByPeerId(peerId string) (*Actor, bool)
- func (a *ActorsManager) GetAllActorNrs() []int32
- func (a *ActorsManager) GetAllPeerIds() []string
- func (a *ActorsManager) RemoveActorByNr(actorNr int32) (*Actor, bool)
- func (a *ActorsManager) RemoveActorByPeer(peerId string) (*Actor, bool)
- type EventCacheManager
- type EventData
- type IGenRoomEventer
- type ListInt
- func (l *ListInt) Add(item int32)
- func (l *ListInt) Capacity() int
- func (l *ListInt) Clear()
- func (l *ListInt) Contains(item int32) bool
- func (l *ListInt) Count() int
- func (l *ListInt) ForEach(fun func(int32))
- func (l *ListInt) Get(index int) (int32, error)
- func (l *ListInt) IndexOf(item int32) int
- func (l *ListInt) Insert(index int, item int32) error
- func (l *ListInt) Items() []int32
- func (l *ListInt) Remove(item int32) bool
- func (l *ListInt) RemoveAt(index int) error
- func (l *ListInt) Set(index int, item int32) error
- type LiteRoomEntity
- type RoomEntity
- func (r *RoomEntity) ActorsManager() *ActorsManager
- func (r *RoomEntity) EventCache() *EventCacheManager
- func (r *RoomEntity) IsEmpty() bool
- func (r *RoomEntity) IsFull() bool
- func (r *RoomEntity) LobbyId() string
- func (r *RoomEntity) MasterId() int32
- func (r *RoomEntity) MaxPeers() byte
- func (r *RoomEntity) Nick() string
- func (r *RoomEntity) PeerCount() byte
- func (r *RoomEntity) RoomId() string
- func (r *RoomEntity) SetMasterId(masterId int32)
- func (r *RoomEntity) SetNick(nick string)
- func (r *RoomEntity) UpdateStatusToGameDB() error
- type RoomManager
- func (r *RoomManager) CreateRoom(roomId string, lobbyId string, maxPeers byte) (*RoomEntity, error)
- func (r *RoomManager) DisposeRoom(roomId string)
- func (r *RoomManager) FetchRoom(roomId string, lobbyId string, maxPeers byte) *RoomEntity
- func (r *RoomManager) FindRoom(roomId string) (*RoomEntity, error)
- type RoomPeer
- type RoomServerInfo
Constants ¶
View Source
const ( RcvGroup_Others byte = 0 RcvGroup_All = 1 RcvGroup_Master = 2 )
Variables ¶
This section is empty.
Functions ¶
func BindEventCallback ¶
func BindEventCallback(eventer IGenRoomEventer)
func ClrEventCache ¶
func CreateRoom ¶
func DisposeRoom ¶
func GetActorInRoom ¶
func GetActorInRoom(peerId string, roomId string) (*RoomEntity, *Actor, error)
func InitGameDB ¶
func RaiseEvent ¶
func RcvCacheEvent ¶
func RemovePeer ¶
Types ¶
type ActorsManager ¶
type ActorsManager struct {
// contains filtered or unexported fields
}
func NewActorsManager ¶
func NewActorsManager() *ActorsManager
func (*ActorsManager) ActorsCount ¶
func (a *ActorsManager) ActorsCount() int
func (*ActorsManager) AddNewActor ¶
func (a *ActorsManager) AddNewActor(peerId string) (*Actor, error)
func (*ActorsManager) ClearAll ¶
func (a *ActorsManager) ClearAll()
func (*ActorsManager) CreateActorNr ¶
func (a *ActorsManager) CreateActorNr() int32
func (*ActorsManager) GetActorByIndex ¶
func (a *ActorsManager) GetActorByIndex(index int) (*Actor, bool)
func (*ActorsManager) GetActorByNr ¶
func (a *ActorsManager) GetActorByNr(actorNr int32) (*Actor, bool)
func (*ActorsManager) GetActorByPeerId ¶
func (a *ActorsManager) GetActorByPeerId(peerId string) (*Actor, bool)
func (*ActorsManager) GetAllActorNrs ¶
func (a *ActorsManager) GetAllActorNrs() []int32
func (*ActorsManager) GetAllPeerIds ¶
func (a *ActorsManager) GetAllPeerIds() []string
func (*ActorsManager) RemoveActorByNr ¶
func (a *ActorsManager) RemoveActorByNr(actorNr int32) (*Actor, bool)
func (*ActorsManager) RemoveActorByPeer ¶
func (a *ActorsManager) RemoveActorByPeer(peerId string) (*Actor, bool)
type EventCacheManager ¶
type EventCacheManager struct {
// contains filtered or unexported fields
}
func NewEventCacheManager ¶
func NewEventCacheManager() *EventCacheManager
func (*EventCacheManager) AddEvent ¶
func (e *EventCacheManager) AddEvent(actor int32, data []byte)
func (*EventCacheManager) ClearCache ¶
func (e *EventCacheManager) ClearCache()
func (*EventCacheManager) Events ¶
func (e *EventCacheManager) Events() []interface{}
func (*EventCacheManager) RemoveEventsByActor ¶
func (e *EventCacheManager) RemoveEventsByActor(actor int32) int
type EventData ¶
type EventData struct {
// contains filtered or unexported fields
}
func NewEventData ¶
type IGenRoomEventer ¶
type IGenRoomEventer interface { OnJoinRoom(actor *Actor, room *RoomEntity) OnLeaveRoom(actor *Actor, room *RoomEntity) OnCustomEvent(actor *Actor, room *RoomEntity, data []byte) }
type LiteRoomEntity ¶
type RoomEntity ¶
type RoomEntity struct {
// contains filtered or unexported fields
}
func NewRoomEntity ¶
func NewRoomEntity(roomId string, lobbyId string, maxPeers byte) *RoomEntity
func NewRoomEntityFromLite ¶
func NewRoomEntityFromLite(lite *LiteRoomEntity) *RoomEntity
func (*RoomEntity) ActorsManager ¶
func (r *RoomEntity) ActorsManager() *ActorsManager
func (*RoomEntity) EventCache ¶
func (r *RoomEntity) EventCache() *EventCacheManager
func (*RoomEntity) IsEmpty ¶
func (r *RoomEntity) IsEmpty() bool
func (*RoomEntity) IsFull ¶
func (r *RoomEntity) IsFull() bool
func (*RoomEntity) LobbyId ¶
func (r *RoomEntity) LobbyId() string
func (*RoomEntity) MasterId ¶
func (r *RoomEntity) MasterId() int32
func (*RoomEntity) MaxPeers ¶
func (r *RoomEntity) MaxPeers() byte
func (*RoomEntity) Nick ¶
func (r *RoomEntity) Nick() string
func (*RoomEntity) PeerCount ¶
func (r *RoomEntity) PeerCount() byte
func (*RoomEntity) RoomId ¶
func (r *RoomEntity) RoomId() string
func (*RoomEntity) SetMasterId ¶
func (r *RoomEntity) SetMasterId(masterId int32)
func (*RoomEntity) SetNick ¶
func (r *RoomEntity) SetNick(nick string)
func (*RoomEntity) UpdateStatusToGameDB ¶
func (r *RoomEntity) UpdateStatusToGameDB() error
type RoomManager ¶
type RoomManager struct {
// contains filtered or unexported fields
}
func NewRoomManager ¶
func NewRoomManager() *RoomManager
func (*RoomManager) CreateRoom ¶
func (r *RoomManager) CreateRoom(roomId string, lobbyId string, maxPeers byte) (*RoomEntity, error)
func (*RoomManager) DisposeRoom ¶
func (r *RoomManager) DisposeRoom(roomId string)
func (*RoomManager) FetchRoom ¶
func (r *RoomManager) FetchRoom(roomId string, lobbyId string, maxPeers byte) *RoomEntity
func (*RoomManager) FindRoom ¶
func (r *RoomManager) FindRoom(roomId string) (*RoomEntity, error)
type RoomPeer ¶
type RoomPeer struct {
// contains filtered or unexported fields
}
func NewRoomPeer ¶
type RoomServerInfo ¶
type RoomServerInfo struct { RegDC string NameSpace string NodeId string EndPoints []string GameDB string PubDomain string }
func (*RoomServerInfo) ExpandToNodeInfo ¶
func (serverInfo *RoomServerInfo) ExpandToNodeInfo() *gen_server.NodeInfo
Click to show internal directories.
Click to hide internal directories.