## XIDInterf
Class XIIIMenuMultiLANJoin

source: C:\XIII\XIDInterf\Classes\XIIIMenuMultiLANJoin.uc

    Core.Object
       |
       +--GUI.GUI
          |
          +--GUI.GUIComponent
             |
             +--GUI.GUIMultiComponent
                |
                +--GUI.GUIPage
                   |
                   +--XIDInterf.XIIIWindow
                      |
                      +--XIDInterf.XIIIWindowMainMenu
                         |
                         +--XIDInterf.XIIIMenuMultiBase
                            |
                            +--XIDInterf.XIIIMenuMultiLANJoin

Direct Known Subclasses:None

class XIIIMenuMultiLANJoin
extends XIDInterf.XIIIMenuMultiBase

    //============================================================================
    // Join LAN game menu.
    //
    //============================================================================

Variables
`XBOXClientBeaconReceiver` | `BeaconReceiver`
`ConnectingMsgBoxMenuTitle,` | `ConnectingText`
`float` | `DelayToWait`
`ServerInfo` | `GameServers[32]`
`int` | `IndexOfServerToJoin`
`Array` | `MapDescList`
`int` | `MsgBoxStatus`
`NbServersByPage,` | `NbServersOnThisPage`
`MaxPage,` | `NewPage`
`MapButton[7],` | `PlayersButton[7]`
`BackButton,` | `RefreshButton`
`NoServersFound,` | `RefreshingText`
`LeftArrow,` | `RightArrow`
`bool` | `bMsgDisconnectedDisplayed`
`bServerListObtained,` | `bRefreshing`
`XIIIMsgBox` | `msgbox`
`string` | `networkcableDisconnectedString`

States
Refreshing

Function Summary
`void` | `Created()`
    //============================================================================
`void` | `DestroyBeacon()`
`void` | `GetServersList()`
`void` | `InstanciateBeacon()`
`bool` | `InternalOnClick(GUIComponent Sender)`
    // Called when a button is clicked
`bool` | `InternalOnKeyEvent(out byte, out byte, float delta)`
`void` | `MsgBoxBtnClicked(byte bButton)`
`void` | `OnButtonMsgBoxClick(byte bButton)`
    //
    // "Connecting Message box" delegates
    //
`void` | `OnMsgBoxClose(optional Bool)`
`void` | `OnMsgBoxTick(float deltatime)`
`void` | `PageSwitch()`
`void` | `Paint(Canvas C, float X, float Y)`
`void` | `ServerDisplay(int NumGameServer)`
`void` | `ServerHide(int NumGameServer)`
`void` | `ToDoWhenThisMenuIsClosed(Bool bCanceled)`

State Refreshing Function Summary

