Changeset 93 for binary-improvements/7dtd-server-fixes/src
- Timestamp:
- Jul 20, 2014, 8:50:13 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/AllocsNetTelnetServer.cs
r91 r93 14 14 private static bool closed = false; 15 15 private static bool authEnabled = false; 16 private static List<AllocsTelnetConnection> conn s = new List<AllocsTelnetConnection> ();16 private static List<AllocsTelnetConnection> connections = new List<AllocsTelnetConnection> (); 17 17 18 18 public static void init (int port) … … 38 38 if (listener.Pending ()) { 39 39 AllocsTelnetConnection c = new AllocsTelnetConnection (listener.AcceptTcpClient (), authEnabled); 40 conn s.Add (c);40 connections.Add (c); 41 41 Log.Out ("Telnet connection from: " + c.GetEndPoint ()); 42 42 if (authEnabled) { … … 47 47 } 48 48 49 foreach (AllocsTelnetConnection c in conn s) {49 foreach (AllocsTelnetConnection c in connections) { 50 50 if (c.IsClosed ()) { 51 51 c.Close (); 52 conn s.Remove (c);52 connections.Remove (c); 53 53 break; 54 54 } … … 70 70 Log.Out ("Telnet connection closed by client: " + c.GetEndPoint ()); 71 71 c.Close (); 72 conn s.Remove (c);72 connections.Remove (c); 73 73 break; 74 74 } … … 124 124 listener.Stop (); 125 125 } 126 foreach (AllocsTelnetConnection c in conn s) {126 foreach (AllocsTelnetConnection c in connections) { 127 127 c.Close (); 128 128 } … … 139 139 console.AddCommand(new SayToPlayer(console)); 140 140 console.AddCommand(new SetTimeReal(console)); 141 console.AddCommand(new ShowInventory(console)); 141 142 } 142 143 143 144 private static void RemoveClosedConnections () 144 145 { 145 foreach (AllocsTelnetConnection c in conn s) {146 foreach (AllocsTelnetConnection c in connections) { 146 147 if (c.IsClosed ()) { 147 148 c.Close (); … … 156 157 } 157 158 RemoveClosedConnections (); 158 foreach (AllocsTelnetConnection c in conn s) {159 foreach (AllocsTelnetConnection c in connections) { 159 160 if (c.IsAuthenticated ()) 160 161 c.WriteLine (line);
Note:
See TracChangeset
for help on using the changeset viewer.