public void On(NewChatMessageClientToServer message) { if (!IsFromPlayersAtThisTable(message)) { return; } ServerPlayer sender = message.originConnection == playerA?.connection ? playerA : playerB; SendAllAtTable(NotifyChatEntryMessage.MakeWithTimestamp($"{sender.nickname}: {message.message}")); }
public void On(NotifyChatEntryMessage message) { Assert.IsTrue(isEntered); var text = message.message; switch (message.kind) { case NotifyChatEntryMessage.Kind.ServerMessage: text = FormatServerMessage(text); break; default: break; } uiPanel.AddChatLine(text); }
private NotifyChatEntryMessage MakeServerChatMessage(string message) { return(NotifyChatEntryMessage.MakeWithTimestamp(message, NotifyChatEntryMessage.Kind.ServerMessage)); }