Changeset 142 for binary-improvements/7dtd-server-fixes/src
- Timestamp:
- Aug 29, 2014, 4:18:16 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/MapRendering/MapRenderBlockBuffer.cs
r130 r142 37 37 Directory.CreateDirectory (folder); 38 38 if (!fileName.Equals (currentBlockMap)) { 39 if (currentBlockMap.Length > 0) 40 saveTextureToFile (currentBlockMap); 39 SaveBlock(); 41 40 loadTextureFromFile (fileName); 42 41 } -
binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/Telnet.cs
r132 r142 113 113 string res = ""; 114 114 for (int i = 0; i < line.Length; i++) { 115 if (line [i] >= ' ' && line [i] != '\'' && line [i] <= '~') {115 if (line [i] >= ' ' && line [i] != '\'') { 116 116 res += line [i]; 117 117 } -
binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/TelnetConnection.cs
r132 r142 2 2 using System.Net; 3 3 using System.Net.Sockets; 4 using System.Text; 4 5 5 6 namespace AllocsFixes.NetConnections.Servers.Telnet … … 11 12 private TcpClient client; 12 13 private NetworkStream stream; 13 private string lineBuffer = string.Empty; 14 private int lineBufferLength = 0; 15 private byte[] lineBuffer = new byte[200]; 14 16 private EndPoint endpoint; 15 17 … … 38 40 try { 39 41 if (!IsClosed () && stream.CanWrite) { 40 for (int i = 0; i < s.Length; i++) { 41 WriteByte ((byte)s [i]); 42 } 42 byte[] utfData = Encoding.UTF8.GetBytes (s); 43 stream.Write(utfData, 0, utfData.Length); 43 44 WriteByte (13); 44 45 WriteByte (10); … … 79 80 int b = stream.ReadByte (); 80 81 if (b == '\r' || b == '\n') { 81 if (lineBuffer .Length > 0)82 if (lineBufferLength > 0) 82 83 return true; 83 } else { 84 lineBuffer += (char)b; 84 } else if (b >= 0) { 85 lineBuffer[lineBufferLength] = (byte)b; 86 lineBufferLength++; 85 87 } 86 88 } … … 90 92 public string GetLine () 91 93 { 92 string res = lineBuffer;93 lineBuffer = string.Empty;94 string res = Encoding.UTF8.GetString(lineBuffer, 0, lineBufferLength);; 95 lineBufferLength = 0; 94 96 return res; 95 97 } -
binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs
r140 r142 113 113 { 114 114 try { 115 Log.Out ("NOT IMPLEMENTED: Web.WriteToClient");115 //Log.Out ("NOT IMPLEMENTED: Web.WriteToClient"); 116 116 } catch (Exception e) { 117 117 Log.Out ("Error in Web.WriteToClient: " + e); … … 122 122 { 123 123 try { 124 Log.Out ("NOT IMPLEMENTED: Web.WriteToClient_Single");124 //Log.Out ("NOT IMPLEMENTED: Web.WriteToClient_Single"); 125 125 } catch (Exception e) { 126 126 Log.Out ("Error in Web.WriteToClient_Single: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.