Main Page | Modules | File List | File Members

# Master server client functionalities

Master server client API. More...

## Functions
GSbool | MSClient_Initialize (const GSchar *szMasterServerIP, GSushort usMasterServerPort, const GSchar *szUserName, const GSchar *szPassword, const GSchar *szVersion)
| Initialize the library.
GSbool | MSClient_Uninitialize ()
| Uninitialize the library.
GSbool | MSClient_Engine (GSuint uiMaxPostingDelay=500, GSuint uiMaxsOperationalDelay=800)
| Runs the Library.
GSbool | MSClient_RequestMOTD (const GSchar *szLanguage)
| Request the message of the day.
GSbool | MSClient_RequestGameServers (const GSchar *szGameName)
| Request a new list of game servers.
GSbool | MSClient_RefreshGameServer (GSint iLobbyID, GSint iRoomID)
| Refresh certain Game Servers.
GSbool | MSClient_RequestAlternateInfo (GSint iLobbyID, GSint iRoomID)
| Request the alternate info of a game server.
GSbool | MSClient_JoinGameServer (GSint iLobbyID, GSint iRoomID, const GSchar *szPassword, const GSchar *szGSVersion, const GSchar *szGameName, const GSvoid *pvPlayerInfo, GSint iPlayerInfoSize)
| Tells the library to join a Game Server.
GSbool | MSClient_LeaveGameServer (GSint iLobbyID, GSint iRoomID)
| Leaves the Game Server.
GSbool | MSClient_GameServerConnected (GSint iLobbyID, GSint iRoomID)
| Leaves the Game Server.
GSbool | MSClient_CreateAccount (const GSchar *szMasterServerIP, GSushort usMasterServerPort, const GSchar *szVersion, const GSchar *szNickName, const GSchar *szPassword, const GSchar *szFirstName, const GSchar *szLastName, const GSchar *szEmail, const GSchar *szCountry)
| Create an account.
GSbool | MSClient_ModifyAccount (const GSchar *szPassword, const GSchar *szFirstName, const GSchar *szLastName, const GSchar *szEmail, const GSchar *szCountry)
| Create an account.
GSbool | MSClient_MatchStarted (GSint iLobbyID, GSint iRoomID)
| Tell the lobby server that the player is starting a match.
GSbool | MSClient_InitMatchResult (GSuint uiMatchID)
| Initialize the librairie score submission system.
GSbool | MSClient_SetMatchResult (GSchar *szAlias, GSuint uiFieldID, GSint iFieldValue)
| Set results for a player in a match.
GSbool | MSClient_SubmitMatchResult (GSint iLobbyID, GSint iRoomID)
| Send the compiled scores of a match to the lobby server.
GSbool | MSClient_UninitMatchResult ()
| Unload the internal score submission system.
GSbool | MSClient_MatchFinished (GSint iLobbyID, GSint iRoomID)
| Tell the lobby server that a match is finished.

## Detailed Description

API for the master server client library.

## Function Documentation

GSbool MSClient_CreateAccount | ( | const GSchar * | szMasterServerIP,
|  | GSushort | usMasterServerPort,
|  | const GSchar * | szVersion,
|  | const GSchar * | szNickName,
|  | const GSchar * | szPassword,
|  | const GSchar * | szFirstName,
|  | const GSchar * | szLastName,
|  | const GSchar * | szEmail,
|  | const GSchar * | szCountry
| ) |

  | Description: Create an account on the Game Service. This function has to be called before calling MSClient_Initialize() since that function requires a valid account. You must call MSClient_Engine() until you receive the callback MSClient_AccountCreationCB. Then you can call MSClient_Uninitialize() followed by MSClient_Initialize() with the created accounts username and password. Returns: The success of the Function Parameters:
  szMasterServerIP | The IP of the GSRouter
  usMasterServerPort | The port of the GSRotuer
  szVersion | Version of the player's client
  szNickName | Alias of the player
  szPassword | Password of the new player
  szFirstName | Player's first name
  szLastName | Player's last name
  szEmail | Player's email
  szCountry | Player's country

