| Line | |
|---|
| 1 | using System;
|
|---|
| 2 | using System.Collections.Generic;
|
|---|
| 3 | using System.IO;
|
|---|
| 4 | using System.Net;
|
|---|
| 5 | using System.Net.Sockets;
|
|---|
| 6 | using System.Reflection;
|
|---|
| 7 | using System.Threading;
|
|---|
| 8 |
|
|---|
| 9 | namespace 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.