source: binary-improvements/7dtd-server-fixes/src/NetConnections/NetTelnetServer.cs@ 132

Last change on this file since 132 was 132, checked in by alloc, 11 years ago

Fixes: Source cleanups

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Net;
5using System.Net.Sockets;
6using System.Reflection;
7using System.Threading;
8
9namespace AllocsFixes.NetConnections
10{
11 public class NetTelnetServer
12 {
13 private static List<IServer> servers = new List<IServer>();
14
15 public static void init (int port)
16 {
17 try {
18 Log.Out ("[7dtd-server-fixes by Alloc] Version: " + Assembly.GetExecutingAssembly ().GetName ().Version);
19 servers.Add(new Servers.Telnet.Telnet(port));
20 } catch (Exception e) {
21 Log.Out ("Error in AllocsTelnetServer.init: " + e);
22 }
23 }
24
25 public static void SetConsole (ConsoleSdtd console)
26 {
27 }
28
29 public static void Disconnect ()
30 {
31 foreach (IServer s in servers)
32 s.Disconnect();
33 }
34
35 public static void WriteToClient (string line)
36 {
37 if (line == null) {
38 return;
39 }
40 foreach (IServer s in servers)
41 s.WriteToClient(line);
42 }
43
44 public static void WriteToClient_Single (string line, IConnection client)
45 {
46 if (line == null) {
47 return;
48 }
49 foreach (IServer s in servers)
50 s.WriteToClient_Single(line, client);
51 }
52 }
53}
Note: See TracBrowser for help on using the repository browser.