Changeset 267 for binary-improvements/7dtd-server-fixes/src
- Timestamp:
- Apr 28, 2016, 1:41:44 PM (9 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/API.cs
r238 r267 28 28 } 29 29 30 public override bool ChatMessage (ClientInfo _cInfo, string _message, string _playerName) {31 return ChatHookExample.Hook (_cInfo, _ message, _playerName);30 public override bool ChatMessage (ClientInfo _cInfo, EnumGameMessages _type, string _msg, string _mainName, bool _localizeMain, string _secondaryName, bool _localizeSecondary) { 31 return ChatHookExample.Hook (_cInfo, _type, _msg, _mainName); 32 32 } 33 33 } -
binary-improvements/7dtd-server-fixes/src/ChatHookExample.cs
r238 r267 4 4 { 5 5 public class ChatHookExample { 6 private const string BBFILTER = "[ffffffff][/url][/b][/i][/u][/s][/sub][/sup][ff]";7 6 private const string ANSWER = " [ff0000]I[-] [ff7f00]W[-][ffff00]A[-][80ff00]S[-] [00ffff]H[-][0080ff]E[-][0000ff]R[-][8b00ff]E[-]"; 8 7 9 public static bool Hook (ClientInfo _cInfo, string _message, string _playerName) {8 public static bool Hook (ClientInfo _cInfo, EnumGameMessages _type, string _message, string _playerName) { 10 9 if (!string.IsNullOrEmpty (_message)) { 11 if (_message.EndsWith (BBFILTER + BBFILTER)) {12 _message = _message.Remove (_message.Length - 2 * BBFILTER.Length);13 }14 15 10 if (_message.ToLower () == "/alloc") { 16 11 if (_cInfo != null) { 17 12 Log.Out ("Sent chat hook reply to {0}", _cInfo.playerId); 18 _cInfo.SendPackage (new NetPackageGameMessage ( ANSWER, ""));13 _cInfo.SendPackage (new NetPackageGameMessage (EnumGameMessages.Chat, ANSWER, "", false, "", false)); 19 14 } else { 20 15 Log.Error ("Argument _cInfo null on message: {0}", _message);
Note:
See TracChangeset
for help on using the changeset viewer.