|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Describes the Room to be created by a CreateRoomRequest. More...
#include <RoomSettings.h>
Public Member Functions | |
| RoomSettings (std::string name) | |
Public Attributes | |
| std::string | name |
| The name of the Room; must not be empty. | |
| std::string | password |
| The password required to join the Room; empty means no password. | |
| std::string | groupId = entities::DEFAULT_ROOM_GROUP_ID |
| The id of the Group to which the Room belongs. | |
| bool | isGame = false |
| Whether the Room is a Game Room (and can host players and spectators). | |
| int32_t | maxUsers = 10 |
| The maximum number of users (players in a Game Room) allowed inside the Room. | |
| int32_t | maxSpectators = 0 |
| The maximum number of spectators allowed inside the Room; Game Rooms only. | |
| int32_t | maxVariables = 5 |
| The maximum number of Room Variables the Room can hold. | |
| bool | allowOwnerOnlyInvitation = true |
| Whether only the Room's owner can invite other users to join it. | |
| std::vector< entities::SFSRoomVariable > | variables |
| The Room Variables to set on the Room as it is created. | |
| std::optional< RoomPermissions > | permissions |
| The Room's permissions; when unset the server applies its own default. | |
| std::optional< RoomEvents > | events |
| The events the Room fires; when unset the server applies its own default. | |
| std::optional< RoomExtension > | extension |
| The server side Extension to attach to the Room; when unset the Room has none. | |
| std::optional< GameSettings > | gameSettings |
| The Game Room settings. | |
| std::optional< MMOSettings > | mmoSettings |
| The MMORoom settings; when unset a regular Room is created. | |
Describes the Room to be created by a CreateRoomRequest.
Only the name is mandatory; every other member carries the same default the Java and Swift APIs use. The defaults are always sent to the server, which has defaults of its own that don't always match (for example maxVariables defaults to 0 server side).
requests::RoomSettings settings { "lobby" }; settings.maxUsers = 40; settings.variables.push_back(entities::SFSRoomVariable { "motd", std::string("welcome") }); requests::RoomPermissions perms; perms.allowResizing = true; settings.permissions = perms; sfs.send(requests::CreateRoomRequest(settings));
|
inline |
| name | the name of the Room to create |
| std::optional<GameSettings> sfs3::requests::RoomSettings::gameSettings |
The Game Room settings.
Required by CreateSFSGameRequest, which rejects settings without them; ignored by a plain CreateRoomRequest.
| std::optional<MMOSettings> sfs3::requests::RoomSettings::mmoSettings |
The MMORoom settings; when unset a regular Room is created.
The Room comes back from the server as an entities::MMORoom, carrying the area of interest and the map limits. Once joined, send a SetUserPositionRequest to take part in the proximity system and start receiving PROXIMITY_LIST_UPDATE events.