## Engine
Class MatchMakingManager

source: C:\XIII\Engine\Classes\MatchMakingManager.uc

    Core.Object
       |
       +--Engine.MatchMakingManager

Direct Known Subclasses:None

class MatchMakingManager
extends Core.Object

    // This class is the front-end to access the match-making capabilities buried inside the engine.

Variables
`string` | `Alias` the name of the player
`string` | `AltIPAddress` Its Alternate IP address
`string` | `AltIPAddress` Its Alternate IP address
`int` | `CurrentNbPlayers` The current nb of players in the game
`int` | `CurrentNbSpectators` The current nb of spectators in the game
`string` | `FailureMessages[106]` une ligne de texte d
`int` | `GameServerId` The Id of the game server
`string` | `IPAddress` Its IP address
`string` | `IPAddress` Its IP address
`int` | `IsSpectator` is he a spectator ?
`int` | `MaxNbPlayers` The max number of players allowed in
`int` | `MaxNbSpectators` The max number of spectators allowed in
`string` | `Name` Its name
`string` | `combinationName` ce champ on peut s'en passer
`string` | `devName` le nom du hard associ
`int` | `error` un code d'erreur eventuel
`string` | `ifcName` le nom utilisateur, affichable de la config
`string` | `ifname` nom de l'interface physique (eth0 ...)
`string` | `ifname2` nom de l'interface virtuelle (pppoe0 dans le cas o
`int` | `iftype` d
`int` | `iftype` d
`int` | `link` dans le cas ethernet,
`string` | `message` une ligne de texte d
`int` | `phase` code d
`int` | `state` code d
`int` | `status` permet de rep

Function Summary
`void` | `AllGameServer(out MMGameServer)`
    //========================  ========================
`void` | `AllPlayerConnectedToMyGameServer(out MMPlayer)`
`void` | `CheckAccountValidity(string _Alias, string _Password)`
`void` | `CreatePlayerAccount(string _Alias, string _Password, string _FirstName, string _LastName, string _Email, string _Country)`
    // create a user account on Game Service network (before login)
`void` | `IFinishMatch()`
`void` | `IStartMatch()`
    //========================  ========================
`bool` | `IsAccountValidityChecked(out int)`
`bool` | `IsConnectionLostWithGS()`
    //======================== connection reset by GS ? ========================
`bool` | `IsGameServerAdditionalInfoArrived(out int, out string)`
`bool` | `IsGameServerListComplete(out int)`
`bool` | `IsGameServerRefreshed(out int)`
`bool` | `IsJoinGameServerAcknowledged(out int, out string, out string, out int)`
`bool` | `IsMatchFinishedAcknowledged(out int)`
`bool` | `IsMatchStartedByGameServer()`
    //========================  ========================
`bool` | `IsMyGameServerRegistered(out int)`
`bool` | `IsMyGameServerStillRegistered()`
`bool` | `IsMyGameServerUpdated(out int)`
`bool` | `IsPlayerAccountCreated(out int)`
`bool` | `IsPlayerAccountModified(out int)`
`bool` | `IsStartMatchAcknowledged(out int)`
`void` | `JoinGameServer(int _GameServerID, string _Password)`
    //========================  ========================
`void` | `LeaveGameServer()`
    //========================  ========================
`void` | `Login(string _Alias, string _Password)`
    //======================== Login ========================
    // Send a request to log a player in the match making system. The name (_Alias) and password (_Password) are required.
`void` | `Logout()`
`void` | `MatchFinished()`
`void` | `ModifyPlayerAccount(string _Password, string _FirstName, string _LastName, string _Email, string _Country)`
    // Modify user account
`int` | `PSX2DNASAuthenticate()`
    // start DNAS authentication (asynchronous function)
`void` | `PSX2DNASExit()`
    // exit DNAS stuff (load the proper overlay)
`int` | `PSX2DNASInit(int ng)`
    // init DNAS stuff (load the proper overlay)
`int` | `PSX2DNASProgress(out int, out int, out int)`
    // check authentication progress
`int` | `PSX2McCheckPort(out int, out int)`
    // Check presence of memory card in each slot
    // Return code:
    //              - <0 if error
    //              - >=0 if success
    //                  Port0, Port1: contains 1 if a memory card is present in the corresponding slot, 0 otherwise
