SmartFoxServer 2X C++ API
|
The Room object represent a server Room. More...
#include <SFSRoom.h>
Public Member Functions | |
boost::shared_ptr< string > | Name () |
The Room name More... | |
void | Name (string value) |
The Room name More... | |
boost::shared_ptr< string > | GroupId () |
The Room Group. Each Room is assigned to its Group. More... | |
bool | IsGame () |
Determines if a Room is a Game Room More... | |
void | IsGame (bool value) |
Determines if a Room is a Game Room More... | |
bool | IsHidden () |
Determines if the Room is hidden More... | |
void | IsHidden (bool value) |
Determines if the Room is hidden More... | |
bool | IsJoined () |
Returns true if the Room is joined by the current User More... | |
void | IsJoined (bool value) |
Returns true if the Room is joined by the current User More... | |
bool | IsPasswordProtected () |
Returns true if the Room requires a password for joining it More... | |
void | IsPasswordProtected (bool value) |
Returns true if the Room requires a password for joining it More... | |
boost::shared_ptr< vector< boost::shared_ptr< RoomVariable > > > | GetVariables () |
Returns all the Room Variables More... | |
boost::shared_ptr< RoomVariable > | GetVariable (string name) |
Get a Room Variable More... | |
long int | UserCount () |
Get the current number of users More... | |
void | UserCount (long int value) |
Get the current number of users More... | |
long int | MaxUsers () |
Get the maximum number of users allowed for this Room More... | |
void | MaxUsers (long int value) |
Get the maximum number of users allowed for this Room More... | |
long int | Capacity () |
Returns the max amount of users (both Users and Spectators) that can be contained in this room More... | |
long int | SpectatorCount () |
Get the number of spectators (only for Game Rooms) More... | |
void | SpectatorCount (long int value) |
Get the number of spectators (only for Game Rooms) More... | |
boost::shared_ptr< User > | GetUserByName (string name) |
Get a User from its name More... | |
boost::shared_ptr< User > | GetUserById (long int id) |
Get a User from its ID More... | |
boost::shared_ptr< vector< boost::shared_ptr< User > > > | UserList () |
Get the full list of users in the Room More... | |
bool | ContainsVariable (string name) |
Check for the presence of a Room Variable More... | |
bool | ContainsUser (boost::shared_ptr< User > user) |
Checks if a User is joined in this Room More... | |
The Room object represent a server Room.
The client API don't know about all Rooms on the server side but only about those that are joined and those in the Room Groups that were subscribed.
Subscribing to one or more Group allows the client to listen for Room events in specific "areas" of the Zone without having to know and download details for all Rooms available.
The RoomList is created after a succesful login in the SmartFox.RoomList
object and it is kept updated at all times by the Server.
long int Sfs2X::Entities::SFSRoom::Capacity | ( | ) |
Returns the max amount of users (both Users and Spectators) that can be contained in this room
bool Sfs2X::Entities::SFSRoom::ContainsUser | ( | boost::shared_ptr< User > | user | ) |
bool Sfs2X::Entities::SFSRoom::ContainsVariable | ( | string | name | ) |
Check for the presence of a Room Variable
name | A string pointer |
boost::shared_ptr< User > Sfs2X::Entities::SFSRoom::GetUserById | ( | long int | id | ) |
boost::shared_ptr< User > Sfs2X::Entities::SFSRoom::GetUserByName | ( | string | name | ) |
boost::shared_ptr< RoomVariable > Sfs2X::Entities::SFSRoom::GetVariable | ( | string | name | ) |
Get a Room Variable
name | the name of the variable |
boost::shared_ptr< vector< boost::shared_ptr< RoomVariable > > > Sfs2X::Entities::SFSRoom::GetVariables | ( | ) |
Returns all the Room Variables
boost::shared_ptr< string > Sfs2X::Entities::SFSRoom::GroupId | ( | ) |
The Room Group. Each Room is assigned to its Group.
By default SmartFoxServer uses one single group called default
bool Sfs2X::Entities::SFSRoom::IsGame | ( | ) |
Determines if a Room is a Game Room
void Sfs2X::Entities::SFSRoom::IsGame | ( | bool | value | ) |
Determines if a Room is a Game Room
bool Sfs2X::Entities::SFSRoom::IsHidden | ( | ) |
Determines if the Room is hidden
void Sfs2X::Entities::SFSRoom::IsHidden | ( | bool | value | ) |
Determines if the Room is hidden
bool Sfs2X::Entities::SFSRoom::IsJoined | ( | ) |
Returns true if the Room is joined by the current User
void Sfs2X::Entities::SFSRoom::IsJoined | ( | bool | value | ) |
Returns true if the Room is joined by the current User
bool Sfs2X::Entities::SFSRoom::IsPasswordProtected | ( | ) |
Returns true if the Room requires a password for joining it
void Sfs2X::Entities::SFSRoom::IsPasswordProtected | ( | bool | value | ) |
Returns true if the Room requires a password for joining it
long int Sfs2X::Entities::SFSRoom::MaxUsers | ( | ) |
Get the maximum number of users allowed for this Room
void Sfs2X::Entities::SFSRoom::MaxUsers | ( | long int | value | ) |
Get the maximum number of users allowed for this Room
boost::shared_ptr< string > Sfs2X::Entities::SFSRoom::Name | ( | ) |
The Room name
void Sfs2X::Entities::SFSRoom::Name | ( | string | value | ) |
The Room name
long int Sfs2X::Entities::SFSRoom::SpectatorCount | ( | ) |
Get the number of spectators (only for Game Rooms)
void Sfs2X::Entities::SFSRoom::SpectatorCount | ( | long int | value | ) |
Get the number of spectators (only for Game Rooms)
long int Sfs2X::Entities::SFSRoom::UserCount | ( | ) |
Get the current number of users
If the room is joined the user count is taken from the Room's UserManager otherwise we return the static counter (which will work only if you have activated the uCount updates)
void Sfs2X::Entities::SFSRoom::UserCount | ( | long int | value | ) |
Get the current number of users
If the room is joined the user count is taken from the Room's UserManager otherwise we return the static counter (which will work only if you have activated the uCount updates)
boost::shared_ptr< vector< boost::shared_ptr< User > > > Sfs2X::Entities::SFSRoom::UserList | ( | ) |
Get the full list of users in the Room