wavelength 1.0.0
Loading...
Searching...
No Matches
netarbiter.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
7#include "os/command.h"
8#include "os/ptr.h"
9
19public:
27 explicit NetArbiter(GameTrackSelector *pGameTrackSelector);
28
35 void Start();
36
45 void RequestTrack(int nPlayer, int nTrack);
46
56 void UpdatePlayer(int nPlayer, int nTrack, int nVersion);
57
64 void Broadcast();
65
73 void RemovePlayer(int nPlayer);
74
83 int GetTrack(int nPlayer);
84
91 static int sVersion;
92
93private:
94 GameTrackSelector *mGameTrackSelector;
95 TrackSelector mTrackSelector;
96 int mLocalPlayer;
97 Ptr<Command> mBroadcastCommand;
98 std::vector<int> mVersions;
99 float mDelayMs;
100};
Assignment of the players of a game to its tracks, with the rotation between the tracks.
Definition gametrackselector.h:18
void RemovePlayer(int nPlayer)
Take a player off every track.
int GetTrack(int nPlayer)
Report the track the arbiter assigns a player.
NetArbiter(GameTrackSelector *pGameTrackSelector)
Take over the assignment of a game's track selector.
void UpdatePlayer(int nPlayer, int nTrack, int nVersion)
Settle a player's move to a track.
void Broadcast()
Send the assignment to every console and schedule the next send.
void RequestTrack(int nPlayer, int nTrack)
Schedule the settling of a player's request to move to a track.
void Start()
Send the first assignment.
static int sVersion
Sequence number of the last ArbiterPacket sent.
Definition netarbiter.h:91
Owner of one reference to an Attachment.
Definition ptr.h:16
Assignment of the players to the tracks and to the slots of each track, in the order the players arri...
Definition trackselector.h:11