class repl_Console extends KFConsole;


// =============================================================================
//                               ANTI-SPAM !!!
// =============================================================================

// remove text spam
// XInterface.ExtendedConsole
function Chat(coerce string Msg, float MsgLife, PlayerReplicationInfo PRI)
{
  local int index;

  // add word filtering
  if (class'Settings'.static.bIsWordBanned(Msg))
    return;

  // convert cyrilic into barbaric
  Msg = class'o_CyrillicEncodeUtilities'.static.EnCodeStringHide(Msg);

  Message(Msg, MsgLife);    // For compatibility

  Index = ChatMessages.Length;
  ChatMessages.Length = Index+1;
  ChatMessages[Index].Message = Msg;

  if (PRI != none && PRI.Team!=none)
    ChatMessages[Index].Team = PRI.Team.TeamIndex;
  else
    ChatMessages[Index].Team = 2;

  if (!bTeamChatOnly || PRI == none || PRI.Team == none || PRI.Team == ViewportOwner.Actor.PlayerReplicationInfo.Team)
  {
    OnChat(Msg, ChatMessages[Index].team);
    OnChatMessage(Msg);
  }

  if (ChatMessages.Length > 100)
    ChatMessages.Remove(0, 1);
}

defaultproperties
{
}
