|
TM_World * | AddWorld (WorldId worldId) |
| Allocate a world to hold a list of teams and players for that team. Use the returned TM_World object for actual team functionality.
|
|
void | RemoveWorld (WorldId worldId) |
| Deallocate a world created with AddWorld()
|
|
unsigned int | GetWorldCount (void) const |
|
TM_World * | GetWorldAtIndex (unsigned int index) const |
|
TM_World * | GetWorldWithId (WorldId worldId) const |
|
void | SetAutoManageConnections (bool autoAdd) |
| When auto managing connections, call TM_World::AddParticipant() on all worlds for all new connections automatically Defaults to true.
|
|
void | SetTopology (TMTopology _topology) |
| If _topology is set to TM_CLIENT_SERVER, the host will relay messages to participants.
|
|
void | DecomposeTeamFull (Packet *packet, TM_World **world, TM_TeamMember **teamMember, TM_Team **team, uint16_t ¤tMembers, uint16_t &memberLimitIncludingBalancing, bool &balancingIsActive, JoinPermissions &joinPermissions) |
| When you get ID_TEAM_BALANCER_REQUESTED_TEAM_FULL, pass the packet to this function to read out parameters.
|
|
void | DecomposeTeamLocked (Packet *packet, TM_World **world, TM_TeamMember **teamMember, TM_Team **team, uint16_t ¤tMembers, uint16_t &memberLimitIncludingBalancing, bool &balancingIsActive, JoinPermissions &joinPermissions) |
| When you get ID_TEAM_BALANCER_REQUESTED_TEAM_LOCKED, pass the packet to this function to read out parameters.
|
|
void | Clear (void) |
| Clear all memory and reset everything.
|
|
void | DecodeTeamAssigned (Packet *packet, TM_World **world, TM_TeamMember **teamMember) |
| Reads out the world and teamMember from ID_TEAM_BALANCER_TEAM_ASSIGNED.
|
|
void | DecodeTeamCancelled (Packet *packet, TM_World **world, TM_TeamMember **teamMember, TM_Team **teamCancelled) |
|
virtual void | OnAttach (void) |
| Called when the interface is attached.
|
|
virtual void | OnDetach (void) |
| Called when the interface is detached.
|
|
virtual void | OnRakPeerStartup (void) |
| Called when RakPeer is initialized.
|
|
virtual void | OnRakPeerShutdown (void) |
| Called when RakPeer is shutdown.
|
|
virtual void | OnFailedConnectionAttempt (Packet *packet, PI2_FailedConnectionAttemptReason failedConnectionAttemptReason) |
|
virtual bool | UsesReliabilityLayer (void) const |
|
virtual void | OnDirectSocketSend (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
|
virtual void | OnDirectSocketReceive (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
|
virtual void | OnReliabilityLayerNotification (const char *errorMessage, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress, bool isError) |
|
virtual void | OnInternalPacket (InternalPacket *internalPacket, unsigned frameNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time, int isSend) |
|
virtual void | OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time) |
|
virtual void | OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
|
|
virtual void | Update (void) |
| Update is called every time a packet is checked for .
|
|
virtual PluginReceiveResult | OnReceive (Packet *packet) |
|
virtual void | OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason) |
|
virtual void | OnNewConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming) |
|
void | DecodeTeamAssigned (RakNet::BitStream *bsIn, TM_World **world, TM_TeamMember **teamMember, NoTeamId &noTeamSubcategory, JoinTeamType &joinTeamType, DataStructures::List< TM_Team * > &newTeam, DataStructures::List< TM_Team * > &teamsLeft, DataStructures::List< TM_Team * > &teamsJoined) |
| When you get ID_TEAM_BALANCER_TEAM_ASSIGNED, pass the packet to this function to read out parameters.
|
|
Automates networking and list management for teams.
TeamManager provides support for teams. A team is a list of team members. Teams contain properties including the number of team members per team, whether or not tagged teams must have equal numbers of members, and if a team is locked or not to certain entry conditions Team members contain properties including which teams they are on and which teams they want to join if a team is not immediately joinable Advanced functionality includes the ability for a team member to be on multiple teams simultaneously, the ability to swap teams with other members, and the ability to resize the number of members supported per team The architecture is designed for easy integration with ReplicaManager3
Usage:
- Define your game classes to represent teams and team members. Your game classes should hold game-specific information such as team name and color.
- Have those game classes contain a corresponding TM_Team or TM_TeamMember instance. Operations on teams will be performed by those instances. Use SetOwner() to refer to the parent object when using composition.
- Call TeamManager::SetTopology() for client/server or peer to peer.
- Call AddWorld() to instantiate a TM_World object which will contain references to your TM_TeamMember and TM_Team instances.
- When you instantiate a TM_TeamMember or TM_Team object, call ReferenceTeam() and ReferenceTeamMember() for each corresponding object
- When sending world state to a new connection, for example in ReplicaManager3::SerializeConstruction(), call TM_SerializeConstruction() on the corresponding TM_TeamMember and TM_Team objects. TM_Team instances on the new connection must be created before TM_TeamMember instances.
- Call TM_DeserializeConstruction() on your new corresponding TM_TeamMember and TM_Team instances.
- Execute team operations. ID_TEAM_BALANCER_REQUESTED_TEAM_FULL, ID_TEAM_BALANCER_REQUESTED_TEAM_LOCKED, ID_TEAM_BALANCER_TEAM_REQUESTED_CANCELLED, and ID_TEAM_BALANCER_TEAM_ASSIGNED are returned to all systems when the corresponding event occurs for a team member.
- As the peer to peer session host changes, call SetHost() (Not necessary if using FullyConnectedMesh2). If using client/server, you must set the host
- Note
- This replaces TeamBalancer. You cannot use TeamBalancer and TeamManager at the same time.