| 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.Threading;
|
|---|
| 7 | using UnityEngine;
|
|---|
| 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 | } catch (Exception e) {
|
|---|
| 19 | Log.Out ("Error in NetTelnetServer.init: " + e);
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | public static void RegisterServer (IServer serv)
|
|---|
| 24 | {
|
|---|
| 25 | servers.Add (serv);
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | public static void SetConsole (ConsoleSdtd console)
|
|---|
| 29 | {
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | public static void Disconnect ()
|
|---|
| 33 | {
|
|---|
| 34 | Log.Out ("Disconnect console clients!");
|
|---|
| 35 | foreach (IServer s in servers)
|
|---|
| 36 | s.Disconnect ();
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | public static void WriteToClient (string line)
|
|---|
| 40 | {
|
|---|
| 41 | if (line == null) {
|
|---|
| 42 | return;
|
|---|
| 43 | }
|
|---|
| 44 | foreach (IServer s in servers)
|
|---|
| 45 | s.SendLine (line);
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | }
|
|---|
| 49 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.