Source Code

    00001	//============================================================================
    00002	// Join LAN game menu.
    00003	//
    00004	//============================================================================
    00005	class XIIIMenuMultiLANJoin extends XIIIMenuMultiBase;
    00006
    00007
    00008	struct ServerInfo
    00009	{
    00010		var string IpAddr;
    00011		var string SrvName;
    00012	};
    00013
    00014	var ServerInfo GameServers[32];
    00015
    00016	var XBOXClientBeaconReceiver BeaconReceiver;
    00017
    00018	var XIIIButton BackButton, RefreshButton;
    00019	var localized string CreateText, FilterText, RefreshText, BackText, QueryServerList, NoServersFound, RefreshingText;
    00020
    00021	var XIIIButton ServerButton[7], GameTypeButton[7], MapButton[7], PlayersButton[7];
    00022	var XIIIArrowButton LeftArrow, RightArrow;
    00023
    00024	var localized string ConnectingMsgBoxMenuTitle, ConnectingText;
    00025	var localized string networkcableDisconnectedString;
    00026	var XIIIMsgBox msgbox;
    00027	var int MsgBoxStatus;
    00028	var int IndexOfServerToJoin;
    00029	var float DelayToWait;
    00030
    00031	var int NbServersMax, NbServersByPage, NbServersOnThisPage;
    00032	var int CurrentPage, MaxPage, NewPage;
    00033
    00034	var bool bServerListObtained, bRefreshing;
    00035	var bool bMsgDisconnectedDisplayed;
    00036
    00037	VAR Array<STRING> MapDescList;
    00038	//var string Infos[4];
    00039
    00040	//============================================================================
    00041	function Created()
    00042	{
    00043	    local int i;
    00044		LOCAL Array<STRING> MapUNRList;
    00045
    00046	    Super.Created();
    00047
    00048		AllowedGameTypeIndex[0]=DeathmatchIndex;
    00049		AllowedGameTypeIndex[1]=TeamDeathmatchIndex;
    00050		AllowedGameTypeIndex[2]=CaptureTheFlagIndex;
    00051		AllowedGameTypeIndex[3]=SabotageIndex;
    00052
    00053	    bShowBCK = true;
    00054	    bShowSEL = true;
    00055
    00056		LeftArrow = XIIIArrowButton(CreateControl(class'XIIIArrowButton', 240, 333*fScaleTo, 16, 16));
    00057		LeftArrow.bLeftOrient = true;
    00058		LeftArrow.bNeverFocus = true;
    00059		LeftArrow.bVisible = false;
    00060
    00061		RightArrow = XIIIArrowButton(CreateControl(class'XIIIArrowButton', 380, 333*fScaleTo, 16, 16));
    00062		RightArrow.bLeftOrient = false;
    00063		RightArrow.bNeverFocus = true;
    00064		RightArrow.bVisible = false;
    00065
    00066		RefreshButton = XIIIButton(CreateControl(class'XIIIButton', 150, 370*fScaleTo, 100, 30*fScaleTo));
    00067		RefreshButton.Text= RefreshText;
    00068		RefreshButton.bUseBorder = true;
    00069
    00070	    BackButton = XIIIButton(CreateControl(class'XIIIButton', 400, 370*fScaleTo, 100, 30*fScaleTo));
    00071		BackButton.Text= BackText;
    00072		BackButton.bUseBorder = true;
    00073
    00074		for (i=0;i<NbServersByPage;i++)
    00075		{
    00076			// server name
    00077			ServerButton[i] = XIIIButton(CreateControl(class'XIIIButton', 30, (40*i + 50)*fScaleTo, 160, 30*fScaleTo));
    00078			ServerButton[i].Text= "";
    00079			ServerButton[i].bUseBorder = true;
    00080			ServerButton[i].bNeverFocus = true;
    00081			ServerButton[i].bVisible = false;
    00082			// informations
    00083			GameTypeButton[i] = XIIIButton(CreateControl(class'XIIIButton', 200, (40*i + 50)*fScaleTo, 160, 30*fScaleTo));
    00084			GameTypeButton[i].Text= "";
    00085			GameTypeButton[i].bUseBorder = true;
    00086			GameTypeButton[i].bNeverFocus = true;
    00087			GameTypeButton[i].bVisible = false;
    00088
    00089			MapButton[i] = XIIIButton(CreateControl(class'XIIIButton', 370, (40*i + 50)*fScaleTo, 160, 30*fScaleTo));
    00090			MapButton[i].Text= "";
    00091			MapButton[i].bUseBorder = true;
    00092			MapButton[i].bNeverFocus = true;
    00093			MapButton[i].bVisible = false;
    00094
    00095			PlayersButton[i] = XIIIButton(CreateControl(class'XIIIButton', 540, (40*i + 50)*fScaleTo, 70, 30*fScaleTo));
    00096			PlayersButton[i].Text= "";
    00097			PlayersButton[i].bUseBorder = true;
    00098			PlayersButton[i].bNeverFocus = true;
    00099			PlayersButton[i].bVisible = false;
    00100
    00101			Controls[4 + i] = ServerButton[i];
    00102			Controls[NbServersByPage + 4 + i] = GameTypeButton[i];
    00103			Controls[2*NbServersByPage + 4 + i] = MapButton[i];
    00104			Controls[3*NbServersByPage + 4 + i] = PlayersButton[i];
    00105		}
    00106
    00107		Controls[0] = RefreshButton;
    00108		Controls[1] = BackButton;
    00109
    00110		Controls[2] = LeftArrow;
    00111		Controls[3] = RightArrow;
    00112
    00113		NewPage=1;
    00114	    IndexOfServerToJoin=-1;
    00115
    00116	    GetServersList();
    00117	    SetTimer(2, true);
    00118
    00119		GetMapArray( -1, MapDescList, MapUNRList );
    00120
    00121		GotoState('ReinitMusic');
    00122	}
    00123
    00124
    00125	function InstanciateBeacon()
    00126	{
    00127		BeaconReceiver = GetPlayerOwner().Spawn(Class'XBOXClientBeaconReceiver');
    00128	}
    00129
    00130	function DestroyBeacon()
    00131	{
    00132	    BeaconReceiver.Destroy();
    00133	    SetTimer(0, false);
    00134	    BeaconReceiver = none;
    00135	}
    00136
    00137	function MsgBoxBtnClicked(byte bButton)
    00138	{
    00139	    if ((bButton & QBTN_Ok) != 0)       // ok to overwrite
    00140	    {
    00141	        bMsgDisconnectedDisplayed = false;
    00142	        myRoot.CloseMenu();
    00143	        DestroyBeacon();
    00144	    }
    00145	}
    00146
    00147	function Paint(Canvas C, float X, float Y)
    00148	{
    00149	   local float W, H;
    00150
    00151		Super.Paint(C,X,Y);
    00152
    00153	   	if (myRoot.CableDisconnected && !bMsgDisconnectedDisplayed)
    00154		{
    00155	        Controller.OpenMenu("XIDInterf.XIIIMsgBox",false);
    00156	        msgbox = XIIIMsgBox(myRoot.ActivePage);
    00157	        msgbox.SetupQuestion(networkcableDisconnectedString, QBTN_Ok, QBTN_Ok);
    00158	        msgbox.OnButtonClick=MsgBoxBtnClicked;
    00159	        msgbox.InitBox(120, 130, 10, 10, 400, 230);
    00160
    00161	        bMsgDisconnectedDisplayed = true;
    00162		}
    00163		else
    00164		{
    00165			RefreshButton.bNeverFocus = false;
    00166
    00167			// page display
    00168			C.SetPos(235*fRatioX, 330*fRatioY*fScaleTo);
    00169			if (!bServerListObtained)
    00170			{
    00171	    		//C.SetPos(240*fRatioX, 250*fRatioY);
    00172				C.DrawText(QueryServerList, false);
    00173			}
    00174			else
    00175			{
    00176				if (bRefreshing)
    00177				{
    00178					C.DrawText(RefreshingText, false);
    00179				}
    00180				else
    00181				{
    00182					if ( NbServersMax == 0 )
    00183						C.DrawText(NoServersFound, false);
    00184	//				else
    00185	//					C.DrawText("Page "$CurrentPage$"/"$MaxPage, false);
    00186				}
    00187			}
    00188		}
    00189	}
    00190
    00191
    00192	function ServerDisplay(int NumGameServer)
    00193	{
    00194		local int j,Line, NbInfo;
    00195	    local string TempStr, Str, StrServer, StrGameType, StrMap, StrPlayers;
    00196
    00197		j = NumGameServer - (NewPage - 1)*NbServersByPage;
    00198
    00199		Str = GameServers[NumGameServer].SrvName;
    00200		TempStr = Str;
    00201
    00202		StrServer = Left( TempStr, InStr(TempStr,"|"));
    00203		TempStr = Mid( TempStr, Len(StrServer) + 1 );
    00204
    00205		StrMap = Left( TempStr, InStr(TempStr, "|") );
    00206		TempStr = Mid( TempStr, Len(StrMap) + 1 );
    00207
    00208		StrGameType = Left( TempStr, InStr(TempStr,"|"));
    00209
    00210		StrPlayers = Mid( TempStr, Len(StrGameType) + 2 );
    00211		//log(self@"---> NOMBRE DE JOUEURS :"@StrPlayers);
    00212
    00213		ServerButton[j].Text = StrServer;
    00214		GameTypeButton[j].Text = GetGameTypeText(int(StrGameType));
    00215		MapButton[j].Text = MapDescList[int(StrMap)];
    00216		PlayersButton[j].Text = StrPlayers;
    00217
    00218		ServerButton[j].bSmallFont=true;
    00219		GameTypeButton[j].bSmallFont=true;
    00220		MapButton[j].bSmallFont=true;
    00221		PlayersButton[j].bSmallFont=false;
    00222
    00223		ServerButton[j].bNeverFocus = false;
    00224		ServerButton[j].bVisible = true;
    00225		GameTypeButton[j].bVisible = true;
    00226		MapButton[j].bVisible = true;
    00227		PlayersButton[j].bVisible = true;
    00228	}
    00229
    00230
    00231	function ServerHide(int NumGameServer)
    00232	{
    00233		ServerButton[NumGameServer].bNeverFocus = true;
    00234		ServerButton[NumGameServer].bVisible = false;
    00235		GameTypeButton[NumGameServer].bVisible = false;
    00236		MapButton[NumGameServer].bVisible = false;
    00237		PlayersButton[NumGameServer].bVisible = false;
    00238	}
    00239
    00240
    00241
