mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Add WebSocketBot as external MCCScript bot with string enum serialization (#2805)
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/c762752f-46be-44f6-a05d-8c5effc8ef43
This commit is contained in:
parent
7fca2acd24
commit
c8c9f9ada5
1 changed files with 5 additions and 2 deletions
|
|
@ -285,8 +285,6 @@ public class WebSocketBot : ChatBot
|
|||
text = GetVerbatim(text);
|
||||
string message = "", username = "";
|
||||
|
||||
BroadcastEvent("OnChatRaw", SerializeData(new { text }));
|
||||
|
||||
if (IsPrivateMessage(text, ref message, ref username))
|
||||
BroadcastEvent("OnChatPrivate", SerializeData(new { sender = username, message, rawText = text }));
|
||||
else if (IsChatMessage(text, ref message, ref username))
|
||||
|
|
@ -297,6 +295,11 @@ public class WebSocketBot : ChatBot
|
|||
BroadcastEvent("OnTeleportRequest", SerializeData(new { sender = tpSender, rawText = text }));
|
||||
}
|
||||
|
||||
public override void GetText(string text, string? json)
|
||||
{
|
||||
BroadcastEvent("OnChatRaw", SerializeData(new { text, json }));
|
||||
}
|
||||
|
||||
public override bool OnDisconnect(DisconnectReason reason, string message)
|
||||
{
|
||||
BroadcastEvent("OnDisconnect", SerializeData(new { reason = reason.ToString(), message }));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue