Changeset 224 for binary-improvements/7dtd-server-fixes/src/NetConnections
- Timestamp:
- Apr 2, 2015, 9:16:34 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src/NetConnections
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/NetConnections/ConsoleOutputSeparator.cs
r213 r224 22 22 private static List<NetCommand> netCommandQueue = new List<NetCommand> (); 23 23 private static bool isCurrentCommandFromClient = false; 24 private static int issuerOfCurrentClientCommand = -1; 24 25 private static IConnection issuerOfCurrentCommand; 25 26 26 public static void C_ExecuteCmdFromClient (ConsoleSdtd console, NetworkPlayer _networkPlayer, string _playerName, string _playerID, string _command)27 public static void C_ExecuteCmdFromClient (ConsoleSdtd console, int _entityId, string _playerName, string _playerID, string _command) 27 28 { 28 29 Log.Out ("Executed command \"" + _command + "\" from player \"" + _playerName + "\""); … … 30 31 lock (netCommandQueue) { 31 32 isCurrentCommandFromClient = true; 32 console.issuerOfCurrentClientCommand = _networkPlayer; 33 console.ExecuteClientCmdInternal (_playerName, _playerID, _command); 33 issuerOfCurrentClientCommand = _entityId; 34 35 string[] array = _command.Split (' '); 36 if (array.Length == 0) { 37 C_SendResult (console, "*** ERROR: empty command '" + _command + "'"); 38 } else { 39 ConsoleCommand cmd = console.getCommand (_command); 40 if (cmd != null) { 41 string[] array2 = new string[array.Length - 1]; 42 for (int i = 1; i < array.Length; i++) { 43 array2 [i - 1] = array [i]; 44 } 45 cmd.ExecuteRemote (_playerID, array2); 46 } else { 47 C_SendResult (console, "*** ERROR: unknown command '" + array [0] + "'"); 48 } 49 } 50 34 51 isCurrentCommandFromClient = false; 35 52 } … … 40 57 { 41 58 if (isCurrentCommandFromClient) { 42 console.gameManager.GetRPCNetworkView ().RPC ("RPC_Console", console.issuerOfCurrentClientCommand, new object[] 43 { 44 _line, 45 false 46 } 47 ); 59 CommonMappingFunctions.GetConnectionManager ().SendPackage (new NetPackage_ConsoleCmdClient (_line, false), new PackageDestinationSingleEntityID (issuerOfCurrentClientCommand)); 48 60 } else { 49 61 if (console.telnetServer != null && issuerOfCurrentCommand != null) -
binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/TelnetConnection.cs
r202 r224 13 13 private readonly BlockingQueue<string> toClientQueue = new BlockingQueue<string> (); 14 14 private readonly Telnet telnet; 15 private readonly Thread receiveThread = null;16 private readonly Thread sendThread = null;17 15 private bool authenticated = false; 18 16 private readonly bool authEnabled; … … 44 42 Log.Out ("Telnet connection from: " + endpoint); 45 43 46 receiveThread = ThreadMaster.Create ("TelnetClientReceive_" + endpoint.ToString (), new ThreadStart (ReceiveThread)); 47 receiveThread.Start (); 48 sendThread = ThreadMaster.Create ("TelnetClientSend" + endpoint.ToString (), new ThreadStart (SendThread)); 49 sendThread.Start (); 44 ThreadManager.StartThread ("TelnetClientReceive_" + endpoint.ToString (), new ThreadManager.ThreadFunctionDelegate (ReceiveThread), System.Threading.ThreadPriority.BelowNormal); 45 ThreadManager.StartThread ("TelnetClientSend_" + endpoint.ToString (), new ThreadManager.ThreadFunctionDelegate (SendThread), System.Threading.ThreadPriority.BelowNormal); 50 46 51 47 if (authEnabled) { … … 77 73 } 78 74 79 private void ReceiveThread ( )75 private void ReceiveThread (ThreadManager.ThreadInfo _tInfo) 80 76 { 81 77 try { … … 116 112 if (!closed) 117 113 Close (); 118 ThreadMaster.Remove (Thread.CurrentThread.Name);119 114 } 120 115 121 private void SendThread ( )116 private void SendThread (ThreadManager.ThreadInfo _tInfo) 122 117 { 123 118 try { … … 140 135 if (!closed) 141 136 Close (); 142 ThreadMaster.Remove (Thread.CurrentThread.Name);143 137 } 144 138
Note:
See TracChangeset
for help on using the changeset viewer.