Ignore:
Timestamp:
Apr 28, 2016, 1:41:44 PM (9 years ago)
Author:
alloc
Message:

Update Chat stuff to 14.6 b26

Location:
binary-improvements/7dtd-server-fixes/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/7dtd-server-fixes/src/API.cs

    r238 r267  
    2828                }
    2929
    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);
    3232                }
    3333        }
  • binary-improvements/7dtd-server-fixes/src/ChatHookExample.cs

    r238 r267  
    44{
    55        public class ChatHookExample {
    6                 private const string BBFILTER = "[ffffffff][/url][/b][/i][/u][/s][/sub][/sup][ff]";
    76                private const string ANSWER = "     [ff0000]I[-] [ff7f00]W[-][ffff00]A[-][80ff00]S[-] [00ffff]H[-][0080ff]E[-][0000ff]R[-][8b00ff]E[-]";
    87
    9                 public static bool Hook (ClientInfo _cInfo, string _message, string _playerName) {
     8                public static bool Hook (ClientInfo _cInfo, EnumGameMessages _type, string _message, string _playerName) {
    109                        if (!string.IsNullOrEmpty (_message)) {
    11                                 if (_message.EndsWith (BBFILTER + BBFILTER)) {
    12                                         _message = _message.Remove (_message.Length - 2 * BBFILTER.Length);
    13                                 }
    14 
    1510                                if (_message.ToLower () == "/alloc") {
    1611                                        if (_cInfo != null) {
    1712                                                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));
    1914                                        } else {
    2015                                                Log.Error ("Argument _cInfo null on message: {0}", _message);
Note: See TracChangeset for help on using the changeset viewer.