Pie Noon
An open source project by FPL.
 All Classes Pages
fpl::GPGMultiplayer Class Reference

Public Types

enum  MultiplayerState {
  kIdle = 0, kAdvertising = 1, kAdvertisingPromptedUser = 2, kDiscovering = 3,
  kDiscoveringPromptedUser = 4, kDiscoveringWaitingForHost = 5, kConnected = 6, kConnectedWithDisconnections = 7,
  kError = 8
}
 
enum  DialogResponse { kDialogNo, kDialogYes, kDialogWaiting }
 
typedef std::pair< std::string,
std::vector< uint8_t > > 
SenderAndMessage
 

Public Member Functions

bool Initialize (const std::string &service_id)
 
void AddAppIdentifier (const std::string &identifier)
 
void Update ()
 
void StartAdvertising ()
 
void StopAdvertising ()
 
void StartDiscovery ()
 
void StopDiscovery ()
 
void DisconnectInstance (const std::string &instance_id)
 
void DisconnectAll ()
 
void ResetToIdle ()
 
void set_my_instance_name (const std::string &my_instance_name)
 
MultiplayerState state () const
 
bool IsConnected () const
 
bool IsAdvertising () const
 
bool IsDiscovering () const
 
bool HasError () const
 
int GetNumConnectedPlayers ()
 
bool is_hosting () const
 
std::string GetInstanceIdByPlayerNumber (unsigned int player)
 
int GetPlayerNumberByInstanceId (const std::string &instance_id)
 
bool SendMessage (const std::string &instance_id, const std::vector< uint8_t > &payload, bool reliable)
 
void BroadcastMessage (const std::vector< uint8_t > &payload, bool reliable)
 
bool HasMessage ()
 
SenderAndMessage GetNextMessage ()
 
bool HasReconnectedPlayer ()
 
int GetReconnectedPlayer ()
 
void set_max_connected_players_allowed (int players)
 
int max_connected_players_allowed () const
 
void set_auto_connect (bool b)
 
bool auto_connect () const
 
void set_allow_reconnecting (bool b)
 
bool allow_reconnecting () const
 

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