SwampRoomManager class final
Manages the lifecycle and operations of rooms on the server.
Constructors
- SwampRoomManager(ConfigManager configManager)
Properties
- config → SwampConfig
-
The current server configuration.
no setter
- configManager → ConfigManager
-
The server configuration manager.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- playerCount → int
-
The total number of players across all rooms.
no setter
-
read
→ Stream<
NetworkerPacket< RpcNetworkerPacket> > -
no setterinherited
-
rooms
→ Iterable<
SwampRoom> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
write
→ Stream<
NetworkerPacket< RpcNetworkerPacket> > -
no setterinherited
Methods
-
addRoom(
Channel owner, {Channel? maxPlayers, RoomFlags roomFlags = const RoomFlags()}) → SwampRoom? -
connect(
NetworkerPipe< RpcNetworkerPacket, dynamic> pipe) → void -
inherited
-
decode(
RpcNetworkerPacket data) → RpcNetworkerPacket -
inherited
-
decodeChannel(
RpcNetworkerPacket data, Channel channel) → FutureOr< (RpcNetworkerPacket, Channel)?> -
inherited
-
disconnect(
NetworkerPipe< RpcNetworkerPacket, dynamic> pipe) → void -
inherited
-
dispose(
) → void -
Disposes all stream controllers and disconnects all connected pipes.
inherited
-
encode(
RpcNetworkerPacket data) → RpcNetworkerPacket -
inherited
-
encodeChannel(
RpcNetworkerPacket data, Channel channel) → FutureOr< (RpcNetworkerPacket, Channel)?> -
inherited
-
getChannelRoom(
Channel channel) → SwampRoom? -
getRoom(
Uint8List roomId) → SwampRoom? -
joinRoom(
Uint8List roomId, Channel player) → SwampRoom? - Attempts to add a player to a room.
-
leaveRoom(
Channel channel, {Channel? currentId, Uint8List? roomId}) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onMessage(
RpcNetworkerPacket data, [Channel channel = kAnyChannel]) → Future< void> -
inherited
-
removeRoom(
Uint8List roomId) → void -
sendMessage(
RpcNetworkerPacket data, [Channel channel = kAnyChannel]) → Future< void> -
inherited
-
sendMessageToRoom(
Channel sender, Channel receiver, Uint8List data) → void -
sendPacket(
RpcNetworkerPacket data, Channel channel) → FutureOr< void> -
inherited
-
sendRoomInfo(
Channel channel) → void -
setApplication(
Channel channel, Uint8List? data) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited