Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UBrowser.UBrowserServerListFactory


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
//=============================================================================
// UBrowserServerListFactory
//		An abstract class to add servers to an existing server list.
//		eg GameSpy, HTTP master servers, favorites list, etc
//=============================================================================
class UBrowserServerListFactory extends UWindowList
			abstract;

var UBrowserServerList Owner;
var bool bIncrementalPing;		// Servers are pinged as they come in

var Player ViewPortOwner;

function Query(optional bool bBySuperset, optional bool bInitial)
{
	if ( ViewPortOwner==None )
		ViewPortOwner = Owner.GetPlayerOwner().Player; // Assign this variable to avoid future problems.
	// Implemented in child class
}

function Shutdown(optional bool bBySuperset)
{
	Owner = None;
}

function QueryFinished(bool bSuccess, optional string ErrorMsg)
{
	Owner.QueryFinished(Self, bSuccess, ErrorMsg);
}

function UBrowserServerList FoundServer(string IP, int QueryPort, string Category, string GameName, optional string HostName)
{
	local UBrowserServerList NewListEntry;

	NewListEntry = Owner.FindExistingServer(IP, QueryPort);

	// Don't add if it's already in the existing list
	if (NewListEntry == None)
	{
		// Add it to the server list(s)
		NewListEntry = UBrowserServerList(Owner.Append(Owner.Class));

		NewListEntry.bNeverPinged = True;
		NewListEntry.IP = IP;
		NewListEntry.QueryPort = QueryPort;

		NewListEntry.Ping = 9999;
		if (HostName != "")
			NewListEntry.HostName = HostName;
		else
			NewListEntry.HostName = IP;
		NewListEntry.Category = Category;
		NewListEntry.GameName = GameName;
		NewListEntry.bLocalServer = False;
	}

	NewListEntry.bOldServer = False;
	if ( Owner.Owner.PingState!=PS_RePinging )
	{
		Owner.Owner.PingState = PS_RePinging;
		Owner.PingServers(True, False);
	}
	return NewListEntry;
}

function PlayerPawn GetPlayerOwner()
{
	if ( ViewPortOwner!=None )
		Return ViewPortOwner.Actor;
	ViewPortOwner = Owner.GetPlayerOwner().Player;
	return ViewPortOwner.Actor;
}

defaultproperties
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:30.000 - Creation time: zo 11-11-2012 21:14:20.990 - Created with UnCodeX