function PageSwitch() 00242 { 00243 local int i; 00244 00245 // number of servers displayed on this page 00246 if ( NewPage == MaxPage ) 00247 NbServersOnThisPage = NbServersMax - (MaxPage - 1)*NbServersByPage; 00248 else 00249 NbServersOnThisPage = NbServersByPage; 00250 00251 // display all servers on this page 00252 for (i=0;i<NbServersOnThisPage;i++) 00253 { 00254 ServerDisplay( (NewPage - 1)*NbServersByPage + i ); 00255 } 00256 00257 // erase void buttons 00258 for (i=NbServersOnThisPage;i<NbServersByPage;i++) 00259 { 00260 ServerButton[i].bNeverFocus = true; 00261 ServerButton[i].bVisible = false; 00262 GameTypeButton[i].bVisible = false; 00263 MapButton[i].bVisible = false; 00264 PlayersButton[i].bVisible = false; 00265 } 00266 00267 // focus control 00268 if ( ( FindComponentIndex(FocusedControl) - 2 ) > NbServersOnThisPage ) 00269 { 00270 Controls[NbServersOnThisPage + 2].FocusFirst(Self,false); 00271 } 00272 00273 // new current page 00274 CurrentPage = NewPage; 00275 00276 } 00277 00278 00279 // Called when a button is clicked 00280 function bool InternalOnClick(GUIComponent Sender) 00281 { 00282 local int i; 00283 00284 if (Sender == RefreshButton) 00285 { 00286 GotoState('Refreshing'); 00287 } 00288 00289 if (Sender == BackButton) 00290 { 00291 myRoot.CloseMenu(true); 00292 DestroyBeacon(); 00293 } 00294 00295 for (i=0;i<NbServersByPage;i++) 00296 { 00297 if (Sender == ServerButton[i]) 00298 { 00299 myRoot.OpenMenu("XIDInterf.XIIIMsgBox",false); 00300 msgbox = XIIIMsgBox(myRoot.ActivePage); 00301 msgbox.InitBox(220*fRatioX, 130*fRatioY*fScaleTo, 10, 10, 220*fRatioX, 230*fRatioY*fScaleTo); 00302 msgbox.SetupQuestion(ConnectingText, QBTN_Cancel, QBTN_Cancel, ConnectingMsgBoxMenuTitle); 00303 msgbox.OnButtonClick = OnButtonMsgBoxClick; 00304 msgbox.OnTick = OnMsgBoxTick; 00305 msgbox.OnClose = OnMsgBoxClose; 00306 msgbox.ShowWorking = true; 00307 MsgBoxStatus = 100; 00308 00309 IndexOfServerToJoin = i; 00310 DelayToWait = 0.0; 00311 } 00312 } 00313 return true; 00314 } 00315 00316 function bool InternalOnKeyEvent(out byte Key, out byte State, float delta) 00317 { 00318 local int index; 00319 local bool bLeft, bRight, bUp, bDown; 00320 00321 if (State==1)// IST_Press // to avoid auto-repeat 00322 { 00323 if ((Key==0x08/*IK_Backspace*/)|| (Key==0x1B) /*IK_Escape*/) 00324 { 00325 myRoot.CloseMenu(true); 00326 DestroyBeacon(); 00327 return true; 00328 } 00329 00330 if (myroot.CableDisconnected && Key==0x0D/*IK_Enter*/) 00331 { 00332 DestroyBeacon(); 00333 return true; 00334 } 00335 00336 if ((Key==0x0D/*IK_Enter*/) || (Key==0x01)/*IK_LeftMouse*/) 00337 { 00338 return InternalOnClick(FocusedControl); 00339 } 00340 00341 00342 bLeft = (Key==0x25); 00343 bRight = (Key==0x27); 00344 bUp = (Key==0x26); 00345 bDown = (Key==0x28); 00346 00347 // controls are 00348 // 4 00349 // 5 00350 // ... 00351 // 0 1 00352 // (controls 2 and 3 are used by arrows buttons) 00353 if ( bLeft || bRight || bUp || bDown ) 00354 { 00355 index = FindComponentIndex(FocusedControl); 00356 switch (index) 00357 { 00358 case 0 : 00359 if ( bUp ) Controls[3 + NbServersOnThisPage].FocusFirst(Self,false); 00360 if ( bDown ) Controls[4].FocusFirst(Self,false); 00361 if ( bLeft || bRight ) Controls[1].FocusFirst(Self,false); 00362 break; 00363 case 1 : 00364 if ( bUp ) Controls[3 + NbServersOnThisPage].FocusFirst(Self,false); 00365 if ( bDown ) Controls[4].FocusFirst(Self,false); 00366 if ( bLeft || bRight ) Controls[0].FocusFirst(Self,false); 00367 break; 00368 case 4 : 00369 if ( bUp ) Controls[0].FocusFirst(Self,false); 00370 if ( bDown ) 00371 if ( NbServersOnThisPage != 1 ) 00372 Controls[index + 1].FocusFirst(Self,false); 00373 else 00374 Controls[0].FocusFirst(Self,false); 00375 NewPage = CurrentPage; 00376 if ( bRight ) NewPage ++; 00377 if ( bLeft ) NewPage --; 00378 NewPage = Clamp(NewPage,1,MaxPage); 00379 // page is changed 00380 if (NewPage != CurrentPage) 00381 PageSwitch(); 00382 break; 00383 default: 00384 if ( index == (3 + NbServersOnThisPage) ) 00385 { 00386 if ( bUp ) Controls[3 + NbServersOnThisPage - 1].FocusFirst(Self,false); 00387 if ( bDown ) Controls[0].FocusFirst(Self,false); 00388 } 00389 else 00390 { 00391 if ( bUp ) Controls[index - 1].FocusFirst(Self,false); 00392 if ( bDown ) Controls[index + 1].FocusFirst(Self,false); 00393 } 00394 NewPage = CurrentPage; 00395 if ( bRight ) NewPage ++; 00396 if ( bLeft ) NewPage --; 00397 NewPage = Clamp(NewPage,1,MaxPage); 00398 // page is changed 00399 if (NewPage != CurrentPage) 00400 PageSwitch(); 00401 } 00402 return true; 00403 } 00404 } 00405 return super.InternalOnKeyEvent(Key, state, delta); 00406 } 00407 00408 00409 00410 event Timer() 00411 { 00412 // Update server list regularly 00413 GotoState('Refreshing'); 00414 } 00415 00416 00417 00418 function GetServersList() 00419 { 00420 local int i; 00421 local bool JustBeaconed; 00422 00423 if (BeaconReceiver == none) 00424 { 00425 InstanciateBeacon(); 00426 JustBeaconed = true; 00427 } 00428 00429 NbServersMax = 0; 00430 for (i=0; i<32; i++) 00431 { 00432 if (BeaconReceiver.GetBeaconAddress(i) != "") 00433 { 00434 GameServers[NbServersMax].SrvName = BeaconReceiver.GetBeaconText(i); 00435 GameServers[NbServersMax].IpAddr = BeaconReceiver.GetBeaconAddress(i); 00436 //log(self@"---> BEACON RECEIVER Name="$GameServers[NbServersMax].SrvName@"IP="$GameServers[NbServersMax].IpAddr); 00437 if ( NbServersMax < NbServersByPage) 00438 { 00439 ServerDisplay(NbServersMax); 00440 } 00441 NbServersMax ++; 00442 } 00443 } 00444 00445 // hide the buttons corresponding to servers that may have disappeared since last time the server list was received 00446 if ( NbServersMax < NbServersByPage) 00447 { 00448 for (i=NbServersMax; i<NbServersByPage; i++) 00449 { 00450 ServerHide(i); 00451 } 00452 } 00453 00454 // current page is the first one 00455 CurrentPage = 1; 00456 00457 // maximal number of pages 00458 if ( (NbServersMax/NbServersByPage)*NbServersByPage < NbServersMax ) 00459 MaxPage = NbServersMax/NbServersByPage + 1; 00460 else 00461 MaxPage = NbServersMax/NbServersByPage; 00462 00463 /* // arrows display 00464 if ( NbServersMax > NbServersByPage ) 00465 { 00466 LeftArrow.bVisible = true; 00467 RightArrow.bVisible = true; 00468 } 00469 */ 00470 // number of servers displayed on the first page 00471 if ( NbServersMax > NbServersByPage) 00472 NbServersOnThisPage = NbServersByPage; 00473 else 00474 NbServersOnThisPage = NbServersMax; 00475 00476 // consider that the servers didn't have enough time to respond if the beacon has just been spawned 00477 if (!JustBeaconed) 00478 { 00479 bServerListObtained = true; 00480 } 00481 } 00482 00483 00484 00485 Delegate OnClose(optional Bool bCanceled) 00486 { 00487 // ToDoWhenThisMenuIsClosed(bCanceled); 00488 } 00489 00490 00491 function ToDoWhenThisMenuIsClosed(Bool bCanceled) 00492 { 00493 log("XIIIMenuMultiLANJoin.ToDoWhenThisMenuIsClosed()"); 00494 00495 DestroyBeacon(); 00496 myRoot.bProfileMenu = true; 00497 myRoot.GotoState(''); 00498 // No need for myRoot.CloseAll() here because if this function is called, it is because the CloseAll() was called from the engine. 00499 GetPlayerOwner().AttribPadToViewport(); 00500 Super.OnClose(bCanceled); 00501 } 00502 00503 00504 // 00505 // "Connecting Message box" delegates 00506 // 00507 00508 function OnButtonMsgBoxClick(byte bButton) 00509 { 00510 // cancel the pending level (cmd "CANCEL" to UGameEngine); 00511 GetPlayerOwner().ConsoleCommand("CANCEL"); 00512 } 00513 00514 function OnMsgBoxTick(float deltatime) 00515 { 00516 local string ErrorMsg, MyClass, SkinCode, MyName, MyTeam; 00517 local int i; 00518 00519 if (MsgBoxStatus == 0) 00520 { 00521 // poll the connection status 00522 MsgBoxStatus = MyRoot.GetConnectionStatus(ErrorMsg); 00523 if (MsgBoxStatus != 0) 00524 { 00525 log("Error Msg = "$ErrorMsg); 00526 msgbox.UpdateTextDisplayed(ErrorMsg); 00527 msgbox.ShowWorking = false; 00528 MsgBoxStatus = 99; 00529 } 00530 } 00531 else if (MsgBoxStatus == 99) 00532 { 00533 // nothing, just wait 00534 } 00535 else if (MsgBoxStatus == 100) 00536 { 00537 DelayToWait += deltatime; 00538 if (DelayToWait > 2.0) 00539 { 00540 // skin 00541 MyClass = GetPlayerOwner().GetDefaultURL("MySkin"); 00542 SkinCode = class'MeshSkinList'.default.MeshSkinListInfo[0].SkinCode; 00543 for (i=0;i<class'MeshSkinList'.default.MeshSkinListInfo.Length;i++) 00544 { 00545 if ( MyClass == class'MeshSkinList'.default.MeshSkinListInfo[i].SkinName ) 00546 { 00547 SkinCode = class'MeshSkinList'.default.MeshSkinListInfo[i].SkinCode; 00548 break; 00549 } 00550 } 00551 00552 // name selection 00553 MyName = GetPlayerOwner().GetDefaultURL("MyName"); 00554 if (MyName == "") 00555 MyName = GetPlayerOwner().GetDefaultURL("Name"); 00556 00557 // team selection 00558 MyTeam = GetPlayerOwner().GetDefaultURL("MyTeam"); 00559 if (MyTeam == "") 00560 MyTeam = GetPlayerOwner().GetDefaultURL("Team"); 00561 00562 //log("start"@GameServers[IndexOfServerToJoin].IpAddr$"?LAN?Name="$GetPlayerOwner().PlayerReplicationInfo.PlayerName); 00563 //GetPlayerOwner().ConsoleCommand("start"@GameServers[IndexOfServerToJoin].IpAddr$"?LAN?Name="$GetPlayerOwner().PlayerReplicationInfo.PlayerName$"?SK="$SkinCode); 00564 GetPlayerOwner().ConsoleCommand("start xbox.join?LAN?Name="$MyName$"?SK="$SkinCode$"?team="$MyTeam$"?XNADDR="$BeaconReceiver.GetXNADDR(IndexOfServerToJoin)$"?XNKID="$BeaconReceiver.GetXNKID(IndexOfServerToJoin)$"?XNKEY="$BeaconReceiver.GetXNKEY(IndexOfServerToJoin)); 00565 MsgBoxStatus = 0; 00566 } 00567 } 00568 } 00569 00570 function OnMsgBoxClose(optional Bool bCanceled) 00571 { 00572 if (MsgBoxStatus == 0) 00573 { 00574 // Connection is ok, the engine wants to close the menus before loading the map 00575 ToDoWhenThisMenuIsClosed(bCanceled); 00576 } 00577 // in any other case, it is simply that the user wants to come back to close the messagebox by himself 00578 } 00579 00580 00581 00582 State Refreshing 00583 { 00584 Begin: 00585 bRefreshing=true; 00586 GetServersList(); 00587 Sleep(1); 00588 bRefreshing=false; 00589 SetTimer(5, true); 00590 GotoState(''); 00591 } 00592 00593 00594 00595 00596 defaultproperties 00597 { 00598 RefreshText="Refresh list" 00599 BackText="Back" 00600 QueryServerList="Getting a list of server..." 00601 NoServersFound="No servers found" 00602 RefreshingText="Refreshing server list..." 00603 ConnectingMsgBoxMenuTitle="Connection status" 00604 ConnectingText="Connecting to the server...." 00605 NbServersByPage=7 00606 hSoundMenu2=Sound'XIIIsound.Interface__AmbianceMenu.AmbianceMenu__hMulti2' 00607 }

End Source Code