Esempio n. 1
0
 public static void BroadcastChatMessageAs(
     byte messageAuthor,
     NetworkText text,
     Color color,
     int excludedPlayer = -1)
 {
     if (excludedPlayer == Main.myPlayer)
     {
         return;
     }
     ChatHelper.DisplayMessage(text, color, messageAuthor);
 }
Esempio n. 2
0
 public static void SendChatMessageToClientAs(
     byte messageAuthor,
     NetworkText text,
     Color color,
     int playerId)
 {
     if (playerId != Main.myPlayer)
     {
         return;
     }
     ChatHelper.DisplayMessage(text, color, messageAuthor);
 }
Esempio n. 3
0
        public static void SendChatMessageToClientAs(
            byte messageAuthor,
            NetworkText text,
            Color color,
            int playerId)
        {
            NetPacket packet = NetTextModule.SerializeServerMessage(text, color, messageAuthor);

            NetManager.Instance.SendToClient(packet, playerId);
            if (playerId != Main.myPlayer)
            {
                return;
            }
            ChatHelper.DisplayMessage(text, color, messageAuthor);
        }
Esempio n. 4
0
        public static void DisplayMessage(NetworkText text, Color color, byte messageAuthor)
        {
            string str = text.ToString();

            if (messageAuthor < byte.MaxValue)
            {
                Main.player[(int)messageAuthor].chatOverhead.NewMessage(str, Main.PlayerOverheadChatMessageDisplayTime);
                Main.player[(int)messageAuthor].chatOverhead.color = color;
                str = NameTagHandler.GenerateTag(Main.player[(int)messageAuthor].name) + " " + str;
            }
            if (ChatHelper.ShouldCacheMessage())
            {
                ChatHelper.CacheMessage(str, color);
            }
            else
            {
                Main.NewTextMultiline(str, false, color, -1);
            }
        }
Esempio n. 5
0
 public static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer = -1)
 {
     ChatHelper.BroadcastChatMessageAs(byte.MaxValue, text, color, excludedPlayer);
 }
Esempio n. 6
0
 public static void SendChatMessageToClient(NetworkText text, Color color, int playerId)
 {
     ChatHelper.SendChatMessageToClientAs(byte.MaxValue, text, color, playerId);
 }
Esempio n. 7
0
 public static void DisplayMessageOnClient(NetworkText text, Color color, int playerId)
 {
     ChatHelper.DisplayMessage(text, color, byte.MaxValue);
 }