ProxySession |
[This is preliminary documentation and is subject to change.]
Required introduction
1using BugProxy.Net; 2using Furcadia.Net.Options; 3using Furcadia.Net.Proxy; 4using System; 5 6namespace BugConsole 7{ 8internal class Program 9{ 10-#region Private Fields 11 12private static ProxySession proxy; 13private static ProxySessionOptions ProxyOptions; 14 15 #endregion Private Fields 16 17-#region Private Methods 18 19private static void Main(string[] args) 20 { 21while (true) 22 { 23 Console.WriteLine("type connect when ready"); 24string cmd = Console.ReadLine(); 25 26if (cmd.ToLower() == "connect") 27 { 28if (proxy is null) 29 { 30 ProxyOptions = new ProxySessionOptions(); 31 proxy = new ProxySession(ProxyOptions); 32 proxy.ClientData2 += onClientDataReceived; 33 proxy.ServerData2 += onServerDataReceived; 34// We need a Character.ini file to work with -Gerolkae 35 proxy.Connect(); 36 } 37else if (!proxy.IsServerConnected) 38 { 39 proxy.Connect(); 40 } 41 } 42 } 43 } 44 45static private void onClientDataReceived(string data) 46 { 47 Console.WriteLine("C>: " + data); 48 proxy.SendToServer(data); 49 } 50 51static private void onServerDataReceived(string data) 52 { 53 Console.WriteLine("S>: " + data); 54 proxy.SendToClient(data); 55 } 56 57 #endregion Private Methods 58} 59}