UDPProxyServer.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.1
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. namespace RakNet {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class UDPProxyServer : PluginInterface2 {
  12. private HandleRef swigCPtr;
  13. internal UDPProxyServer(IntPtr cPtr, bool cMemoryOwn) : base(RakNetPINVOKE.UDPProxyServer_SWIGUpcast(cPtr), cMemoryOwn) {
  14. swigCPtr = new HandleRef(this, cPtr);
  15. }
  16. internal static HandleRef getCPtr(UDPProxyServer obj) {
  17. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  18. }
  19. ~UDPProxyServer() {
  20. Dispose();
  21. }
  22. public override void Dispose() {
  23. lock(this) {
  24. if (swigCPtr.Handle != IntPtr.Zero) {
  25. if (swigCMemOwn) {
  26. swigCMemOwn = false;
  27. RakNetPINVOKE.delete_UDPProxyServer(swigCPtr);
  28. }
  29. swigCPtr = new HandleRef(null, IntPtr.Zero);
  30. }
  31. GC.SuppressFinalize(this);
  32. base.Dispose();
  33. }
  34. }
  35. public static UDPProxyServer GetInstance() {
  36. IntPtr cPtr = RakNetPINVOKE.UDPProxyServer_GetInstance();
  37. UDPProxyServer ret = (cPtr == IntPtr.Zero) ? null : new UDPProxyServer(cPtr, false);
  38. return ret;
  39. }
  40. public static void DestroyInstance(UDPProxyServer i) {
  41. RakNetPINVOKE.UDPProxyServer_DestroyInstance(UDPProxyServer.getCPtr(i));
  42. }
  43. public UDPProxyServer() : this(RakNetPINVOKE.new_UDPProxyServer(), true) {
  44. }
  45. public void SetSocketFamily(ushort _socketFamily) {
  46. RakNetPINVOKE.UDPProxyServer_SetSocketFamily(swigCPtr, _socketFamily);
  47. }
  48. public void SetResultHandler(UDPProxyServerResultHandler rh) {
  49. RakNetPINVOKE.UDPProxyServer_SetResultHandler(swigCPtr, UDPProxyServerResultHandler.getCPtr(rh));
  50. }
  51. public bool LoginToCoordinator(RakString password, SystemAddress coordinatorAddress) {
  52. bool ret = RakNetPINVOKE.UDPProxyServer_LoginToCoordinator(swigCPtr, RakString.getCPtr(password), SystemAddress.getCPtr(coordinatorAddress));
  53. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  54. return ret;
  55. }
  56. public UDPForwarder udpForwarder {
  57. set {
  58. RakNetPINVOKE.UDPProxyServer_udpForwarder_set(swigCPtr, UDPForwarder.getCPtr(value));
  59. }
  60. get {
  61. IntPtr cPtr = RakNetPINVOKE.UDPProxyServer_udpForwarder_get(swigCPtr);
  62. UDPForwarder ret = (cPtr == IntPtr.Zero) ? null : new UDPForwarder(cPtr, false);
  63. return ret;
  64. }
  65. }
  66. }
  67. }
粤ICP备19079148号