RakPeerInterface.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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 RakPeerInterface : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal RakPeerInterface(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(RakPeerInterface obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~RakPeerInterface() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. RakNetPINVOKE.delete_RakPeerInterface(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public virtual void GetIncomingPassword(ref string passwordData, ref int passwordDataLength )
  37. {
  38. passwordData=CSharpGetIncomingPasswordHelper(passwordData,ref passwordDataLength);
  39. }
  40. public virtual void GetOfflinePingResponse( byte[] inOutByteArray, out uint length )
  41. {
  42. CSharpGetOfflinePingResponseHelper(inOutByteArray,out length);
  43. }
  44. public virtual bool GetConnectionList(out SystemAddress[] remoteSystems, ref ushort numberOfSystems)
  45. {
  46. RakNetListSystemAddress passVal= new RakNetListSystemAddress();
  47. bool returnVal = GetConnectionList(passVal,ref numberOfSystems);
  48. SystemAddress[] outVal = new SystemAddress[numberOfSystems];
  49. for (int i=0; i<numberOfSystems;i++)
  50. {
  51. outVal[i]=passVal[i];
  52. }
  53. remoteSystems=outVal;
  54. return returnVal;
  55. }
  56. public static RakPeerInterface GetInstance() {
  57. IntPtr cPtr = RakNetPINVOKE.RakPeerInterface_GetInstance();
  58. RakPeerInterface ret = (cPtr == IntPtr.Zero) ? null : new RakPeerInterface(cPtr, false);
  59. return ret;
  60. }
  61. public static void DestroyInstance(RakPeerInterface i) {
  62. RakNetPINVOKE.RakPeerInterface_DestroyInstance(RakPeerInterface.getCPtr(i));
  63. }
  64. public virtual StartupResult Startup(ushort maxConnections, SocketDescriptor socketDescriptors, uint socketDescriptorCount, int threadPriority) {
  65. StartupResult ret = (StartupResult)RakNetPINVOKE.RakPeerInterface_Startup__SWIG_0(swigCPtr, maxConnections, SocketDescriptor.getCPtr(socketDescriptors), socketDescriptorCount, threadPriority);
  66. return ret;
  67. }
  68. public virtual StartupResult Startup(ushort maxConnections, SocketDescriptor socketDescriptors, uint socketDescriptorCount) {
  69. StartupResult ret = (StartupResult)RakNetPINVOKE.RakPeerInterface_Startup__SWIG_1(swigCPtr, maxConnections, SocketDescriptor.getCPtr(socketDescriptors), socketDescriptorCount);
  70. return ret;
  71. }
  72. public virtual bool InitializeSecurity(string publicKey, string privateKey, bool bRequireClientKey) {
  73. bool ret = RakNetPINVOKE.RakPeerInterface_InitializeSecurity__SWIG_0(swigCPtr, publicKey, privateKey, bRequireClientKey);
  74. return ret;
  75. }
  76. public virtual bool InitializeSecurity(string publicKey, string privateKey) {
  77. bool ret = RakNetPINVOKE.RakPeerInterface_InitializeSecurity__SWIG_1(swigCPtr, publicKey, privateKey);
  78. return ret;
  79. }
  80. public virtual void DisableSecurity() {
  81. RakNetPINVOKE.RakPeerInterface_DisableSecurity(swigCPtr);
  82. }
  83. public virtual void AddToSecurityExceptionList(string ip) {
  84. RakNetPINVOKE.RakPeerInterface_AddToSecurityExceptionList(swigCPtr, ip);
  85. }
  86. public virtual void RemoveFromSecurityExceptionList(string ip) {
  87. RakNetPINVOKE.RakPeerInterface_RemoveFromSecurityExceptionList(swigCPtr, ip);
  88. }
  89. public virtual bool IsInSecurityExceptionList(string ip) {
  90. bool ret = RakNetPINVOKE.RakPeerInterface_IsInSecurityExceptionList(swigCPtr, ip);
  91. return ret;
  92. }
  93. public virtual void SetMaximumIncomingConnections(ushort numberAllowed) {
  94. RakNetPINVOKE.RakPeerInterface_SetMaximumIncomingConnections(swigCPtr, numberAllowed);
  95. }
  96. public virtual ushort GetMaximumIncomingConnections() {
  97. ushort ret = RakNetPINVOKE.RakPeerInterface_GetMaximumIncomingConnections(swigCPtr);
  98. return ret;
  99. }
  100. public virtual ushort NumberOfConnections() {
  101. ushort ret = RakNetPINVOKE.RakPeerInterface_NumberOfConnections(swigCPtr);
  102. return ret;
  103. }
  104. public virtual void SetIncomingPassword(string passwordData, int passwordDataLength) {
  105. RakNetPINVOKE.RakPeerInterface_SetIncomingPassword__SWIG_0(swigCPtr, passwordData, passwordDataLength);
  106. }
  107. public virtual ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey, uint connectionSocketIndex, uint sendConnectionAttemptCount, uint timeBetweenSendConnectionAttemptsMS, uint timeoutTime) {
  108. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeerInterface_Connect__SWIG_0(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey), connectionSocketIndex, sendConnectionAttemptCount, timeBetweenSendConnectionAttemptsMS, timeoutTime);
  109. return ret;
  110. }
  111. public virtual ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey, uint connectionSocketIndex, uint sendConnectionAttemptCount, uint timeBetweenSendConnectionAttemptsMS) {
  112. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeerInterface_Connect__SWIG_1(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey), connectionSocketIndex, sendConnectionAttemptCount, timeBetweenSendConnectionAttemptsMS);
  113. return ret;
  114. }
  115. public virtual ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey, uint connectionSocketIndex, uint sendConnectionAttemptCount) {
  116. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeerInterface_Connect__SWIG_2(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey), connectionSocketIndex, sendConnectionAttemptCount);
  117. return ret;
  118. }
  119. public virtual ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey, uint connectionSocketIndex) {
  120. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeerInterface_Connect__SWIG_3(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey), connectionSocketIndex);
  121. return ret;
  122. }
  123. public virtual ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey) {
  124. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeerInterface_Connect__SWIG_4(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey));
  125. return ret;
  126. }
  127. public virtual ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength) {
  128. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeerInterface_Connect__SWIG_5(swigCPtr, host, remotePort, passwordData, passwordDataLength);
  129. return ret;
  130. }
  131. public virtual void Shutdown(uint blockDuration, byte orderingChannel, PacketPriority disconnectionNotificationPriority) {
  132. RakNetPINVOKE.RakPeerInterface_Shutdown__SWIG_0(swigCPtr, blockDuration, orderingChannel, (int)disconnectionNotificationPriority);
  133. }
  134. public virtual void Shutdown(uint blockDuration, byte orderingChannel) {
  135. RakNetPINVOKE.RakPeerInterface_Shutdown__SWIG_1(swigCPtr, blockDuration, orderingChannel);
  136. }
  137. public virtual void Shutdown(uint blockDuration) {
  138. RakNetPINVOKE.RakPeerInterface_Shutdown__SWIG_2(swigCPtr, blockDuration);
  139. }
  140. public virtual bool IsActive() {
  141. bool ret = RakNetPINVOKE.RakPeerInterface_IsActive(swigCPtr);
  142. return ret;
  143. }
  144. public virtual uint GetNextSendReceipt() {
  145. uint ret = RakNetPINVOKE.RakPeerInterface_GetNextSendReceipt(swigCPtr);
  146. return ret;
  147. }
  148. public virtual uint IncrementNextSendReceipt() {
  149. uint ret = RakNetPINVOKE.RakPeerInterface_IncrementNextSendReceipt(swigCPtr);
  150. return ret;
  151. }
  152. public virtual uint Send(string data, int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast, uint forceReceiptNumber) {
  153. uint ret = RakNetPINVOKE.RakPeerInterface_Send__SWIG_0(swigCPtr, data, length, (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast, forceReceiptNumber);
  154. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  155. return ret;
  156. }
  157. public virtual uint Send(string data, int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast) {
  158. uint ret = RakNetPINVOKE.RakPeerInterface_Send__SWIG_1(swigCPtr, data, length, (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast);
  159. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  160. return ret;
  161. }
  162. public virtual void SendLoopback(string data, int length) {
  163. RakNetPINVOKE.RakPeerInterface_SendLoopback__SWIG_0(swigCPtr, data, length);
  164. }
  165. public virtual uint Send(BitStream bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast, uint forceReceiptNumber) {
  166. uint ret = RakNetPINVOKE.RakPeerInterface_Send__SWIG_2(swigCPtr, BitStream.getCPtr(bitStream), (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast, forceReceiptNumber);
  167. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  168. return ret;
  169. }
  170. public virtual uint Send(BitStream bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast) {
  171. uint ret = RakNetPINVOKE.RakPeerInterface_Send__SWIG_3(swigCPtr, BitStream.getCPtr(bitStream), (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast);
  172. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  173. return ret;
  174. }
  175. public virtual Packet Receive() {
  176. IntPtr cPtr = RakNetPINVOKE.RakPeerInterface_Receive(swigCPtr);
  177. Packet ret = (cPtr == IntPtr.Zero) ? null : new Packet(cPtr, false);
  178. return ret;
  179. }
  180. public virtual void DeallocatePacket(Packet packet) {
  181. RakNetPINVOKE.RakPeerInterface_DeallocatePacket(swigCPtr, Packet.getCPtr(packet));
  182. }
  183. public virtual ushort GetMaximumNumberOfPeers() {
  184. ushort ret = RakNetPINVOKE.RakPeerInterface_GetMaximumNumberOfPeers(swigCPtr);
  185. return ret;
  186. }
  187. public virtual void CloseConnection(AddressOrGUID target, bool sendDisconnectionNotification, byte orderingChannel, PacketPriority disconnectionNotificationPriority) {
  188. RakNetPINVOKE.RakPeerInterface_CloseConnection__SWIG_0(swigCPtr, AddressOrGUID.getCPtr(target), sendDisconnectionNotification, orderingChannel, (int)disconnectionNotificationPriority);
  189. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  190. }
  191. public virtual void CloseConnection(AddressOrGUID target, bool sendDisconnectionNotification, byte orderingChannel) {
  192. RakNetPINVOKE.RakPeerInterface_CloseConnection__SWIG_1(swigCPtr, AddressOrGUID.getCPtr(target), sendDisconnectionNotification, orderingChannel);
  193. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  194. }
  195. public virtual void CloseConnection(AddressOrGUID target, bool sendDisconnectionNotification) {
  196. RakNetPINVOKE.RakPeerInterface_CloseConnection__SWIG_2(swigCPtr, AddressOrGUID.getCPtr(target), sendDisconnectionNotification);
  197. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  198. }
  199. public virtual ConnectionState GetConnectionState(AddressOrGUID systemIdentifier) {
  200. ConnectionState ret = (ConnectionState)RakNetPINVOKE.RakPeerInterface_GetConnectionState(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
  201. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  202. return ret;
  203. }
  204. public virtual void CancelConnectionAttempt(SystemAddress target) {
  205. RakNetPINVOKE.RakPeerInterface_CancelConnectionAttempt(swigCPtr, SystemAddress.getCPtr(target));
  206. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  207. }
  208. public virtual int GetIndexFromSystemAddress(SystemAddress systemAddress) {
  209. int ret = RakNetPINVOKE.RakPeerInterface_GetIndexFromSystemAddress(swigCPtr, SystemAddress.getCPtr(systemAddress));
  210. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  211. return ret;
  212. }
  213. public virtual SystemAddress GetSystemAddressFromIndex(int index) {
  214. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeerInterface_GetSystemAddressFromIndex(swigCPtr, index), true);
  215. return ret;
  216. }
  217. public virtual RakNetGUID GetGUIDFromIndex(int index) {
  218. RakNetGUID ret = new RakNetGUID(RakNetPINVOKE.RakPeerInterface_GetGUIDFromIndex(swigCPtr, index), true);
  219. return ret;
  220. }
  221. public virtual void GetSystemList(RakNetListSystemAddress addresses, RakNetListRakNetGUID guids) {
  222. RakNetPINVOKE.RakPeerInterface_GetSystemList(swigCPtr, RakNetListSystemAddress.getCPtr(addresses), RakNetListRakNetGUID.getCPtr(guids));
  223. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  224. }
  225. public virtual void AddToBanList(string IP, uint milliseconds) {
  226. RakNetPINVOKE.RakPeerInterface_AddToBanList__SWIG_0(swigCPtr, IP, milliseconds);
  227. }
  228. public virtual void AddToBanList(string IP) {
  229. RakNetPINVOKE.RakPeerInterface_AddToBanList__SWIG_1(swigCPtr, IP);
  230. }
  231. public virtual void RemoveFromBanList(string IP) {
  232. RakNetPINVOKE.RakPeerInterface_RemoveFromBanList(swigCPtr, IP);
  233. }
  234. public virtual void ClearBanList() {
  235. RakNetPINVOKE.RakPeerInterface_ClearBanList(swigCPtr);
  236. }
  237. public virtual bool IsBanned(string IP) {
  238. bool ret = RakNetPINVOKE.RakPeerInterface_IsBanned(swigCPtr, IP);
  239. return ret;
  240. }
  241. public virtual void SetLimitIPConnectionFrequency(bool b) {
  242. RakNetPINVOKE.RakPeerInterface_SetLimitIPConnectionFrequency(swigCPtr, b);
  243. }
  244. public virtual void Ping(SystemAddress target) {
  245. RakNetPINVOKE.RakPeerInterface_Ping__SWIG_0(swigCPtr, SystemAddress.getCPtr(target));
  246. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  247. }
  248. public virtual bool Ping(string host, ushort remotePort, bool onlyReplyOnAcceptingConnections, uint connectionSocketIndex) {
  249. bool ret = RakNetPINVOKE.RakPeerInterface_Ping__SWIG_1(swigCPtr, host, remotePort, onlyReplyOnAcceptingConnections, connectionSocketIndex);
  250. return ret;
  251. }
  252. public virtual bool Ping(string host, ushort remotePort, bool onlyReplyOnAcceptingConnections) {
  253. bool ret = RakNetPINVOKE.RakPeerInterface_Ping__SWIG_2(swigCPtr, host, remotePort, onlyReplyOnAcceptingConnections);
  254. return ret;
  255. }
  256. public virtual int GetAveragePing(AddressOrGUID systemIdentifier) {
  257. int ret = RakNetPINVOKE.RakPeerInterface_GetAveragePing(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
  258. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  259. return ret;
  260. }
  261. public virtual int GetLastPing(AddressOrGUID systemIdentifier) {
  262. int ret = RakNetPINVOKE.RakPeerInterface_GetLastPing(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
  263. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  264. return ret;
  265. }
  266. public virtual int GetLowestPing(AddressOrGUID systemIdentifier) {
  267. int ret = RakNetPINVOKE.RakPeerInterface_GetLowestPing(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
  268. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  269. return ret;
  270. }
  271. public virtual void SetOccasionalPing(bool doPing) {
  272. RakNetPINVOKE.RakPeerInterface_SetOccasionalPing(swigCPtr, doPing);
  273. }
  274. public virtual void SetOfflinePingResponse(string data, uint length) {
  275. RakNetPINVOKE.RakPeerInterface_SetOfflinePingResponse__SWIG_0(swigCPtr, data, length);
  276. }
  277. public virtual SystemAddress GetInternalID(SystemAddress systemAddress, int index) {
  278. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeerInterface_GetInternalID__SWIG_0(swigCPtr, SystemAddress.getCPtr(systemAddress), index), true);
  279. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  280. return ret;
  281. }
  282. public virtual SystemAddress GetInternalID(SystemAddress systemAddress) {
  283. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeerInterface_GetInternalID__SWIG_1(swigCPtr, SystemAddress.getCPtr(systemAddress)), true);
  284. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  285. return ret;
  286. }
  287. public virtual SystemAddress GetInternalID() {
  288. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeerInterface_GetInternalID__SWIG_2(swigCPtr), true);
  289. return ret;
  290. }
  291. public virtual SystemAddress GetExternalID(SystemAddress target) {
  292. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeerInterface_GetExternalID(swigCPtr, SystemAddress.getCPtr(target)), true);
  293. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  294. return ret;
  295. }
  296. public virtual RakNetGUID GetMyGUID() {
  297. RakNetGUID ret = new RakNetGUID(RakNetPINVOKE.RakPeerInterface_GetMyGUID(swigCPtr), true);
  298. return ret;
  299. }
  300. public virtual SystemAddress GetMyBoundAddress(int socketIndex) {
  301. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeerInterface_GetMyBoundAddress__SWIG_0(swigCPtr, socketIndex), true);
  302. return ret;
  303. }
  304. public virtual SystemAddress GetMyBoundAddress() {
  305. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeerInterface_GetMyBoundAddress__SWIG_1(swigCPtr), true);
  306. return ret;
  307. }
  308. public static ulong Get64BitUniqueRandomNumber() {
  309. ulong ret = RakNetPINVOKE.RakPeerInterface_Get64BitUniqueRandomNumber();
  310. return ret;
  311. }
  312. public virtual RakNetGUID GetGuidFromSystemAddress(SystemAddress input) {
  313. RakNetGUID ret = new RakNetGUID(RakNetPINVOKE.RakPeerInterface_GetGuidFromSystemAddress(swigCPtr, SystemAddress.getCPtr(input)), false);
  314. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  315. return ret;
  316. }
  317. public virtual SystemAddress GetSystemAddressFromGuid(RakNetGUID input) {
  318. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeerInterface_GetSystemAddressFromGuid(swigCPtr, RakNetGUID.getCPtr(input)), true);
  319. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  320. return ret;
  321. }
  322. public virtual bool GetClientPublicKeyFromSystemAddress(SystemAddress input, string client_public_key) {
  323. bool ret = RakNetPINVOKE.RakPeerInterface_GetClientPublicKeyFromSystemAddress(swigCPtr, SystemAddress.getCPtr(input), client_public_key);
  324. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  325. return ret;
  326. }
  327. public virtual void SetTimeoutTime(uint timeMS, SystemAddress target) {
  328. RakNetPINVOKE.RakPeerInterface_SetTimeoutTime(swigCPtr, timeMS, SystemAddress.getCPtr(target));
  329. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  330. }
  331. public virtual uint GetTimeoutTime(SystemAddress target) {
  332. uint ret = RakNetPINVOKE.RakPeerInterface_GetTimeoutTime(swigCPtr, SystemAddress.getCPtr(target));
  333. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  334. return ret;
  335. }
  336. public virtual int GetMTUSize(SystemAddress target) {
  337. int ret = RakNetPINVOKE.RakPeerInterface_GetMTUSize(swigCPtr, SystemAddress.getCPtr(target));
  338. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  339. return ret;
  340. }
  341. public virtual uint GetNumberOfAddresses() {
  342. uint ret = RakNetPINVOKE.RakPeerInterface_GetNumberOfAddresses(swigCPtr);
  343. return ret;
  344. }
  345. public virtual string GetLocalIP(uint index) {
  346. string ret = RakNetPINVOKE.RakPeerInterface_GetLocalIP(swigCPtr, index);
  347. return ret;
  348. }
  349. public virtual bool IsLocalIP(string ip) {
  350. bool ret = RakNetPINVOKE.RakPeerInterface_IsLocalIP(swigCPtr, ip);
  351. return ret;
  352. }
  353. public virtual void AllowConnectionResponseIPMigration(bool allow) {
  354. RakNetPINVOKE.RakPeerInterface_AllowConnectionResponseIPMigration(swigCPtr, allow);
  355. }
  356. public virtual bool AdvertiseSystem(string host, ushort remotePort, string data, int dataLength, uint connectionSocketIndex) {
  357. bool ret = RakNetPINVOKE.RakPeerInterface_AdvertiseSystem__SWIG_0(swigCPtr, host, remotePort, data, dataLength, connectionSocketIndex);
  358. return ret;
  359. }
  360. public virtual bool AdvertiseSystem(string host, ushort remotePort, string data, int dataLength) {
  361. bool ret = RakNetPINVOKE.RakPeerInterface_AdvertiseSystem__SWIG_1(swigCPtr, host, remotePort, data, dataLength);
  362. return ret;
  363. }
  364. public virtual void SetSplitMessageProgressInterval(int interval) {
  365. RakNetPINVOKE.RakPeerInterface_SetSplitMessageProgressInterval(swigCPtr, interval);
  366. }
  367. public virtual int GetSplitMessageProgressInterval() {
  368. int ret = RakNetPINVOKE.RakPeerInterface_GetSplitMessageProgressInterval(swigCPtr);
  369. return ret;
  370. }
  371. public virtual void SetUnreliableTimeout(uint timeoutMS) {
  372. RakNetPINVOKE.RakPeerInterface_SetUnreliableTimeout(swigCPtr, timeoutMS);
  373. }
  374. public virtual void SendTTL(string host, ushort remotePort, int ttl, uint connectionSocketIndex) {
  375. RakNetPINVOKE.RakPeerInterface_SendTTL__SWIG_0(swigCPtr, host, remotePort, ttl, connectionSocketIndex);
  376. }
  377. public virtual void SendTTL(string host, ushort remotePort, int ttl) {
  378. RakNetPINVOKE.RakPeerInterface_SendTTL__SWIG_1(swigCPtr, host, remotePort, ttl);
  379. }
  380. public virtual void AttachPlugin(PluginInterface2 plugin) {
  381. RakNetPINVOKE.RakPeerInterface_AttachPlugin(swigCPtr, PluginInterface2.getCPtr(plugin));
  382. }
  383. public virtual void DetachPlugin(PluginInterface2 messageHandler) {
  384. RakNetPINVOKE.RakPeerInterface_DetachPlugin(swigCPtr, PluginInterface2.getCPtr(messageHandler));
  385. }
  386. public virtual void PushBackPacket(Packet packet, bool pushAtHead) {
  387. RakNetPINVOKE.RakPeerInterface_PushBackPacket(swigCPtr, Packet.getCPtr(packet), pushAtHead);
  388. }
  389. public virtual void ChangeSystemAddress(RakNetGUID guid, SystemAddress systemAddress) {
  390. RakNetPINVOKE.RakPeerInterface_ChangeSystemAddress(swigCPtr, RakNetGUID.getCPtr(guid), SystemAddress.getCPtr(systemAddress));
  391. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  392. }
  393. public virtual Packet AllocatePacket(uint dataSize) {
  394. IntPtr cPtr = RakNetPINVOKE.RakPeerInterface_AllocatePacket(swigCPtr, dataSize);
  395. Packet ret = (cPtr == IntPtr.Zero) ? null : new Packet(cPtr, false);
  396. return ret;
  397. }
  398. public virtual void WriteOutOfBandHeader(BitStream bitStream) {
  399. RakNetPINVOKE.RakPeerInterface_WriteOutOfBandHeader(swigCPtr, BitStream.getCPtr(bitStream));
  400. }
  401. public virtual void ApplyNetworkSimulator(float packetloss, ushort minExtraPing, ushort extraPingVariance) {
  402. RakNetPINVOKE.RakPeerInterface_ApplyNetworkSimulator(swigCPtr, packetloss, minExtraPing, extraPingVariance);
  403. }
  404. public virtual void SetPerConnectionOutgoingBandwidthLimit(uint maxBitsPerSecond) {
  405. RakNetPINVOKE.RakPeerInterface_SetPerConnectionOutgoingBandwidthLimit(swigCPtr, maxBitsPerSecond);
  406. }
  407. public virtual bool IsNetworkSimulatorActive() {
  408. bool ret = RakNetPINVOKE.RakPeerInterface_IsNetworkSimulatorActive(swigCPtr);
  409. return ret;
  410. }
  411. public virtual RakNetStatistics GetStatistics(SystemAddress systemAddress, RakNetStatistics rns) {
  412. IntPtr cPtr = RakNetPINVOKE.RakPeerInterface_GetStatistics__SWIG_0(swigCPtr, SystemAddress.getCPtr(systemAddress), RakNetStatistics.getCPtr(rns));
  413. RakNetStatistics ret = (cPtr == IntPtr.Zero) ? null : new RakNetStatistics(cPtr, false);
  414. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  415. return ret;
  416. }
  417. public virtual RakNetStatistics GetStatistics(SystemAddress systemAddress) {
  418. IntPtr cPtr = RakNetPINVOKE.RakPeerInterface_GetStatistics__SWIG_1(swigCPtr, SystemAddress.getCPtr(systemAddress));
  419. RakNetStatistics ret = (cPtr == IntPtr.Zero) ? null : new RakNetStatistics(cPtr, false);
  420. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  421. return ret;
  422. }
  423. public virtual bool GetStatistics(int index, RakNetStatistics rns) {
  424. bool ret = RakNetPINVOKE.RakPeerInterface_GetStatistics__SWIG_2(swigCPtr, index, RakNetStatistics.getCPtr(rns));
  425. return ret;
  426. }
  427. public virtual uint GetReceiveBufferSize() {
  428. uint ret = RakNetPINVOKE.RakPeerInterface_GetReceiveBufferSize(swigCPtr);
  429. return ret;
  430. }
  431. public virtual bool SendOutOfBand(string host, ushort remotePort, string data, uint dataLength, uint connectionSocketIndex) {
  432. bool ret = RakNetPINVOKE.RakPeerInterface_SendOutOfBand__SWIG_0(swigCPtr, host, remotePort, data, dataLength, connectionSocketIndex);
  433. return ret;
  434. }
  435. public virtual bool SendOutOfBand(string host, ushort remotePort, string data, uint dataLength) {
  436. bool ret = RakNetPINVOKE.RakPeerInterface_SendOutOfBand__SWIG_1(swigCPtr, host, remotePort, data, dataLength);
  437. return ret;
  438. }
  439. public uint Send(byte[] inByteArray, int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast) {
  440. uint ret = RakNetPINVOKE.RakPeerInterface_Send__SWIG_4(swigCPtr, inByteArray, length, (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast);
  441. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  442. return ret;
  443. }
  444. public void SendLoopback(byte[] inByteArray, int length) {
  445. RakNetPINVOKE.RakPeerInterface_SendLoopback__SWIG_1(swigCPtr, inByteArray, length);
  446. }
  447. public void SetOfflinePingResponse(byte[] inByteArray, uint length) {
  448. RakNetPINVOKE.RakPeerInterface_SetOfflinePingResponse__SWIG_1(swigCPtr, inByteArray, length);
  449. }
  450. public bool AdvertiseSystem(string host, ushort remotePort, byte[] inByteArray, int dataLength, uint connectionSocketIndex) {
  451. bool ret = RakNetPINVOKE.RakPeerInterface_AdvertiseSystem__SWIG_2(swigCPtr, host, remotePort, inByteArray, dataLength, connectionSocketIndex);
  452. return ret;
  453. }
  454. public bool AdvertiseSystem(string host, ushort remotePort, byte[] inByteArray, int dataLength) {
  455. bool ret = RakNetPINVOKE.RakPeerInterface_AdvertiseSystem__SWIG_3(swigCPtr, host, remotePort, inByteArray, dataLength);
  456. return ret;
  457. }
  458. private string CSharpGetIncomingPasswordHelper(string passwordData, ref int passwordDataLength) {
  459. string ret = RakNetPINVOKE.RakPeerInterface_CSharpGetIncomingPasswordHelper(swigCPtr, passwordData, ref passwordDataLength);
  460. return ret;
  461. }
  462. public void SetIncomingPassword(byte[] passwordDataByteArray, int passwordDataLength) {
  463. RakNetPINVOKE.RakPeerInterface_SetIncomingPassword__SWIG_1(swigCPtr, passwordDataByteArray, passwordDataLength);
  464. }
  465. public void GetIncomingPassword(byte[] passwordDataByteArray, ref int passwordDataLength) {
  466. RakNetPINVOKE.RakPeerInterface_GetIncomingPassword(swigCPtr, passwordDataByteArray, ref passwordDataLength);
  467. }
  468. private void CSharpGetOfflinePingResponseHelper(byte[] inOutByteArray, out uint outLength) {
  469. RakNetPINVOKE.RakPeerInterface_CSharpGetOfflinePingResponseHelper(swigCPtr, inOutByteArray, out outLength);
  470. }
  471. public bool GetConnectionList(RakNetListSystemAddress remoteSystems, ref ushort numberOfSystems) {
  472. bool ret = RakNetPINVOKE.RakPeerInterface_GetConnectionList(swigCPtr, RakNetListSystemAddress.getCPtr(remoteSystems), ref numberOfSystems);
  473. return ret;
  474. }
  475. }
  476. }
粤ICP备19079148号