-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from Controllerdestiny/main
更新: ServerTools 插件尝试修复Rest Ban指令
- Loading branch information
Showing
2 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Microsoft.Xna.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using TShockAPI; | ||
|
||
namespace ServerTools | ||
{ | ||
public class RestPlayer : TSPlayer | ||
{ | ||
internal List<string> CommandOutput = new List<string>(); | ||
|
||
public RestPlayer(string playerName, Group playerGroup) : base(playerName) | ||
{ | ||
Group = playerGroup; | ||
AwaitingResponse = new Dictionary<string, Action<object>>(); | ||
} | ||
|
||
public override void SendMessage(string msg, Color color) | ||
{ | ||
SendMessage(msg, color.R, color.G, color.B); | ||
} | ||
|
||
public override void SendMessage(string msg, byte red, byte green, byte blue) | ||
{ | ||
this.CommandOutput.Add(msg); | ||
} | ||
|
||
public override void SendInfoMessage(string msg) | ||
{ | ||
SendMessage(msg, Color.Yellow); | ||
} | ||
|
||
public override void SendSuccessMessage(string msg) | ||
{ | ||
SendMessage(msg, Color.Green); | ||
} | ||
|
||
public override void SendWarningMessage(string msg) | ||
{ | ||
SendMessage(msg, Color.OrangeRed); | ||
} | ||
|
||
public override void SendErrorMessage(string msg) | ||
{ | ||
SendMessage(msg, Color.Red); | ||
} | ||
|
||
public List<string> GetCommandOutput() | ||
{ | ||
return this.CommandOutput; | ||
} | ||
} | ||
} |