Changeset 267 for binary-improvements


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
Files:
6 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);
  • binary-improvements/AllocsCommands/Chat.cs

    r251 r267  
    1313                                senderName = "Server";
    1414                        }
    15                         _receiver.SendPackage (new NetPackageGameMessage (_message, senderName + " (PM)"));
     15                        _receiver.SendPackage (new NetPackageGameMessage (EnumGameMessages.Chat, _message, senderName + " (PM)", false, "", false));
    1616                        string receiverName = _receiver.playerName;
    1717                        SdtdConsole.Instance.Output ("Message to player " + (receiverName != null ? "\"" + receiverName + "\"" : "unknownName") + " sent with sender \"" + senderName + "\"");
  • binary-improvements/MapRendering/API.cs

    r250 r267  
    1010                }
    1111
     12//              public override void GameStartDone () {
     13//                      if (AllocsFixes.NetConnections.Servers.Web.Handlers.ItemIconHandler.Instance != null) {
     14//                              AllocsFixes.NetConnections.Servers.Web.Handlers.ItemIconHandler.Instance.LoadIcons ();
     15//                      }
     16//              }
     17
    1218                public override void CalcChunkColorsDone (Chunk _chunk) {
    1319                        AllocsFixes.MapRendering.MapRendering.RenderSingleChunk (_chunk);
  • binary-improvements/MapRendering/Web/Handlers/ItemIconHandler.cs

    r254 r267  
    99{
    1010        public class ItemIconHandler : PathHandler {
     11                private static ItemIconHandler instance = null;
     12                public static ItemIconHandler Instance {
     13                        get { return instance; }
     14                }
     15
    1116                private string staticPart;
    1217                private bool logMissingFiles;
     
    1722                        this.staticPart = staticPart;
    1823                        this.logMissingFiles = logMissingFiles;
     24                        ItemIconHandler.instance = this;
    1925                }
    2026
     
    4753                }
    4854
    49                 private bool LoadIcons () {
     55                public bool LoadIcons () {
    5056                        lock (icons) {
    5157                                if (loaded) {
  • binary-improvements/server-fixes.userprefs

    r256 r267  
    11<Properties>
    22  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Version" />
    3   <MonoDevelop.Ide.Workbench ActiveDocument="MapRendering/ModInfo.xml">
     3  <MonoDevelop.Ide.Workbench ActiveDocument="MapRendering/API.cs">
    44    <Files>
    55      <File FileName="7dtd-server-fixes/ModInfo.xml" Line="1" Column="1" />
    66      <File FileName="AllocsCommands/ModInfo.xml" Line="1" Column="1" />
    7       <File FileName="MapRendering/ModInfo.xml" Line="21" Column="21" />
    8       <File FileName="MapRendering/Web/Web.cs" Line="1" Column="1" />
     7      <File FileName="MapRendering/ModInfo.xml" Line="1" Column="1" />
     8      <File FileName="MapRendering/Web/Web.cs" Line="10" Column="10" />
    99      <File FileName="MapRendering/Web/API/ExecuteConsoleCommand.cs" Line="1" Column="1" />
    1010      <File FileName="MapRendering/Web/LogBuffer.cs" Line="1" Column="1" />
     
    1313      <File FileName="MapRendering/Web/Handlers/ApiHandler.cs" Line="1" Column="1" />
    1414      <File FileName="MapRendering/Commands/WebTokens.cs" Line="1" Column="1" />
    15       <File FileName="AllocsCommands/Commands/TeleportPlayer.cs" Line="63" Column="63" />
    16       <File FileName="MapRendering/Web/Handlers/ItemIconHandler.cs" Line="42" Column="42" />
     15      <File FileName="AllocsCommands/Commands/TeleportPlayer.cs" Line="1" Column="1" />
     16      <File FileName="MapRendering/Web/Handlers/ItemIconHandler.cs" Line="20" Column="20" />
     17      <File FileName="MapRendering/API.cs" Line="1" Column="1" />
    1718    </Files>
    1819  </MonoDevelop.Ide.Workbench>
Note: See TracChangeset for help on using the changeset viewer.