`void` | `PSX2NetCnfExit()`
    // exit config choice
`void` | `PSX2NetCnfGetCombination(int index, out PSX2NetCnfCombination)`
    // Iterate config list
    // index: between 1 and the number of config obtained
    // combination: a structure that contains info on the config
`int` | `PSX2NetCnfGetCombinationList(string netdb)`
    // [Asynchronous operation] Get a list of config on a memory card
    // netdb: media identifier (mc0 or mc1 for memory card)
    // return value: <0 if error, else operation started successfully
    // When the operation is over, PSX2NetCnfGetResult() will give:
    //              - number of config on the media (6 max for a memory card, 0 if none)
    //              - <0 if error
`int` | `PSX2NetCnfGetDefault()`
    // Get default config
`int` | `PSX2NetCnfGetResult()`
    // Get the result of an asynchronous operation (once over)
`int` | `PSX2NetCnfGetState()`
    // Wait for the end of an asynchronous operation
    // return value:
    //              1 - still executing
    //              0 - operation over. The result can be obtained with PS2NetCnfGetResult()
`void` | `PSX2NetCnfInit()`
    // init config choice
`int` | `PSX2NetCnfSelectCombination(int index)`
    // [Asynchronous operation] Select a config
    // index: index of the config to use
    // return value: <0 if error, else operation started successfully
    // When the operation is over, PSX2NetCnfGetResult() will give:
    //              - <0 if error
    //              - >=0 if success
`int` | `PSX2NetCtlBind()`
    // [Asynchronous operation] Attach config to the network interface
    // When the operation is over, PSX2NetCnfGetResult() will give:
    //              - <0 if error
    //              - >=0 if success
`int` | `PSX2NetCtlDown()`
    // End network connection
    // Return code:
    //              - <0 if error
    //              - >=0 if success
`void` | `PSX2NetCtlExit()`
    // exit network activation
`int` | `PSX2NetCtlGetStatus(out PSX2NetCnfStatus)`
    // Test the state of the connection
    // return code: possible errors
`void` | `PSX2NetCtlInit()`
    // init network activation
`int` | `PSX2NetCtlUp()`
    // Start network connection
    // Return code:
    //              - <0 if error
    //              - >=0 if success
`void` | `PSX2SwitchToOfflineMode()`
`int` | `PSX2SwitchToOnlineMode()`
    //
    //
    // A more PS2-specific interface
    //
    //
`void` | `RefreshGameServer(int _GameServerID)`
`void` | `RegisterMyGameServer(string _Name, int _MaxPlayers, int _MaxSpectators, string _Password, string _Info, string _AdditionalInfo, int _Port, bool _IsDedicated)`
`void` | `RequestGameServerAdditionalInfo(int _GameServerID)`
    //========================  ========================
`void` | `RequestGameServerList()`
    //========================  ========================
`void` | `StartMatch()`
`void` | `UnregisterMyGameServer()`
`void` | `UpdateMyGameServer(int _MaxPlayers, int _MaxSpectators, string _Password, string _Info, string _AdditionalInfo, int _Port)`

