Router2.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 Router2 : PluginInterface2 {
  12. private HandleRef swigCPtr;
  13. internal Router2(IntPtr cPtr, bool cMemoryOwn) : base(RakNetPINVOKE.Router2_SWIGUpcast(cPtr), cMemoryOwn) {
  14. swigCPtr = new HandleRef(this, cPtr);
  15. }
  16. internal static HandleRef getCPtr(Router2 obj) {
  17. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  18. }
  19. ~Router2() {
  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_Router2(swigCPtr);
  28. }
  29. swigCPtr = new HandleRef(null, IntPtr.Zero);
  30. }
  31. GC.SuppressFinalize(this);
  32. base.Dispose();
  33. }
  34. }
  35. public static Router2 GetInstance() {
  36. IntPtr cPtr = RakNetPINVOKE.Router2_GetInstance();
  37. Router2 ret = (cPtr == IntPtr.Zero) ? null : new Router2(cPtr, false);
  38. return ret;
  39. }
  40. public static void DestroyInstance(Router2 i) {
  41. RakNetPINVOKE.Router2_DestroyInstance(Router2.getCPtr(i));
  42. }
  43. public Router2() : this(RakNetPINVOKE.new_Router2(), true) {
  44. }
  45. public void SetSocketFamily(ushort _socketFamily) {
  46. RakNetPINVOKE.Router2_SetSocketFamily(swigCPtr, _socketFamily);
  47. }
  48. public void EstablishRouting(RakNetGUID endpointGuid) {
  49. RakNetPINVOKE.Router2_EstablishRouting(swigCPtr, RakNetGUID.getCPtr(endpointGuid));
  50. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  51. }
  52. public void SetMaximumForwardingRequests(int max) {
  53. RakNetPINVOKE.Router2_SetMaximumForwardingRequests(swigCPtr, max);
  54. }
  55. public void SetDebugInterface(Router2DebugInterface _debugInterface) {
  56. RakNetPINVOKE.Router2_SetDebugInterface(swigCPtr, Router2DebugInterface.getCPtr(_debugInterface));
  57. }
  58. public Router2DebugInterface GetDebugInterface() {
  59. IntPtr cPtr = RakNetPINVOKE.Router2_GetDebugInterface(swigCPtr);
  60. Router2DebugInterface ret = (cPtr == IntPtr.Zero) ? null : new Router2DebugInterface(cPtr, false);
  61. return ret;
  62. }
  63. public uint GetConnectionRequestIndex(RakNetGUID endpointGuid) {
  64. uint ret = RakNetPINVOKE.Router2_GetConnectionRequestIndex(swigCPtr, RakNetGUID.getCPtr(endpointGuid));
  65. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  66. return ret;
  67. }
  68. public enum Router2RequestStates {
  69. R2RS_REQUEST_STATE_QUERY_FORWARDING,
  70. REQUEST_STATE_REQUEST_FORWARDING
  71. }
  72. }
  73. }
粤ICP备19079148号