1- using System ;
1+ using Sandbox . Engine . Multiplayer ;
2+ using Sandbox . Game . Gui ;
3+ using Sandbox . Game . Multiplayer ;
4+ using System ;
25using System . Collections . Generic ;
36using System . Linq ;
47using System . Text ;
58using System . Threading . Tasks ;
6- using Sandbox . Engine . Multiplayer ;
7- using Sandbox . Game . Gui ;
8- using Sandbox . Game . Multiplayer ;
99using Torch . Utils ;
1010using VRage . Game ;
11+ using VRage . GameServices ;
1112using VRage . Network ;
1213using VRage . Replication ;
1314using VRageMath ;
@@ -54,6 +55,7 @@ public TorchChatMessage(string author, string message, Color color, string font
5455 Target = 0 ;
5556 Font = font ;
5657 Color = color == default ? ColorUtils . TranslateColor ( font ) : color ;
58+ CustomData = null ;
5759 }
5860
5961 /// <summary>
@@ -73,6 +75,7 @@ public TorchChatMessage(string author, ulong authorSteamId, string message, Chat
7375 Target = target ;
7476 Font = font ;
7577 Color = color == default ? ColorUtils . TranslateColor ( font ) : color ;
78+ CustomData = null ;
7679 }
7780
7881 /// <summary>
@@ -91,6 +94,20 @@ public TorchChatMessage(ulong authorSteamId, string message, ChatChannel channel
9194 Target = target ;
9295 Font = font ;
9396 Color = color == default ? ColorUtils . TranslateColor ( font ) : color ;
97+ CustomData = null ;
98+ }
99+
100+ public TorchChatMessage ( ChatMsg msg )
101+ {
102+ Timestamp = DateTime . Now ;
103+ AuthorSteamId = msg . Author ;
104+ Author = MyMultiplayer . Static ? . GetMemberName ( msg . Author ) ?? "Player" ;
105+ Message = msg . Text ;
106+ Channel = ( ChatChannel ) msg . Channel ;
107+ Target = msg . TargetId ;
108+ Font = DEFAULT_FONT ;
109+ Color = default ;
110+ CustomData = msg . CustomData ;
94111 }
95112
96113 /// <summary>
@@ -125,6 +142,11 @@ public TorchChatMessage(ulong authorSteamId, string message, ChatChannel channel
125142 /// The chat message color.
126143 /// </summary>
127144 public readonly Color Color ;
145+
146+ /// <summary>
147+ /// Chat message custom data, if any.
148+ /// </summary>
149+ public readonly ChatMessageCustomData ? CustomData ;
128150 }
129151
130152 /// <summary>
0 commit comments