Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ greetPlayer()

static void Terraria.NetMessage.greetPlayer ( int plr)
inlinestatic

Definition at line 2689 of file NetMessage.cs.

2690 {
2691 if (Main.motd == "")
2692 {
2693 ChatHelper.SendChatMessageToClient(NetworkText.FromFormattable("{0} {1}!", Lang.mp[18].ToNetworkText(), Main.worldName), new Color(255, 240, 20), plr);
2694 }
2695 else
2696 {
2697 ChatHelper.SendChatMessageToClient(NetworkText.FromLiteral(Main.motd), new Color(255, 240, 20), plr);
2698 }
2699 string text = "";
2700 for (int i = 0; i < 255; i++)
2701 {
2702 if (Main.player[i].active)
2703 {
2704 text = ((!(text == "")) ? (text + ", " + Main.player[i].name) : (text + Main.player[i].name));
2705 }
2706 }
2707 ChatHelper.SendChatMessageToClient(NetworkText.FromKey("Game.JoinGreeting", text), new Color(255, 240, 20), plr);
2708 }
static void SendChatMessageToClient(NetworkText text, Color color, int playerId)
Definition ChatHelper.cs:28
static NetworkText FromFormattable(string text, params object[] substitutions)
static NetworkText FromLiteral(string text)
static NetworkText FromKey(string key, params object[] substitutions)

References Terraria.Localization.NetworkText.FromFormattable(), Terraria.Localization.NetworkText.FromKey(), Terraria.Localization.NetworkText.FromLiteral(), Terraria.Main.motd, Terraria.Lang.mp, Terraria.Main.player, Terraria.Chat.ChatHelper.SendChatMessageToClient(), System.text, and Terraria.Main.worldName.

Referenced by Terraria.MessageBuffer.GetData().