Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 00113 |
//============================================================================= // TeamInfo. // Copyright 1998-2011 Epic Games, Inc. All Rights Reserved. //============================================================================= class TeamInfo extends ReplicationInfo native(ReplicationInfo) nativereplication; var localized string TeamName; var int Size; //number of players on this team in the level var float Score; var repnotify int TeamIndex; var color TeamColor; cpptext { INT* GetOptimizedRepList( BYTE* InDefault, FPropertyRetirement* Retire, INT* Ptr, UPackageMap* Map, UActorChannel* Channel ); } replication { // Variables the server should send to the client. if( bNetDirty && (Role==ROLE_Authority) ) Score; if ( bNetInitial && (Role==ROLE_Authority) ) TeamName, TeamIndex; } simulated event ReplicatedEvent(name VarName) { //`log(GetFuncName()@`showvar(VarName)); if (VarName == 'TeamIndex') { if (WorldInfo.GRI != None) { // register this TeamInfo instance now WorldInfo.GRI.SetTeam(TeamIndex, self); } } else { Super.ReplicatedEvent(VarName); } } simulated event Destroyed() { local TeamInfo OtherTeam; Super.Destroyed(); // see if there's another TeamInfo that should take our spot in the GRI // (this could happen after seamless travel as there may be a time during which both the old and new TeamInfos are around) if (WorldInfo.GRI != None) { foreach DynamicActors(class'TeamInfo', OtherTeam) { if (OtherTeam != self && OtherTeam.TeamIndex == TeamIndex) { WorldInfo.GRI.SetTeam(TeamIndex, OtherTeam); break; } } } } function bool AddToTeam( Controller Other ) { // make sure loadout works for this team if ( Other == None ) { `log("Added none to team!!!"); return false; } if (Other.PlayerReplicationInfo == None) { `Warn(Other @ "is missing PlayerReplicationInfo"); ScriptTrace(); return false; } Size++; Other.PlayerReplicationInfo.SetPlayerTeam(Self); return true; } function RemoveFromTeam(Controller Other) { Size--; if ( Other != None && Other.PlayerReplicationInfo != None ) { Other.PlayerReplicationInfo.SetPlayerTeam(None); } } simulated function string GetHumanReadableName() { return TeamName; } simulated native function byte GetTeamNum(); defaultproperties { TickGroup=TG_DuringAsyncWork TeamIndex=-1 // can't be zero, otherwise the property will not be replicated and the notify will not fire NetUpdateFrequency=2 TeamColor=(r=255,g=64,b=64,a=255) } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |