FileListTransfer.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 FileListTransfer : PluginInterface2 {
  12. private HandleRef swigCPtr;
  13. internal FileListTransfer(IntPtr cPtr, bool cMemoryOwn) : base(RakNetPINVOKE.FileListTransfer_SWIGUpcast(cPtr), cMemoryOwn) {
  14. swigCPtr = new HandleRef(this, cPtr);
  15. }
  16. internal static HandleRef getCPtr(FileListTransfer obj) {
  17. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  18. }
  19. ~FileListTransfer() {
  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_FileListTransfer(swigCPtr);
  28. }
  29. swigCPtr = new HandleRef(null, IntPtr.Zero);
  30. }
  31. GC.SuppressFinalize(this);
  32. base.Dispose();
  33. }
  34. }
  35. public static FileListTransfer GetInstance() {
  36. IntPtr cPtr = RakNetPINVOKE.FileListTransfer_GetInstance();
  37. FileListTransfer ret = (cPtr == IntPtr.Zero) ? null : new FileListTransfer(cPtr, false);
  38. return ret;
  39. }
  40. public static void DestroyInstance(FileListTransfer i) {
  41. RakNetPINVOKE.FileListTransfer_DestroyInstance(FileListTransfer.getCPtr(i));
  42. }
  43. public FileListTransfer() : this(RakNetPINVOKE.new_FileListTransfer(), true) {
  44. }
  45. public void StartIncrementalReadThreads(int numThreads, int threadPriority) {
  46. RakNetPINVOKE.FileListTransfer_StartIncrementalReadThreads__SWIG_0(swigCPtr, numThreads, threadPriority);
  47. }
  48. public void StartIncrementalReadThreads(int numThreads) {
  49. RakNetPINVOKE.FileListTransfer_StartIncrementalReadThreads__SWIG_1(swigCPtr, numThreads);
  50. }
  51. public ushort SetupReceive(FileListTransferCBInterface handler, bool deleteHandler, SystemAddress allowedSender) {
  52. ushort ret = RakNetPINVOKE.FileListTransfer_SetupReceive(swigCPtr, FileListTransferCBInterface.getCPtr(handler), deleteHandler, SystemAddress.getCPtr(allowedSender));
  53. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  54. return ret;
  55. }
  56. public void Send(FileList fileList, RakPeerInterface rakPeer, SystemAddress recipient, ushort setID, PacketPriority priority, char orderingChannel, IncrementalReadInterface _incrementalReadInterface, uint _chunkSize) {
  57. RakNetPINVOKE.FileListTransfer_Send__SWIG_0(swigCPtr, FileList.getCPtr(fileList), RakPeerInterface.getCPtr(rakPeer), SystemAddress.getCPtr(recipient), setID, (int)priority, orderingChannel, IncrementalReadInterface.getCPtr(_incrementalReadInterface), _chunkSize);
  58. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  59. }
  60. public void Send(FileList fileList, RakPeerInterface rakPeer, SystemAddress recipient, ushort setID, PacketPriority priority, char orderingChannel, IncrementalReadInterface _incrementalReadInterface) {
  61. RakNetPINVOKE.FileListTransfer_Send__SWIG_1(swigCPtr, FileList.getCPtr(fileList), RakPeerInterface.getCPtr(rakPeer), SystemAddress.getCPtr(recipient), setID, (int)priority, orderingChannel, IncrementalReadInterface.getCPtr(_incrementalReadInterface));
  62. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  63. }
  64. public void Send(FileList fileList, RakPeerInterface rakPeer, SystemAddress recipient, ushort setID, PacketPriority priority, char orderingChannel) {
  65. RakNetPINVOKE.FileListTransfer_Send__SWIG_2(swigCPtr, FileList.getCPtr(fileList), RakPeerInterface.getCPtr(rakPeer), SystemAddress.getCPtr(recipient), setID, (int)priority, orderingChannel);
  66. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  67. }
  68. public uint GetPendingFilesToAddress(SystemAddress recipient) {
  69. uint ret = RakNetPINVOKE.FileListTransfer_GetPendingFilesToAddress(swigCPtr, SystemAddress.getCPtr(recipient));
  70. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  71. return ret;
  72. }
  73. public void CancelReceive(ushort setId) {
  74. RakNetPINVOKE.FileListTransfer_CancelReceive(swigCPtr, setId);
  75. }
  76. public void RemoveReceiver(SystemAddress systemAddress) {
  77. RakNetPINVOKE.FileListTransfer_RemoveReceiver(swigCPtr, SystemAddress.getCPtr(systemAddress));
  78. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  79. }
  80. public bool IsHandlerActive(ushort setId) {
  81. bool ret = RakNetPINVOKE.FileListTransfer_IsHandlerActive(swigCPtr, setId);
  82. return ret;
  83. }
  84. public void AddCallback(FileListProgress cb) {
  85. RakNetPINVOKE.FileListTransfer_AddCallback(swigCPtr, FileListProgress.getCPtr(cb));
  86. }
  87. public void RemoveCallback(FileListProgress cb) {
  88. RakNetPINVOKE.FileListTransfer_RemoveCallback(swigCPtr, FileListProgress.getCPtr(cb));
  89. }
  90. public void ClearCallbacks() {
  91. RakNetPINVOKE.FileListTransfer_ClearCallbacks(swigCPtr);
  92. }
  93. }
  94. }
粤ICP备19079148号