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

Engine.GameReplicationInfo


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
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
//=============================================================================
// GameReplicationInfo.
//=============================================================================
class GameReplicationInfo extends ReplicationInfo
    native nativereplication;

var string GameName;                        // Assigned by GameInfo.
var string GameClass;                       // Assigned by GameInfo.
var bool bTeamGame;                         // Assigned by GameInfo.
var bool bClassicDeathMessages;
var bool bStopCountDown;
var int  RemainingTime, ElapsedTime, RemainingMinute;
var float SecondCount;

var int NumPlayers;
var int SumFrags;
var float UpdateTimer;

var() globalconfig string ServerName;       // Name of the server, i.e.: Bob's Server.
var() globalconfig string ShortName;        // Abbreviated name of server, i.e.: B's Serv (stupid example)
var() globalconfig string AdminName;        // Name of the server admin.
var() globalconfig string AdminEmail;       // Email address of the server admin.
var() globalconfig int       Region;        // Region of the game server.

var() globalconfig string MOTDLine1;        // Message
var() globalconfig string MOTDLine2;        // Of
var() globalconfig string MOTDLine3;        // The
var() globalconfig string MOTDLine4;        // Day

var string GameEndedComments;               // set by gameinfo when game ends

var PlayerReplicationInfo PRIArray[32];

replication
{
    reliable if ( Role == ROLE_Authority )
        RemainingMinute, bStopCountDown, GameEndedComments,
        NumPlayers;

    reliable if ( bNetInitial && (Role==ROLE_Authority) )
        GameName, GameClass, bTeamGame, ServerName, ShortName, AdminName,
        AdminEmail, Region, MOTDLine1, MOTDLine2, 
        MOTDLine3, MOTDLine4,RemainingTime, ElapsedTime;
}

simulated function PostBeginPlay()
{
    if( Level.NetMode == NM_Client )
    {
        // clear variables so we don't display our own values if the server has them left blank 
        ServerName = "";
        AdminName = "";
        AdminEmail = "";
        MOTDLine1 = "";
        MOTDLine2 = "";
        MOTDLine3 = "";
        MOTDLine4 = "";
    }

    SecondCount = Level.TimeSeconds;
    SetTimer(0.2, true);
}

simulated function Timer()
{
    local PlayerReplicationInfo PRI;
    local int i, FragAcc;

    if ( Level.NetMode == NM_Client )
    {
        if (Level.TimeSeconds - SecondCount >= Level.TimeDilation)
        {
            ElapsedTime++;
            if ( RemainingMinute != 0 )
            {
                RemainingTime = RemainingMinute;
                RemainingMinute = 0;
            }
            if ( (RemainingTime > 0) && !bStopCountDown )
                RemainingTime--;
            SecondCount += Level.TimeDilation;
        }
    }

    for (i=0; i<32; i++)
        PRIArray[i] = None;
    i=0;
    foreach AllActors(class'PlayerReplicationInfo', PRI)
    {
        if ( i < 32 )
            PRIArray[i++] = PRI;
    }

    // Update various information.
    UpdateTimer = 0;
    for (i=0; i<32; i++)
        if (PRIArray[i] != None)
            FragAcc += PRIArray[i].Score;
    SumFrags = FragAcc;

    if ( Level.Game != None )
        NumPlayers = Level.Game.NumPlayers;
}

defaultproperties
{
     bStopCountDown=True
     ServerName="Another UT Server"
     ShortName="UT Server"
     RemoteRole=ROLE_SimulatedProxy
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Do 19.5.2005 19:42:12.000 - Creation time: Fr 7.6.2013 13:15:45.382 - Created with UnCodeX