Changeset 108 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Jul 26, 2014, 5:39:19 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r107 r108 56 56 <Compile Include="src\CommonMappingFunctions.cs" /> 57 57 <Compile Include="src\ConsoleOutputSeparator.cs" /> 58 <Compile Include="src\TelnetCommands\PrivateMassageConnections.cs" /> 59 <Compile Include="src\TelnetCommands\Reply.cs" /> 58 60 </ItemGroup> 59 61 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
binary-improvements/7dtd-server-fixes/src/CommandExtensions.cs
r107 r108 10 10 manager.m_GUIConsole.AddCommand (new GetTime (manager.m_GUIConsole)); 11 11 manager.m_GUIConsole.AddCommand (new ListPlayersExtended (manager.m_GUIConsole)); 12 manager.m_GUIConsole.AddCommand (new Reply (manager.m_GUIConsole)); 12 13 manager.m_GUIConsole.AddCommand (new SayToPlayer (manager.m_GUIConsole)); 13 14 manager.m_GUIConsole.AddCommand (new SetTimeReal (manager.m_GUIConsole)); -
binary-improvements/7dtd-server-fixes/src/TelnetCommands/SayToPlayer.cs
r107 r108 18 18 } 19 19 20 private void SendMessage (ClientInfo _receiver, string_sender, string _message)20 private void SendMessage (ClientInfo _receiver, ClientInfo _sender, string _message) 21 21 { 22 string senderName; 23 if (_sender != null) { 24 PrivateMassageConnections.SetLastPMSender(_sender, _receiver); 25 senderName = CommonMappingFunctions.GetPlayerName (_sender); 26 } else { 27 senderName = "Server"; 28 } 22 29 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 ); 24 37 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 + "\""); 26 39 } 27 40 28 private void RunInternal ( string_sender, string[] _params)41 private void RunInternal (ClientInfo _sender, string[] _params) 29 42 { 30 43 if (_params.Length < 2) { … … 38 51 } 39 52 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); 43 56 } else { 44 57 m_Console.SendResult ("Playername or entity ID not found."); … … 49 62 { 50 63 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))); 52 65 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromSteamID (_sender); 53 if (ci != null) { 54 _sender = CommonMappingFunctions.GetPlayerName (ci); 55 } 56 RunInternal (_sender, _params); 66 RunInternal (ci, _params); 57 67 } catch (Exception e) { 58 68 Log.Out ("Error in SayToPlayer.ExecuteRemote: " + e); … … 63 73 { 64 74 try { 65 RunInternal ( "Server", _params);75 RunInternal (null, _params); 66 76 } catch (Exception e) { 67 77 Log.Out ("Error in SayToPlayer.Run: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.