Source Code

    00001	// This class is the front-end to access the match-making capabilities buried inside the engine.
    00002
    00003	class MatchMakingManager extends Object
    00004		native
    00005	    transient;
    00006
    00007
    00008
    00009	// a game server
    00010	struct MMGameServer
    00011	{
    00012	    var int GameServerId;	    // The Id of the game server
    00013	    var string Name;            // Its name
    00014	    var string IPAddress;       // Its IP address
    00015	    var string AltIPAddress;    // Its Alternate IP address
    00016	    var int MaxNbPlayers;       // The max number of players allowed in
    00017	    var int MaxNbSpectators;    // The max number of spectators allowed in
    00018	    var int CurrentNbPlayers;   // The current nb of players in the game
    00019	    var int CurrentNbSpectators;// The current nb of spectators in the game
    00020		var string GameDesc;        // Description of the game
    00021	};
    00022
    00023
    00024	struct MMPlayer
    00025	{
    00026	    var string Alias;           // the name of the player
    00027	    var string IPAddress;       // Its IP address
    00028	    var string AltIPAddress;    // Its alternate IP address
    00029	    var int IsSpectator;        // is he a spectator ?
    00030	};
    00031
    00032
    00033	// For PSX2 more-specific interface (see below)
    00034	struct PSX2NetCnfCombination
    00035	{
    00036	    var int status;             // permet de repérer des configs qui existent mais ne sont pas utilisables
    00037	    var int iftype;             // décrit le mode de connexion (ethernet, modem PPP, PPPoE ...)
    00038	    var string combinationName; // ce champ on peut s'en passer à votre niveau (nom système de la config)
    00039	    var string ifcName;         // le nom utilisateur, affichable de la config
    00040	    var string devName;         // le nom du hard associé à la config
    00041	};
    00042
    00043	// For PSX2 more-specific interface (see below)
    00044	struct PSX2NetCnfStatus
    00045	{
    00046	    var string ifname;          // nom de l'interface physique (eth0 ...)
    00047	    var string ifname2;         // nom de l'interface virtuelle (pppoe0 dans le cas où la config utilise PPPoE)
    00048	    var int iftype;             // comme tout à l'heure ...
    00049	    var int error;              // un code d'erreur eventuel
    00050	    var int state;              // code décrivant l'état de l'interface (indépendant du protocole : stopped, starting, started, stopping ...)
    00051	    var int phase;              // code décrivant l'étape de connexion en cours, dépendant du protocole (numérotation, login ...)
    00052	    var int link;               // dans le cas ethernet, état du réseau : 1 si y a un signal , 0 sinon ... ça doit permettre de dire si le câble réseau est bien branché ...
    00053	    var string message;         // une ligne de texte décrivant l'état actuel
    00054	};
    00055
    00056	/*
    00057	// For PSX2 DNAS authentication progress
    00058	enum PSX2DNASAuthenticationStatus
    00059	{
    00060		DNAS_DONOTUSE_0 , // 0
    00061		DNAS_DORMANT , // 1
    00062		DNAS_INIT , // 2
    00063		DNAS_INST , // 3
    00064		DNAS_DATA , // 4
    00065		DNAS_END , // 5
    00066		DNAS_NG , // 6
    00067		DNAS_COM_ERROR , // 7
    00068		DNAS_DATA_DONE , // 8
    00069		DNAS_GETID , // 9
    00070		DNAS_DONOTUSE_10 , // 10
    00071		DNAS_NETSTART , // 11
    00072	} ;
    00073
    00074	struct PSX2DNASAuthenticationStatus
    00075	{
    00076		var int code ;
    00077		var int subcode ;
    00078		var int progress ;
    00079		var int optional ;
    00080	}
    00081	*/
    00082	// This array translates in plain text the error codes (use the ResultCode as an index in this array)
    00083	var const localized string FailureMessages[106];
    00084
    00085
    00086
    00087	// create a user account on Game Service network (before login)
    00088	native(475) static final function CreatePlayerAccount(string _Alias, string _Password, string _FirstName, string _LastName, string _Email, string _Country);
    00089	native(474) static final function bool IsPlayerAccountCreated(out int _ResultCode);
    00090
    00091
    00092	native static final function CheckAccountValidity(string _Alias, string _Password);
    00093	native static final function bool IsAccountValidityChecked(out int _ResultCode);
    00094
    00095	//======================== Login ========================
    00096	// Send a request to log a player in the match making system. The name (_Alias) and password (_Password) are required.
    00097
    00098	native(473) static final function Login(string _Alias, string _Password);
    00099	native(472) static final function Logout();
    00100
    00101
    00102
    00103	//========================  ========================
    00104	native(471) static final function RequestGameServerList();
    00105	native(463) static final function bool IsGameServerListComplete(out int _ResultCode);
    00106
    00107
    00108	// Modify user account
    00109	native(462) static final function ModifyPlayerAccount(string _Password, string _FirstName, string _LastName, string _Email, string _Country);
    00110	native(461) static final function bool IsPlayerAccountModified(out int _ResultCode);
    00111
    00112
    00113
    00114	//========================  ========================
    00115	native(460) static final iterator function AllGameServer(out MMGameServer _GameServer);
    00116
    00117
    00118	native(459) static final function RefreshGameServer(int _GameServerID);
    00119	native(458) static final function bool IsGameServerRefreshed(out int _ResultCode);
    00120
    00121
    00122	//========================  ========================
    00123	native(457) static final function RequestGameServerAdditionalInfo(int _GameServerID);
    00124	native(456) static final function bool IsGameServerAdditionalInfoArrived(out int _ResultCode, out string _AdditionalInfo);
    00125
    00126
    00127	//========================  ========================
    00128	native(455) static final function JoinGameServer(int _GameServerID, string _Password);
    00129	native(454) static final function bool IsJoinGameServerAcknowledged(out int _ResultCode, out string _GameServerIP, out string _GameServerAltIp, out int _GameServerPort);
    00130
    00131	//========================  ========================
    00132	native(453) static final function bool IsMatchStartedByGameServer();
    00133
    00134	//========================  ========================
    00135	native(452) static final function IStartMatch();
    00136	native(451) static final function IFinishMatch();
    00137
    00138
    00139	//========================  ========================
    00140	native(450) static final function LeaveGameServer();
    00141
    00142	//======================== connection reset by GS ? ========================
    00143	native static final function bool IsConnectionLostWithGS();
    00144
    00145
    00146	native(449) static final function RegisterMyGameServer(string _Name, int _MaxPlayers, int _MaxSpectators, string _Password, string _Info, string _AdditionalInfo, int _Port, bool _IsDedicated);
    00147	native(448) static final function bool IsMyGameServerRegistered(out int _ResultCode);
    00148
    00149	native(447) static final iterator function AllPlayerConnectedToMyGameServer(out MMPlayer _Player);
    00150
    00151	native(446) static final function UpdateMyGameServer(int _MaxPlayers, int _MaxSpectators, string _Password, string _Info, string _AdditionalInfo, int _Port);
    00152	native(445) static final function bool IsMyGameServerUpdated(out int _ResultCode);
    00153
    00154	native(444) static final function StartMatch();
    00155	native(443) static final function bool IsStartMatchAcknowledged(out int _ResultCode);
    00156
    00157	native(442) static final function MatchFinished();
    00158	native(441) static final function bool IsMatchFinishedAcknowledged(out int _ResultCode);
    00159
    00160	native static final function UnregisterMyGameServer();
    00161
    00162	native static final function bool IsMyGameServerStillRegistered();
    00163
    00164
    00165	//
    00166	//
    00167	// A more PS2-specific interface
    00168	//
    00169	//
    00170
    00171
    00172	native static final function int PSX2SwitchToOnlineMode();
    00173	native static final function PSX2SwitchToOfflineMode();
    00174
    00175	//--------------- Asynchronous operation management ---------------
    00176
    00177
    00178	// Wait for the end of an asynchronous operation
    00179	// return value:
    00180	//              1 - still executing
    00181	//              0 - operation over. The result can be obtained with PS2NetCnfGetResult()
    00182	native static final function int PSX2NetCnfGetState();
    00183
    00184	// Get the result of an asynchronous operation (once over)
    00185	native static final function int PSX2NetCnfGetResult();
    00186
    00187
    00188
    00189	//--------------- list and choose a config ---------------
    00190
    00191	// init config choice
    00192	native static final function PSX2NetCnfInit();
    00193
    00194	    // exit config choice
    00195	native static final function PSX2NetCnfExit();
    00196
    00197
    00198	// [Asynchronous operation] Get a list of config on a memory card
    00199	// netdb: media identifier (mc0 or mc1 for memory card)
    00200	// return value: <0 if error, else operation started successfully
    00201	// When the operation is over, PSX2NetCnfGetResult() will give:
    00202	//              - number of config on the media (6 max for a memory card, 0 if none)
    00203	//              - <0 if error
    00204	native static final function int PSX2NetCnfGetCombinationList(string netdb);
    00205
    00206	// Iterate config list
    00207	// index: between 1 and the number of config obtained
    00208	// combination: a structure that contains info on the config
    00209	native static final function PSX2NetCnfGetCombination(int index, out PSX2NetCnfCombination Combination);
    00210
    00211	// Get default config
    00212	native static final function int PSX2NetCnfGetDefault();
    00213
    00214	// [Asynchronous operation] Select a config
    00215	// index: index of the config to use
    00216	// return value: <0 if error, else operation started successfully
    00217	// When the operation is over, PSX2NetCnfGetResult() will give:
    00218	//              - <0 if error
    00219	//              - >=0 if success
    00220	native static final function int PSX2NetCnfSelectCombination(int index);
    00221
    00222
    00223
    00224
    00225	//--------------- activate the selected config and start network ---------------
    00226
    00227	// init network activation
    00228	native static final function PSX2NetCtlInit();
    00229
    00230	// exit network activation
    00231	native static final function PSX2NetCtlExit();
    00232
    00233	// [Asynchronous operation] Attach config to the network interface
    00234	// When the operation is over, PSX2NetCnfGetResult() will give:
    00235	//              - <0 if error
    00236	//              - >=0 if success
    00237	native static final function int PSX2NetCtlBind();
    00238
    00239	// Start network connection
    00240	// Return code:
    00241	//              - <0 if error
    00242	//              - >=0 if success
    00243	native static final function int PSX2NetCtlUp();
    00244
    00245
