mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-23 08:17:47 +01:00
Refactor chat handling
This commit is contained in:
parent
397816ef7b
commit
c1aeaceb47
5 changed files with 57 additions and 54 deletions
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Collections.ObjectModel;
|
||||
using System.Text.RegularExpressions;
|
||||
using Dalamud.Game.Chat;
|
||||
using Dalamud.Game.Internal.Libc;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Game.Command {
|
||||
|
|
@ -50,10 +51,10 @@ namespace Dalamud.Game.Command {
|
|||
dalamud.Framework.Gui.Chat.OnChatMessage += OnChatMessage;
|
||||
}
|
||||
|
||||
private void OnChatMessage(XivChatType type, uint senderId, string sender, byte[] rawMessage,
|
||||
ref string message, ref bool isHandled) {
|
||||
private void OnChatMessage(XivChatType type, uint senderId, ref StdString sender,
|
||||
ref StdString message, ref bool isHandled) {
|
||||
if (type == XivChatType.GatheringSystemMessage && senderId == 0) {
|
||||
var cmdMatch = this.CommandRegex.Match(message).Groups["command"];
|
||||
var cmdMatch = this.CommandRegex.Match(message.Value).Groups["command"];
|
||||
if (cmdMatch.Success) {
|
||||
// Yes, it's a chat command.
|
||||
var command = cmdMatch.Value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue