UBrowser
Class UBrowserServerListFactory

source: e:\games\UnrealTournament\UBrowser\Classes\UBrowserServerListFactory.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowList
         |
         +--UBrowser.UBrowserServerListFactory
Direct Known Subclasses:UBrowserFavoritesFact, UBrowserGSpyFact, UBrowserHTTPFact, UBrowserLocalFact, UBrowserSubsetFact

class UBrowserServerListFactory
extends UWindow.UWindowList

//============================================================================= // UBrowserServerListFactory // An abstract class to add servers to an existing server list. // eg GameSpy, HTTP master servers, favorites list, etc //=============================================================================
Variables
 UBrowserServerList Owner
 UBrowserServerList PingedList
 UBrowserServerList UnpingedList
 bool bIncrementalPing
           Servers are pinged as they come in


Function Summary
 UBrowserServerList FoundServer(string IP, int QueryPort, string Category, string GameName, optional string)
 PlayerPawn GetPlayerOwner()
 void Query(optional bool, optional bool)
 void QueryFinished(bool bSuccess, optional string)
 void Shutdown(optional bool)



Source Code


00001	//=============================================================================
00002	// UBrowserServerListFactory
00003	//		An abstract class to add servers to an existing server list.  
00004	//		eg GameSpy, HTTP master servers, favorites list, etc
00005	//=============================================================================
00006	class UBrowserServerListFactory extends UWindowList
00007		abstract;
00008	
00009	var UBrowserServerList PingedList;
00010	var UBrowserServerList UnpingedList;
00011	var UBrowserServerList Owner;
00012	
00013	
00014	var bool bIncrementalPing;		// Servers are pinged as they come in
00015	
00016	function Query(optional bool bBySuperset, optional bool bInitial)
00017	{
00018	}
00019	
00020	function Shutdown(optional bool bBySuperset)
00021	{
00022		Owner = None;
00023		PingedList = None;
00024		UnpingedList = None;
00025	}
00026	
00027	function QueryFinished(bool bSuccess, optional string ErrorMsg)
00028	{
00029		Owner.QueryFinished(Self, bSuccess, ErrorMsg);
00030	}
00031	
00032	function UBrowserServerList FoundServer(string IP, int QueryPort, string Category, string GameName, optional string HostName)
00033	{
00034		local UBrowserServerList NewListEntry;
00035	
00036		NewListEntry = Owner.FindExistingServer(IP, QueryPort);
00037	
00038		// Don't add if it's already in the existing list
00039		if(NewListEntry == None)
00040		{
00041			// Add it to the server list(s)
00042			NewListEntry = UBrowserServerList(Owner.CreateItem(Owner.Class));
00043	
00044			NewListEntry.IP = IP;
00045			NewListEntry.QueryPort = QueryPort;
00046	
00047			NewListEntry.Ping = 9999;
00048			if(HostName != "")
00049				NewListEntry.HostName = HostName;
00050			else
00051				NewListEntry.HostName = IP;
00052			NewListEntry.Category = Category;
00053			NewListEntry.GameName = GameName;
00054			NewListEntry.bLocalServer = False;
00055	
00056			Owner.AppendItem(NewListEntry);
00057		}
00058	
00059		NewListEntry.bOldServer = False;
00060	
00061		return NewListEntry;
00062	}
00063	
00064	function PlayerPawn GetPlayerOwner()
00065	{
00066		return Owner.GetPlayerOwner();
00067	}
00068	
00069	defaultproperties
00070	{
00071	}

End Source Code