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

Last change on this file since 189 was 182, checked in by alloc, 10 years ago

fixes

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