Skip to content

Commit e41a26d

Browse files
authored
205 fixes. (#590)
1 parent 11541e0 commit e41a26d

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎Torch/Managers/ChatManager/ChatManagerClient.cs‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using Torch.API.Managers;
1818
using Torch.Utils;
1919
using VRage.Game;
20+
using VRage.GameServices;
2021
using VRageMath;
2122
using Color = VRageMath.Color;
2223

@@ -83,10 +84,8 @@ public override void Attach()
8384
{
8485
_chatMessageRecievedReplacer = _chatMessageReceivedFactory.Invoke();
8586
_scriptedChatMessageRecievedReplacer = _scriptedChatMessageReceivedFactory.Invoke();
86-
_chatMessageRecievedReplacer.Replace(new Action<ulong, string, ChatChannel, long, string, ulong?>(Multiplayer_ChatMessageReceived),
87-
MyMultiplayer.Static);
88-
_scriptedChatMessageRecievedReplacer.Replace(
89-
new Action<string, string, string, Color>(Multiplayer_ScriptedChatMessageReceived), MyMultiplayer.Static);
87+
_chatMessageRecievedReplacer.Replace(new Action<ulong, string, ChatChannel, long, ChatMessageCustomData?>(Multiplayer_ChatMessageReceived), MyMultiplayer.Static);
88+
_scriptedChatMessageRecievedReplacer.Replace(new Action<string, string, string, Color>(Multiplayer_ScriptedChatMessageReceived), MyMultiplayer.Static);
9089
}
9190
else
9291
{
@@ -137,12 +136,12 @@ private void OnMessageEntered(string messageText, ref bool sendToOthers)
137136
}
138137

139138

140-
private void Multiplayer_ChatMessageReceived(ulong steamUserId, string messageText, ChatChannel channel, long targetId, string customAuthorName, ulong? customSenderId )
139+
private void Multiplayer_ChatMessageReceived(ulong steamUserId, string messageText, ChatChannel channel, long targetId, ChatMessageCustomData? customData )
141140
{
142141
var torchMsg = new TorchChatMessage(steamUserId, messageText, channel, targetId,
143142
(steamUserId == MyGameService.UserId) ? MyFontEnum.DarkBlue : MyFontEnum.Blue);
144143
if (!RaiseMessageRecieved(torchMsg) && HasHud)
145-
_hudChatMessageReceived.Invoke(MyHud.Chat, steamUserId, messageText, channel, targetId, customAuthorName, customSenderId ?? 0);
144+
_hudChatMessageReceived.Invoke(MyHud.Chat, steamUserId, messageText, channel, targetId, customData);
146145
}
147146

148147
private void Multiplayer_ScriptedChatMessageReceived(string message, string author, string font, Color color)
@@ -165,7 +164,7 @@ protected bool RaiseMessageRecieved(TorchChatMessage msg)
165164
protected static bool HasHud => !Sandbox.Engine.Platform.Game.IsDedicated;
166165

167166
[ReflectedMethod(Name = _hudChatMessageReceivedName)]
168-
private static Action<MyHudChat, ulong, string, ChatChannel, long, string, ulong?> _hudChatMessageReceived;
167+
private static Action<MyHudChat, ulong, string, ChatChannel, long, ChatMessageCustomData?> _hudChatMessageReceived;
169168
[ReflectedMethod(Name = _hudChatScriptedMessageReceivedName)]
170169
private static Action<MyHudChat, string, string, string, Color> _hudChatScriptedMessageReceived;
171170

0 commit comments

Comments
 (0)