// End network connection 00246 // Return code: 00247 // - <0 if error 00248 // - >=0 if success 00249 native static final function int PSX2NetCtlDown(); 00250 00251 // Test the state of the connection 00252 // return code: possible errors 00253 native static final function int PSX2NetCtlGetStatus(out PSX2NetCnfStatus Status); 00254 00255 00256 //--------------- activate and check DNAS authentication --------------- 00257 00258 // init DNAS stuff (load the proper overlay) 00259 native static final function int PSX2DNASInit(int ng); 00260 00261 // exit DNAS stuff (load the proper overlay) 00262 native static final function PSX2DNASExit(); 00263 00264 // start DNAS authentication (asynchronous function) 00265 native static final function int PSX2DNASAuthenticate(); 00266 00267 // check authentication progress 00268 native static final function int PSX2DNASProgress(out int code, out int subcode, out int progress); 00269 00270 00271 00272 //--------------- Presence of memory card --------------- 00273 00274 // Check presence of memory card in each slot 00275 // Return code: 00276 // - <0 if error 00277 // - >=0 if success 00278 // Port0, Port1: contains 1 if a memory card is present in the corresponding slot, 0 otherwise 00279 native static final function int PSX2McCheckPort(out int Port0, out int port1); 00280 00281 00282 defaultproperties 00283 { 00284 FailureMessages(0)="No error" 00285 FailureMessages(1)="Unknown error" 00286 FailureMessages(2)="You are not registered, create a new account first" 00287 FailureMessages(3)="Your password is incorrect" 00288 FailureMessages(4)="This login is already in use, or your disconnection has not been detected yet" 00289 FailureMessages(5)="This login doesn't exist" 00290 FailureMessages(6)="The operation failed" 00291 FailureMessages(7)="A player with the same name as yours is already connected" 00292 FailureMessages(8)="The operation failed" 00293 FailureMessages(9)="The operation failed" 00294 FailureMessages(10)="The name you chose is already used by another player" 00295 FailureMessages(11)="You are already registered" 00296 FailureMessages(12)="The operation failed" 00297 FailureMessages(13)="Database problem. Some functions are disabled" 00298 FailureMessages(14)="UBI.com has a database problem. Please wait while it is beeing fixed. Sorry for the inconvenience" 00299 FailureMessages(15)="The operation failed" 00300 FailureMessages(16)="The password is invalid" 00301 FailureMessages(17)="The operation failed" 00302 FailureMessages(18)="The operation failed" 00303 FailureMessages(19)="The operation failed" 00304 FailureMessages(20)="The operation failed" 00305 FailureMessages(21)="The operation failed" 00306 FailureMessages(22)="A session already exist with this name" 00307 FailureMessages(23)="The operation failed" 00308 FailureMessages(24)="Maximum number of players reached" 00309 FailureMessages(25)="Maximum number of spectators reached" 00310 FailureMessages(26)="Visitors are not allowed in this session" 00311 FailureMessages(27)="The operation failed" 00312 FailureMessages(28)="No more player are allowed in this session" 00313 FailureMessages(29)="No more spectator are allowed in this session" 00314 FailureMessages(30)="The player is not registered" 00315 FailureMessages(31)="The session is not available" 00316 FailureMessages(32)="Session currently running" 00317 FailureMessages(33)="Invalid game version" 00318 FailureMessages(34)="Invalid password, you must specify the correct password to join this session" 00319 FailureMessages(35)="You are already in the session" 00320 FailureMessages(36)="Error: you are not the master of this session" 00321 FailureMessages(37)="Error: not currently in session" 00322 FailureMessages(38)="Not enough players in session to start game (min players)" 00323 FailureMessages(39)="This game does not exists" 00324 FailureMessages(40)="This session does not exist" 00325 FailureMessages(41)="The operation failed" 00326 FailureMessages(42)="The operation failed" 00327 FailureMessages(43)="Cannot login (bad login/password)" 00328 FailureMessages(44)="The operation failed" 00329 FailureMessages(45)="The operation failed" 00330 FailureMessages(46)="The operation failed" 00331 FailureMessages(47)="The operation failed" 00332 FailureMessages(48)="The operation failed" 00333 FailureMessages(49)="The operation failed" 00334 FailureMessages(50)="The operation failed" 00335 FailureMessages(51)="The operation failed" 00336 FailureMessages(52)="Unknown error" 00337 FailureMessages(53)="Unknown error" 00338 FailureMessages(54)="Unknown error" 00339 FailureMessages(55)="Unknown error" 00340 FailureMessages(56)="Unknown error" 00341 FailureMessages(57)="Unknown error" 00342 FailureMessages(58)="Unknown error" 00343 FailureMessages(59)="Unknown error" 00344 FailureMessages(60)="Unknown error" 00345 FailureMessages(61)="The operation failed" 00346 FailureMessages(62)="The operation failed" 00347 FailureMessages(63)="Unknown error" 00348 FailureMessages(64)="No spectator are allowed in this group" 00349 FailureMessages(65)="This room is full" 00350 FailureMessages(66)="The maximum number of spectator has been reached" 00351 FailureMessages(67)="This lobby is full" 00352 FailureMessages(68)="You are not registered" 00353 FailureMessages(69)="Match currently in progress" 00354 FailureMessages(70)="Wrong game version" 00355 FailureMessages(71)="Wrong password" 00356 FailureMessages(72)="You are already in that group" 00357 FailureMessages(73)="The operation failed" 00358 FailureMessages(74)="The operation failed" 00359 FailureMessages(75)="The minimum number of player has not been reached" 00360 FailureMessages(76)="Login error" 00361 FailureMessages(77)="Login error" 00362 FailureMessages(78)="Login error" 00363 FailureMessages(79)="No host lobby server" 00364 FailureMessages(80)="Disconnection from lobby server" 00365 FailureMessages(81)="The operation failed" 00366 FailureMessages(82)="The operation failed" 00367 FailureMessages(83)="The operation failed" 00368 FailureMessages(84)="The operation failed" 00369 FailureMessages(85)="The operation failed" 00370 FailureMessages(86)="The operation failed" 00371 FailureMessages(87)="The operation failed" 00372 FailureMessages(88)="Unknown error" 00373 FailureMessages(89)="Unknown error" 00374 FailureMessages(90)="The operation failed" 00375 FailureMessages(91)="The operation failed" 00376 FailureMessages(92)="The operation failed" 00377 FailureMessages(93)="The operation failed" 00378 FailureMessages(94)="The operation failed" 00379 FailureMessages(95)="The operation failed" 00380 FailureMessages(96)="The operation failed" 00381 FailureMessages(97)="The operation failed" 00382 FailureMessages(98)="Member is banned" 00383 FailureMessages(99)="The operation failed" 00384 FailureMessages(100)="The operation failed" 00385 FailureMessages(101)="The operation failed" 00386 FailureMessages(102)="The operation failed" 00387 FailureMessages(103)="The operation failed" 00388 FailureMessages(104)="The operation failed" 00389 FailureMessages(105)="The operation could not be completed" 00390 }

End Source Code