Add list of commands that are eligible to be run to the Playercommand hook, so that a plugin may override this.
Add an event for TShock Chat, pushing out the raw text and the text tshock sends, allowing for plugins to run after tshock and change what tshock is sending.
This commit is contained in:
parent
0872283039
commit
99de841f5d
3 changed files with 36 additions and 11 deletions
|
|
@ -1067,9 +1067,10 @@ namespace TShockAPI
|
|||
}
|
||||
else if (!TShock.Config.EnableChatAboveHeads)
|
||||
{
|
||||
Utils.Broadcast(
|
||||
String.Format(Config.ChatFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix, args.Text),
|
||||
tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
|
||||
var text = String.Format(Config.ChatFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix,
|
||||
args.Text);
|
||||
Hooks.PlayerHooks.OnPlayerChat(tsplr, args.Text, ref text);
|
||||
Utils.Broadcast(text, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
|
||||
args.Handled = true;
|
||||
}
|
||||
else
|
||||
|
|
@ -1079,12 +1080,14 @@ namespace TShockAPI
|
|||
ply.name = String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix);
|
||||
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, ply.name, args.Who, 0, 0, 0, 0);
|
||||
ply.name = name;
|
||||
NetMessage.SendData((int) PacketTypes.ChatText, -1, args.Who, args.Text, args.Who, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
|
||||
var text = args.Text;
|
||||
Hooks.PlayerHooks.OnPlayerChat(tsplr, args.Text, ref text);
|
||||
NetMessage.SendData((int)PacketTypes.ChatText, -1, args.Who, text, args.Who, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
|
||||
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, name, args.Who, 0, 0, 0, 0);
|
||||
|
||||
string msg = String.Format("<{0}> {1}",
|
||||
String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix),
|
||||
args.Text);
|
||||
text);
|
||||
|
||||
tsplr.SendMessage(msg, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue