Furcadia Framework For Third Party Programs
NetProxy ctor |
[This is preliminary documentation and is subject to change.]
Starting a proxy is simple.
1 using BugProxy.Net; 2 using Furcadia.Net.Options; 3 using Furcadia.Net.Proxy; 4 using System; 5 6 namespace BugConsole 7 { 8 internal class Program 9 { 10+Private Fields10- #region Private Fields 11 12 private static ProxySession proxy; 13 private static ProxySessionOptions ProxyOptions; 14 15 #endregion Private Fields 16 17+Private Methods17- #region Private Methods 18 19 private static void Main(string[] args) 20 { 21 while (true) 22 { 23 Console.WriteLine("type connect when ready"); 24 string cmd = Console.ReadLine(); 25 26 if (cmd.ToLower() == "connect") 27 { 28 if (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 } 37 else if (!proxy.IsServerConnected) 38 { 39 proxy.Connect(); 40 } 41 } 42 } 43 } 44 45 static private void onClientDataReceived(string data) 46 { 47 Console.WriteLine("C>: " + data); 48 proxy.SendToServer(data); 49 } 50 51 static private void onServerDataReceived(string data) 52 { 53 Console.WriteLine("S>: " + data); 54 proxy.SendToClient(data); 55 } 56 57 #endregion Private Methods 58 } 59}
1Dim proxy As New NetProxy() 2 3proxy.ServerData += Sub(data As String) 4Console.WriteLine(Convert.ToString("SERVER: ") & data) 5Return data 6 7End Sub 8 9proxy.ClientExited += Sub() 10Console.WriteLine("Client exited.") 11proxy.Kill() 12 13End Sub 14proxy.[Error] += Sub(e As Exception) Console.WriteLine(e.Message) 15proxy.Connect()
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Optional section title
Add one or more sections with content