sendUnformatted method in PlayerComp (#8575)

This commit is contained in:
Даркнесс#3729
2023-05-10 19:52:47 +03:00
committed by GitHub
parent cac29c4ecc
commit 4f845202f8

View File

@@ -323,13 +323,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
}
void sendMessage(String text){
if(isLocal()){
if(ui != null){
ui.chatfrag.addMessage(text);
}
}else{
Call.sendMessage(con, text, null, null);
}
sendMessage(text, null, null);
}
void sendMessage(String text, Player from){
@@ -346,6 +340,14 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
}
}
void sendUnformatted(String unformatted){
sendUnformatted(null, unformatted);
}
void sendUnformatted(Player from, String unformatted){
sendMessage(netServer.chatFormatter.format(from, unformatted), from, unformatted);
}
PlayerInfo getInfo(){
if(isLocal()){
throw new IllegalArgumentException("Local players cannot be traced and do not have info.");