GSbool MSClient_Engine | ( | GSuint | uiMaxPostingDelay = 500,
|  | GSuint | uiMaxsOperationalDelay = 800
| ) |

  | Description: Sends and receives library messages Returns: the success of the Function Parameters:
  uiMaxPostingDelay | The maximum time to be spent inside the engine to read incomming messages and posting them to the message queue. (Milliseconds)
  uiMaxsOperationalDelay | The maximum time to be spent inside the engine to decode message in the queue and calling appropriate callback. (Milliseconds)

GSbool MSClient_GameServerConnected | ( | GSint | iLobbyID,
|  | GSint | iRoomID
| ) |

  | Description: Tells the Lobby Server and that the player has connected to the GameServer. Returns: The success of the Function Parameters:
  iLobbyID | The ID of the Lobby Server
  iRoomID | The ID of the Room.

GSbool MSClient_Initialize | ( | const GSchar * | szMasterServerIP,
|  | GSushort | usMasterServerPort,
|  | const GSchar * | szUserName,
|  | const GSchar * | szPassword,
|  | const GSchar * | szVersion
| ) |

  | Description: Initializes the library. This function will connect to and log on the Ubi.com network. Since this could take some time, the function returns and MSClient_InitFinishedCB is called to say when the login has finished. Returns: The success of the Function Parameters:
  szMasterServerIP | The IP of the GSRouter
  usMasterServerPort | The port of the GSRotuer
  szUserName | The players username
  szPassword | The players password
  szVersion | The client version

GSbool MSClient_InitMatchResult | ( | GSuint | uiMatchID | ) |

  | Description: Initialize the librairie score submission system, this has to be called before doing any other score submission-related function call. Note that you must initialise the score submission system prior to any match that will be submitted. This should be call after receiving the MatchStarted message, and the scores should be cleared after being submitted to the lobby server with LobbySend_SubmitMatchResult. Returns: The success of the Function Parameters:
  uiMatchID | The match unique id as returned by CBLobbyRcv_MatchStarted

GSbool MSClient_JoinGameServer | ( | GSint | iLobbyID,
|  | GSint | iRoomID,
|  | const GSchar * | szPassword,
|  | const GSchar * | szGSVersion,
|  | const GSchar * | szGameName,
|  | const GSvoid * | pvPlayerInfo,
|  | GSint | iPlayerInfoSize
| ) |

  | Description: This lets the Lobby Server and GSRouter know what Game Server a player is on. MSClient_JoinFinishedCB is called when the Game Server has been joined. Returns: The success of the Function Parameters:
  iLobbyID | The ID of the Lobby Server
  iRoomID | The ID of the Room.
  szPassword | The password of the Game Server to join
  szGSVersion | The GSVersion of the Game Server.
  szGameName | The Game Name of the Ggame Server.
  pvPlayerInfo | A buffer to send to the Game Server.
  iPlayerInfoSize | The size of the pvPlayerInfo buffer in bytes.

GSbool MSClient_LeaveGameServer | ( | GSint | iLobbyID,
|  | GSint | iRoomID
| ) |

  | Description: Tells the Lobby Server and GSRouter that the player has left the GameServer. Returns: The success of the Function Parameters:
  iLobbyID | The ID of the Lobby Server
  iRoomID | The ID of the Room.

GSbool MSClient_MatchFinished | ( | GSint | iLobbyID,
|  | GSint | iRoomID
| ) |

  | Description: Tell the lobby server that the match you were playing has Finished Everyone in the room has to call this function to confirm the end of the match after submiting the scores Returns: Status of the function call Parameters:
  iLobbyID | The ID of the Lobby Server
  iRoomID | The ID of the Room.

