@@ -310,8 +310,7 @@ replication
310
310
ServerGiveCommand , ServerIssueCompliance , ServerOnEffectStopped , ServerSetVoiceType ,
311
311
ServerRetryStatsAuth , ServerSetMPLoadOutPrimaryAmmo , ServerSetMPLoadOutSecondaryAmmo ,
312
312
ServerViewportActivate , ServerViewportDeactivate ,
313
- ServerHandleViewportFire , ServerHandleViewportReload ,
314
- ServerGetPlayerRoomName ;
313
+ ServerHandleViewportFire , ServerHandleViewportReload ;
315
314
}
316
315
317
316
///////////////////////////////////////////////////////////////////////////////
@@ -3055,7 +3054,7 @@ state Dead
3055
3054
3056
3055
exec function TeamSay( string Msg )
3057
3056
{
3058
- // log( self$" ::TeamSay ( "$Msg$" )" );
3057
+ log( self$" ::TeamSay ( "$Msg$" )" );
3059
3058
SwatGameInfo(Level.Game).BroadcastObservers( self, Msg, 'TeamSay');
3060
3059
}
3061
3060
}
@@ -3119,7 +3118,7 @@ state ObserveFromTeamOrLocation
3119
3118
3120
3119
exec function TeamSay ( string Msg )
3121
3120
{
3122
- // log( self$"::TeamSay( "$Msg$" )" );
3121
+ log ( self$ "::TeamSay( " $Msg$ " )" );
3123
3122
SwatGameInfo (Level .Game ).BroadcastObservers ( self , Msg , 'TeamSay' );
3124
3123
}
3125
3124
}
@@ -4302,20 +4301,55 @@ function ClientRoundStarted()
4302
4301
4303
4302
///////////////////////////////////////////////////////////////////////////////
4304
4303
4304
+ exec function Say ( string Msg )
4305
+ {
4306
+ // log(self$"::Say - "$Pawn.GetRoomName()$" - ("$Msg$")");
4307
+ if (PlayerReplicationInfo .bAdmin && left (Msg ,1 ) == "#" )
4308
+ {
4309
+ Level .Game .AdminSay (right (Msg ,len (Msg )-1 ));
4310
+ return ;
4311
+ }
4312
+
4313
+ // On a dedicated server, no one gets TeamMessage(), so we need to print
4314
+ // it here. We don't do it for listen servers, because we'd get double log
4315
+ // messages (since listen servers do get TeamMessage() ).
4316
+ if ( Level .NetMode == NM_DedicatedServer )
4317
+ {
4318
+ mplog ( "ChatMessage( " $Msg$ ", Say )" );
4319
+ }
4320
+
4321
+ if (Pawn != None )
4322
+ Level .Game .Broadcast (self , Msg , 'Say' , None , string (Pawn .GetRoomName ()));
4323
+ else
4324
+ Level .Game .Broadcast (self , Msg , 'Say' );
4325
+ }
4326
+
4327
+ exec function TeamSay ( string Msg )
4328
+ {
4329
+ // log(self$"::TeamSay("$msg$")");
4330
+ if ( !GameReplicationInfo .bTeamGame )
4331
+ {
4332
+ Say ( Msg );
4333
+ return ;
4334
+ }
4335
+
4336
+ Level .Game .BroadcastTeam ( self , Level .Game .ParseMessageString ( Level .Game .BaseMutator , self , Msg ), 'TeamSay' , string (Pawn .GetRoomName ()));
4337
+ }
4338
+
4305
4339
event ClientMessage ( coerce string S , optional Name Type )
4306
4340
{
4307
4341
//log("[dkaplan] >>> "$self$"::ClientMessage( "$S$", "$Type$" )" );
4308
4342
TeamMessage (PlayerReplicationInfo , S , Type );
4309
4343
ConsoleMessage (S );
4310
4344
}
4311
4345
4312
- event TeamMessage (PlayerReplicationInfo PRI , coerce string S , name Type )
4346
+ event TeamMessage (PlayerReplicationInfo PRI , coerce string S , name Type , optional string Location )
4313
4347
{
4314
- //log("[dkaplan] >>> "$self$"::TeamMessage( "$PRI$", "$S$", "$Type$" )" );
4348
+ //log("[dkaplan] >>> "$self$"::TeamMessage( "$PRI$", "$S$", "$Type$" "$Location$" )" );
4315
4349
4316
- if ((( Type == 'Say' ) || ( Type == 'TeamSay' )) && ( PRI != None ) )
4350
+ if (Type == 'Say' || Type == 'TeamSay' )
4317
4351
{
4318
- if (!( ServerGetPlayerRoomName ( PRI . PlayerID ) ~ = "None" ) )
4352
+ if (Location != "" && Location ! = "None" )
4319
4353
{
4320
4354
// If we have a RoomName of None, we are spectating
4321
4355
if (Type == 'Say' ) {
@@ -4324,7 +4358,7 @@ event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type)
4324
4358
Type = 'TeamSayLocalized' ;
4325
4359
}
4326
4360
4327
- S = PRI .PlayerName$ "\t " $ServerGetPlayerRoomName ( PRI . PlayerID ) $ "\t " $S ;
4361
+ S = PRI .PlayerName$ "\t " $Location $ "\t " $S ;
4328
4362
}
4329
4363
else
4330
4364
{
@@ -6047,28 +6081,6 @@ simulated event RenderOverlays( canvas Canvas )
6047
6081
6048
6082
///////////////////////////////////////////////////////////////////////////////
6049
6083
6050
- function string ServerGetPlayerRoomName (int PlayerID )
6051
- {
6052
- local Controller ControllerIter ;
6053
- local PlayerController PCIter ;
6054
-
6055
- for (ControllerIter = Level .ControllerList ; ControllerIter != None ; ControllerIter = ControllerIter .NextController )
6056
- {
6057
- PCIter = PlayerController (ControllerIter );
6058
- if (PCIter == None )
6059
- {
6060
- // Not a player controller
6061
- continue ;
6062
- }
6063
- else if (PCIter .PlayerReplicationInfo .PlayerID != PlayerID )
6064
- {
6065
- continue ;
6066
- }
6067
- return string (PCIter .Pawn .GetRoomName ());
6068
- }
6069
- return "None" ;
6070
- }
6071
-
6072
6084
///////////////////////////////////////////////////////////////////////////////
6073
6085
///////////////////////////////////////////////////////////////////////////////
6074
6086
0 commit comments