RakNet  4.0
Public Member Functions | List of all members
RakNet::TM_Team Class Reference

A team, containing a list of TM_TeamMember instances. More...

#include <TeamManager.h>

Public Member Functions

bool SetMemberLimit (TeamMemberLimit _teamMemberLimit, NoTeamId noTeamSubcategory)
 Set the maximum number of members that can join this team. Defaults to 65535 Setting the limit lower than the existing number of members kicks members out, and assigns noTeamSubcategory to them if they have no other team to go to Setting the limit higher allows members to join in. If a member has a pending request to join this team, they join automatically and ID_TEAM_BALANCER_TEAM_ASSIGNED will be returned for those members.
 
TeamMemberLimit GetMemberLimit (void) const
 
TeamMemberLimit GetMemberLimitSetting (void) const
 
bool SetJoinPermissions (JoinPermissions _joinPermissions)
 Who can join this team under what conditions, while the team is not full To not allow new joins, pass 0 To allow all new joins under any circumstances, bitwise-OR all permission defines. For an invite-only team, use ALLOW_JOIN_SPECIFIC_TEAM only and only allow the requester to call TM_TeamMember::RequestTeam() upon invitiation through your game code. Defaults to allow all.
 
JoinPermissions GetJoinPermissions (void) const
 
void LeaveTeam (TM_TeamMember *teamMember, NoTeamId noTeamSubcategory)
 Removes a member from a team he or she is on.
 
bool GetBalancingApplies (void) const
 
void GetTeamMembers (DataStructures::List< TM_TeamMember * > &_teamMembers) const
 
unsigned int GetTeamMembersCount (void) const
 
TM_TeamMemberGetTeamMemberByIndex (unsigned int index) const
 
NetworkID GetNetworkID (void) const
 
TM_WorldGetTM_World (void) const
 
void SerializeConstruction (BitStream *constructionBitstream)
 Used by the host to serialize the initial state of this object to a new system.
 
bool DeserializeConstruction (TeamManager *teamManager, BitStream *constructionBitstream)
 Used by non-host systems to read the bitStream written by SerializeConstruction()
 
void SetOwner (void *o)
 
void * GetOwner (void) const
 
unsigned int GetWorldIndex (void) const
 Return world->GetTeamIndex(this)
 

Detailed Description

A team, containing a list of TM_TeamMember instances.

Contains lists of TM_TeamMember instances Best used as a composite member of your "Team" or "PlayerList" class(es). When using with ReplicaManager3, call TM_Team::ReferenceTeam() in Replica3::DeserializeConstruction() and TM_Team::DeserializeConstruction() in Replica3::PostDeserializeConstruction() There is otherwise no need to manually serialize the class, as operations are networked internally.

Member Function Documentation

bool RakNet::TM_Team::DeserializeConstruction ( TeamManager teamManager,
BitStream constructionBitstream 
)

Used by non-host systems to read the bitStream written by SerializeConstruction()

On non-host systems, after creating existing objects, call DeserializeConstruction() to read and setup that object Creating the actual Team and TeamMember objects should be handled by your game code, or a system such as ReplicaManager3

bool RakNet::TM_Team::GetBalancingApplies ( void  ) const
Returns
What was passed as the applyBalancing parameter TM_World::ReferenceTeam() when this team was added.
JoinPermissions RakNet::TM_Team::GetJoinPermissions ( void  ) const
Returns
Whatever was passed to SetJoinPermissions(), or the default.
TeamMemberLimit RakNet::TM_Team::GetMemberLimit ( void  ) const
Returns
If team balancing is on, the most members that can be on this team that would not either unbalance it or exceed the value passed to SetMemberLimit(). If team balancing is off, the same as GetMemberLimitSetting()
TeamMemberLimit RakNet::TM_Team::GetMemberLimitSetting ( void  ) const
Returns
What was passed to SetMemberLimit() or the default
NetworkID RakNet::TM_Team::GetNetworkID ( void  ) const
Returns
The teamID parameter passed to TM_World::ReferenceTeam()
void* RakNet::TM_Team::GetOwner ( void  ) const
Returns
Whatever was passed to SetOwner()
TM_TeamMember* RakNet::TM_Team::GetTeamMemberByIndex ( unsigned int  index) const
Returns
A team member on this team. Members are stored in the order they are added
Parameters
[in]indexA value between 0 and GetTeamMembersCount()
void RakNet::TM_Team::GetTeamMembers ( DataStructures::List< TM_TeamMember * > &  _teamMembers) const
Parameters
[out]Allteam members of this team
unsigned int RakNet::TM_Team::GetTeamMembersCount ( void  ) const
Returns
The number of team members on this team
TM_World* RakNet::TM_Team::GetTM_World ( void  ) const
Returns
The TM_World instance that was used when calling TM_World::ReferenceTeamMember()
void RakNet::TM_Team::LeaveTeam ( TM_TeamMember teamMember,
NoTeamId  noTeamSubcategory 
)

Removes a member from a team he or she is on.

Identical to teamMember->LeaveTeam(this, noTeamSubcategory); See TeamMember::LeaveTeam() for details.

Parameters
[in]teamMemberWhich team member to remove
[in]noTeamSubcategoryIf the team member has been removed from all teams, which subcategory of NoTeamId to set them to
void RakNet::TM_Team::SerializeConstruction ( BitStream constructionBitstream)

Used by the host to serialize the initial state of this object to a new system.

On the host, when sending existing objects to a new system, call SerializeConstruction() on each of those objects to serialize creation state. Creating the actual Team and TeamMember objects should be handled by your game code, or a system such as ReplicaManager3

bool RakNet::TM_Team::SetJoinPermissions ( JoinPermissions  _joinPermissions)

Who can join this team under what conditions, while the team is not full To not allow new joins, pass 0 To allow all new joins under any circumstances, bitwise-OR all permission defines. For an invite-only team, use ALLOW_JOIN_SPECIFIC_TEAM only and only allow the requester to call TM_TeamMember::RequestTeam() upon invitiation through your game code. Defaults to allow all.

Parameters
[in]_joinPermissionsBitwise combination of ALLOW_JOIN_ANY_AVAILABLE_TEAM, ALLOW_JOIN_SPECIFIC_TEAM, ALLOW_JOIN_REBALANCING
Returns
false On invalid or unnecessary operation. Otherwise returns true
bool RakNet::TM_Team::SetMemberLimit ( TeamMemberLimit  _teamMemberLimit,
NoTeamId  noTeamSubcategory 
)

Set the maximum number of members that can join this team. Defaults to 65535 Setting the limit lower than the existing number of members kicks members out, and assigns noTeamSubcategory to them if they have no other team to go to Setting the limit higher allows members to join in. If a member has a pending request to join this team, they join automatically and ID_TEAM_BALANCER_TEAM_ASSIGNED will be returned for those members.

Parameters
[in]_teamMemberLimitThe new limit
[in]noTeamSubcategoryWhich noTeamSubcategory to assign to members that now have no team.
Returns
false On invalid or unnecessary operation. Otherwise returns true
void RakNet::TM_Team::SetOwner ( void *  o)
Parameters
[in]oStores a void* for your own use. If using composition, this is useful to store a pointer to the containing object.

The documentation for this class was generated from the following file: