Ignore:
Timestamp:
Jul 26, 2014, 5:39:19 PM (10 years ago)
Author:
alloc
Message:

fixes

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

Legend:

Unmodified
Added
Removed
  • binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj

    r107 r108  
    5656    <Compile Include="src\CommonMappingFunctions.cs" />
    5757    <Compile Include="src\ConsoleOutputSeparator.cs" />
     58    <Compile Include="src\TelnetCommands\PrivateMassageConnections.cs" />
     59    <Compile Include="src\TelnetCommands\Reply.cs" />
    5860  </ItemGroup>
    5961  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  • binary-improvements/7dtd-server-fixes/src/CommandExtensions.cs

    r107 r108  
    1010                        manager.m_GUIConsole.AddCommand (new GetTime (manager.m_GUIConsole));
    1111                        manager.m_GUIConsole.AddCommand (new ListPlayersExtended (manager.m_GUIConsole));
     12                        manager.m_GUIConsole.AddCommand (new Reply (manager.m_GUIConsole));
    1213                        manager.m_GUIConsole.AddCommand (new SayToPlayer (manager.m_GUIConsole));
    1314                        manager.m_GUIConsole.AddCommand (new SetTimeReal (manager.m_GUIConsole));
  • binary-improvements/7dtd-server-fixes/src/TelnetCommands/SayToPlayer.cs

    r107 r108  
    1818        }
    1919
    20         private void SendMessage (ClientInfo _receiver, string _sender, string _message)
     20        private void SendMessage (ClientInfo _receiver, ClientInfo _sender, string _message)
    2121        {
     22                string senderName;
     23                if (_sender != null) {
     24                        PrivateMassageConnections.SetLastPMSender(_sender, _receiver);
     25                        senderName = CommonMappingFunctions.GetPlayerName (_sender);
     26                } else {
     27                        senderName = "Server";
     28                }
    2229                CommonMappingFunctions.GetConnectionManager ().networkView.RPC ("RPC_ChatMessage", _receiver.networkPlayer,
    23                                 new object[] { _message, -1, _sender + " (PM)", true    });
     30                                new object[] {
     31                        _message,
     32                        -1,
     33                        senderName + " (PM)",
     34                        true
     35                }
     36                );
    2437                string receiverName = CommonMappingFunctions.GetPlayerName (_receiver);
    25                 m_Console.SendResult ("Message to player " + (receiverName != null ? "\"" + receiverName + "\"" : "unknownName") + " sent with sender \"" + _sender + "\"");
     38                m_Console.SendResult ("Message to player " + (receiverName != null ? "\"" + receiverName + "\"" : "unknownName") + " sent with sender \"" + senderName + "\"");
    2639        }
    2740
    28         private void RunInternal (string _sender, string[] _params)
     41        private void RunInternal (ClientInfo _sender, string[] _params)
    2942        {
    3043                if (_params.Length < 2) {
     
    3851                }
    3952
    40                 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromNameOrID (_params [0]);
    41                 if (ci != null) {
    42                         SendMessage (ci, _sender, message);
     53                ClientInfo receiver = CommonMappingFunctions.GetClientInfoFromNameOrID (_params [0]);
     54                if (receiver != null) {
     55                        SendMessage (receiver, _sender, message);
    4356                } else {
    4457                        m_Console.SendResult ("Playername or entity ID not found.");
     
    4962        {
    5063                try {
    51                         this.m_Console.md000a (string.Format ("{0} executing remote command '{1}' {2}", _sender, this.Names () [0], string.Join (" ", _params)));
     64                        this.m_Console.SendResult (string.Format ("{0} executing remote command '{1}' {2}", _sender, this.Names () [0], string.Join (" ", _params)));
    5265                        ClientInfo ci = CommonMappingFunctions.GetClientInfoFromSteamID (_sender);
    53                         if (ci != null) {
    54                                 _sender = CommonMappingFunctions.GetPlayerName (ci);
    55                         }
    56                         RunInternal (_sender, _params);
     66                        RunInternal (ci, _params);
    5767                } catch (Exception e) {
    5868                        Log.Out ("Error in SayToPlayer.ExecuteRemote: " + e);
     
    6373        {
    6474                try {
    65                         RunInternal ("Server", _params);
     75                        RunInternal (null, _params);
    6676                } catch (Exception e) {
    6777                        Log.Out ("Error in SayToPlayer.Run: " + e);
Note: See TracChangeset for help on using the changeset viewer.