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

XInterface.Browser_ServerListPageLAN


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
00078
00079
00080
class Browser_ServerListPageLAN extends Browser_ServerListPageBase;

var LANQueryClient LQC;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    Super.Initcomponent(MyController, MyOwner);

    GUIButton(GUIPanel(Controls[1]).Controls[6]).bVisible = false;
    GUIButton(GUIPanel(Controls[1]).Controls[7]).bVisible = false;
    StatusBar.WinWidth=1.0;

    if( LQC == None )
    {
        LQC = PlayerOwner().Level.Spawn( class'LANQueryClient' );
        LQC.OnReceivedPingInfo = MyReceivedPingInfo;
        LQC.OnPingTimeout      = MyServersList.MyPingTimeout;
    }

    // Change server list spacing a bit (no icons)
    MyServersList.InitColumnPerc[0]=0.0;
    MyServersList.InitColumnPerc[1]=0.47;
    MyServersList.InitColumnPerc[2]=0.25;
    MyServersList.InitColumnPerc[3]=0.13;
    MyServersList.InitColumnPerc[4]=0.15;

    RefreshList();
}

function OnCloseBrowser()
{
    if( LQC != None )
    {
        LQC.Destroy();
        LQC = None;
    }
}

function MyReceivedPingInfo( int ServerID, ServerQueryClient.EPingCause PingCause, GameInfo.ServerResponseLine s )
{
    local int i;
    if( ServerID < 0 )
    {
        for( i=0;i<MyServersList.Servers.Length;i++ )
        {
            // dupe
            if( MyServersList.Servers[i].IP==s.IP && MyServersList.Servers[i].Port==s.Port )
                return;
        }

        MyServersList.MyOnReceivedServer( s );
    }
    else
    {
        MyServersList.MyReceivedPingInfo( ServerID, PingCause, s );
    }
}

function PingServer( int listid, ServerQueryClient.EPingCause PingCause, GameInfo.ServerResponseLine s )
{
    LQC.PingServer( listid, PingCause, s.IP, s.QueryPort, QI_RulesAndPlayers, s );
}

function CancelPings()
{
    LQC.CancelPings();
}

function RefreshList()
{
    MyServersList.Clear();
    CancelPings();
    LQC.BroadcastPingRequest();
}

defaultproperties
{
     ConnectLAN=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:30:38.000 - Creation time: Wed 7/2/2007 19:16:35.359 - Created with UnCodeX