GSbool MSClient_MatchStarted | ( | GSint | iLobbyID,
|  | GSint | iRoomID
| ) |

  | Description: Tell the lobby server that the match you are starting a match This should be called after receiving the MSClient_MatchStartedCB callback. Everyone in the room who will be submiting scores for the match has to call this function. Returns: Status of the function call Parameters:
  iLobbyID | The ID of the Lobby Server
  iRoomID | The ID of the Room.

GSbool MSClient_ModifyAccount | ( | const GSchar * | szPassword,
|  | const GSchar * | szFirstName,
|  | const GSchar * | szLastName,
|  | const GSchar * | szEmail,
|  | const GSchar * | szCountry
| ) |

  | Description: Modifies an account on the Game Service. The success of the modification is received by the MSClient_ModifyAccountCB callback. Returns: The success of the Function Parameters:
  szPassword | Password of the new player
  szFirstName | Player's first name
  szLastName | Player's last name
  szEmail | Player's email
  szCountry | Player's country

GSbool MSClient_RefreshGameServer | ( | GSint | iLobbyID,
|  | GSint | iRoomID
| ) |

  | Description: Refresh the given Game Server. MSClient_GameServerCB is called for the Game Server refreshed. Returns: the success of the Function Parameters:
  iLobbyID | The ID of the Lobby Server
  iRoomID | The ID of the Room.

GSbool MSClient_RequestAlternateInfo | ( | GSint | iLobbyID,
|  | GSint | iRoomID
| ) |

  | Description: Request the alternate information for the given Game Server. MSClient_AlternateInfoCB is called for when the request is received. Returns: The success of the Function. Parameters:
  iLobbyID | The ID of the Lobby Server
  iRoomID | The ID of the Room.

GSbool MSClient_RequestGameServers | ( | const GSchar * | szGameName | ) |

  | Description: Request a list of Game Servers based on the ugly game name. MSClient_GameServerCB is called for each Game Server received. MSClient_RequestFinishedCB is called when the list is finished. You can call MSClient_JoinGameServer before the list is finished. Returns: the success of the Function Parameters:
  szGameName | The game name of the servers to request

GSbool MSClient_RequestMOTD | ( | const GSchar * | szLanguage | ) |

  | Description: This function asks the server to send the message of the day based the client version and the requested language. If the requested language is not available it will default to english. Callbacks: MSClient_RequestMOTDCB Returns: Status of the function call Return values:
  GS_TRUE | Account created successfully
  GS_FALSE | Failure to create account
  Parameters:
  szLanguage | The language to receive the MOTD in.

GSbool MSClient_SetMatchResult | ( | GSchar * | szAlias,
|  | GSuint | uiFieldID,
|  | GSint | iFieldValue
| ) |

  | Description: Set the result for a player in a match in the library's score submission system. Each player should set the result for each other player that where in the match including himself. This will insure validity of scores submitted to the LobbyServer. Returns: The success of the Function Parameters:
  szAlias | The alias of the player associated with the results
  uiFieldID | The result field id
  iFieldValue | The actual value that will be set for the specified field

GSbool MSClient_SubmitMatchResult | ( | GSint | iLobbyID,
|  | GSint | iRoomID
| ) |

  | Description: Send the compiled scores of a match to the lobby server for archiving, this will send a message to the lobby server and set the match result on the server-side. You will receive a confirmation of the message sent with the MSClient_SubmitMatchCB callback. Returns: Status of the function call Parameters:
  iLobbyID | The ID of the Lobby Server
  iRoomID | The ID of the Room.

GSbool MSClient_Uninitialize | ( |  | ) |

| Description: Uninitializes the library and frees all allocated memory Returns: the success of the Function

GSbool MSClient_UninitMatchResult | ( |  | ) |

| Description: Unload the internal score submission system previously initialized for a specific match. Must be called after scores has been submitted to the lobby server. Returns: Status of the function call

Ubi.com GameService SDK - ©UbiSoft Entertainment 2002
GameService development team