RakPeer.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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 RakPeer : RakPeerInterface {
  12. private HandleRef swigCPtr;
  13. internal RakPeer(IntPtr cPtr, bool cMemoryOwn) : base(RakNetPINVOKE.RakPeer_SWIGUpcast(cPtr), cMemoryOwn) {
  14. swigCPtr = new HandleRef(this, cPtr);
  15. }
  16. internal static HandleRef getCPtr(RakPeer obj) {
  17. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  18. }
  19. ~RakPeer() {
  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_RakPeer(swigCPtr);
  28. }
  29. swigCPtr = new HandleRef(null, IntPtr.Zero);
  30. }
  31. GC.SuppressFinalize(this);
  32. base.Dispose();
  33. }
  34. }
  35. public override void GetIncomingPassword(ref string passwordData, ref int passwordDataLength )
  36. {
  37. passwordData=CSharpGetIncomingPasswordHelper(passwordData,ref passwordDataLength);
  38. }
  39. public override void GetOfflinePingResponse( byte[] inOutByteArray, out uint length )
  40. {
  41. CSharpGetOfflinePingResponseHelper(inOutByteArray,out length);
  42. }
  43. public override bool GetConnectionList(out SystemAddress[] remoteSystems, ref ushort numberOfSystems)
  44. {
  45. RakNetListSystemAddress passVal= new RakNetListSystemAddress();
  46. bool returnVal = GetConnectionList(passVal,ref numberOfSystems);
  47. SystemAddress[] outVal = new SystemAddress[numberOfSystems];
  48. for (int i=0; i<numberOfSystems;i++)
  49. {
  50. outVal[i]=passVal[i];
  51. }
  52. remoteSystems=outVal;
  53. return returnVal;
  54. }
  55. public RakPeer() : this(RakNetPINVOKE.new_RakPeer(), true) {
  56. }
  57. public override StartupResult Startup(ushort maxConnections, SocketDescriptor socketDescriptors, uint socketDescriptorCount, int threadPriority) {
  58. StartupResult ret = (StartupResult)RakNetPINVOKE.RakPeer_Startup__SWIG_0(swigCPtr, maxConnections, SocketDescriptor.getCPtr(socketDescriptors), socketDescriptorCount, threadPriority);
  59. return ret;
  60. }
  61. public override StartupResult Startup(ushort maxConnections, SocketDescriptor socketDescriptors, uint socketDescriptorCount) {
  62. StartupResult ret = (StartupResult)RakNetPINVOKE.RakPeer_Startup__SWIG_1(swigCPtr, maxConnections, SocketDescriptor.getCPtr(socketDescriptors), socketDescriptorCount);
  63. return ret;
  64. }
  65. public override bool InitializeSecurity(string publicKey, string privateKey, bool bRequireClientKey) {
  66. bool ret = RakNetPINVOKE.RakPeer_InitializeSecurity__SWIG_0(swigCPtr, publicKey, privateKey, bRequireClientKey);
  67. return ret;
  68. }
  69. public override bool InitializeSecurity(string publicKey, string privateKey) {
  70. bool ret = RakNetPINVOKE.RakPeer_InitializeSecurity__SWIG_1(swigCPtr, publicKey, privateKey);
  71. return ret;
  72. }
  73. public override void DisableSecurity() {
  74. RakNetPINVOKE.RakPeer_DisableSecurity(swigCPtr);
  75. }
  76. public override void AddToSecurityExceptionList(string ip) {
  77. RakNetPINVOKE.RakPeer_AddToSecurityExceptionList(swigCPtr, ip);
  78. }
  79. public override void RemoveFromSecurityExceptionList(string ip) {
  80. RakNetPINVOKE.RakPeer_RemoveFromSecurityExceptionList(swigCPtr, ip);
  81. }
  82. public override bool IsInSecurityExceptionList(string ip) {
  83. bool ret = RakNetPINVOKE.RakPeer_IsInSecurityExceptionList(swigCPtr, ip);
  84. return ret;
  85. }
  86. public override void SetMaximumIncomingConnections(ushort numberAllowed) {
  87. RakNetPINVOKE.RakPeer_SetMaximumIncomingConnections(swigCPtr, numberAllowed);
  88. }
  89. public override ushort GetMaximumIncomingConnections() {
  90. ushort ret = RakNetPINVOKE.RakPeer_GetMaximumIncomingConnections(swigCPtr);
  91. return ret;
  92. }
  93. public override ushort NumberOfConnections() {
  94. ushort ret = RakNetPINVOKE.RakPeer_NumberOfConnections(swigCPtr);
  95. return ret;
  96. }
  97. public override void SetIncomingPassword(string passwordData, int passwordDataLength) {
  98. RakNetPINVOKE.RakPeer_SetIncomingPassword__SWIG_0(swigCPtr, passwordData, passwordDataLength);
  99. }
  100. public override ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey, uint connectionSocketIndex, uint sendConnectionAttemptCount, uint timeBetweenSendConnectionAttemptsMS, uint timeoutTime) {
  101. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeer_Connect__SWIG_0(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey), connectionSocketIndex, sendConnectionAttemptCount, timeBetweenSendConnectionAttemptsMS, timeoutTime);
  102. return ret;
  103. }
  104. public override ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey, uint connectionSocketIndex, uint sendConnectionAttemptCount, uint timeBetweenSendConnectionAttemptsMS) {
  105. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeer_Connect__SWIG_1(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey), connectionSocketIndex, sendConnectionAttemptCount, timeBetweenSendConnectionAttemptsMS);
  106. return ret;
  107. }
  108. public override ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey, uint connectionSocketIndex, uint sendConnectionAttemptCount) {
  109. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeer_Connect__SWIG_2(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey), connectionSocketIndex, sendConnectionAttemptCount);
  110. return ret;
  111. }
  112. public override ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey, uint connectionSocketIndex) {
  113. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeer_Connect__SWIG_3(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey), connectionSocketIndex);
  114. return ret;
  115. }
  116. public override ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength, PublicKey publicKey) {
  117. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeer_Connect__SWIG_4(swigCPtr, host, remotePort, passwordData, passwordDataLength, PublicKey.getCPtr(publicKey));
  118. return ret;
  119. }
  120. public override ConnectionAttemptResult Connect(string host, ushort remotePort, string passwordData, int passwordDataLength) {
  121. ConnectionAttemptResult ret = (ConnectionAttemptResult)RakNetPINVOKE.RakPeer_Connect__SWIG_5(swigCPtr, host, remotePort, passwordData, passwordDataLength);
  122. return ret;
  123. }
  124. public override void Shutdown(uint blockDuration, byte orderingChannel, PacketPriority disconnectionNotificationPriority) {
  125. RakNetPINVOKE.RakPeer_Shutdown__SWIG_0(swigCPtr, blockDuration, orderingChannel, (int)disconnectionNotificationPriority);
  126. }
  127. public override void Shutdown(uint blockDuration, byte orderingChannel) {
  128. RakNetPINVOKE.RakPeer_Shutdown__SWIG_1(swigCPtr, blockDuration, orderingChannel);
  129. }
  130. public override void Shutdown(uint blockDuration) {
  131. RakNetPINVOKE.RakPeer_Shutdown__SWIG_2(swigCPtr, blockDuration);
  132. }
  133. public override bool IsActive() {
  134. bool ret = RakNetPINVOKE.RakPeer_IsActive(swigCPtr);
  135. return ret;
  136. }
  137. public override uint GetNextSendReceipt() {
  138. uint ret = RakNetPINVOKE.RakPeer_GetNextSendReceipt(swigCPtr);
  139. return ret;
  140. }
  141. public override uint IncrementNextSendReceipt() {
  142. uint ret = RakNetPINVOKE.RakPeer_IncrementNextSendReceipt(swigCPtr);
  143. return ret;
  144. }
  145. public override uint Send(string data, int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast, uint forceReceiptNumber) {
  146. uint ret = RakNetPINVOKE.RakPeer_Send__SWIG_0(swigCPtr, data, length, (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast, forceReceiptNumber);
  147. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  148. return ret;
  149. }
  150. public override uint Send(string data, int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast) {
  151. uint ret = RakNetPINVOKE.RakPeer_Send__SWIG_1(swigCPtr, data, length, (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast);
  152. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  153. return ret;
  154. }
  155. public override void SendLoopback(string data, int length) {
  156. RakNetPINVOKE.RakPeer_SendLoopback__SWIG_0(swigCPtr, data, length);
  157. }
  158. public override uint Send(BitStream bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast, uint forceReceiptNumber) {
  159. uint ret = RakNetPINVOKE.RakPeer_Send__SWIG_2(swigCPtr, BitStream.getCPtr(bitStream), (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast, forceReceiptNumber);
  160. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  161. return ret;
  162. }
  163. public override uint Send(BitStream bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast) {
  164. uint ret = RakNetPINVOKE.RakPeer_Send__SWIG_3(swigCPtr, BitStream.getCPtr(bitStream), (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast);
  165. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  166. return ret;
  167. }
  168. public override Packet Receive() {
  169. IntPtr cPtr = RakNetPINVOKE.RakPeer_Receive(swigCPtr);
  170. Packet ret = (cPtr == IntPtr.Zero) ? null : new Packet(cPtr, false);
  171. return ret;
  172. }
  173. public override void DeallocatePacket(Packet packet) {
  174. RakNetPINVOKE.RakPeer_DeallocatePacket(swigCPtr, Packet.getCPtr(packet));
  175. }
  176. public override ushort GetMaximumNumberOfPeers() {
  177. ushort ret = RakNetPINVOKE.RakPeer_GetMaximumNumberOfPeers(swigCPtr);
  178. return ret;
  179. }
  180. public override void CloseConnection(AddressOrGUID target, bool sendDisconnectionNotification, byte orderingChannel, PacketPriority disconnectionNotificationPriority) {
  181. RakNetPINVOKE.RakPeer_CloseConnection__SWIG_0(swigCPtr, AddressOrGUID.getCPtr(target), sendDisconnectionNotification, orderingChannel, (int)disconnectionNotificationPriority);
  182. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  183. }
  184. public override void CloseConnection(AddressOrGUID target, bool sendDisconnectionNotification, byte orderingChannel) {
  185. RakNetPINVOKE.RakPeer_CloseConnection__SWIG_1(swigCPtr, AddressOrGUID.getCPtr(target), sendDisconnectionNotification, orderingChannel);
  186. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  187. }
  188. public override void CloseConnection(AddressOrGUID target, bool sendDisconnectionNotification) {
  189. RakNetPINVOKE.RakPeer_CloseConnection__SWIG_2(swigCPtr, AddressOrGUID.getCPtr(target), sendDisconnectionNotification);
  190. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  191. }
  192. public override void CancelConnectionAttempt(SystemAddress target) {
  193. RakNetPINVOKE.RakPeer_CancelConnectionAttempt(swigCPtr, SystemAddress.getCPtr(target));
  194. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  195. }
  196. public override ConnectionState GetConnectionState(AddressOrGUID systemIdentifier) {
  197. ConnectionState ret = (ConnectionState)RakNetPINVOKE.RakPeer_GetConnectionState(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
  198. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  199. return ret;
  200. }
  201. public override int GetIndexFromSystemAddress(SystemAddress systemAddress) {
  202. int ret = RakNetPINVOKE.RakPeer_GetIndexFromSystemAddress(swigCPtr, SystemAddress.getCPtr(systemAddress));
  203. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  204. return ret;
  205. }
  206. public override SystemAddress GetSystemAddressFromIndex(int index) {
  207. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeer_GetSystemAddressFromIndex(swigCPtr, index), true);
  208. return ret;
  209. }
  210. public override RakNetGUID GetGUIDFromIndex(int index) {
  211. RakNetGUID ret = new RakNetGUID(RakNetPINVOKE.RakPeer_GetGUIDFromIndex(swigCPtr, index), true);
  212. return ret;
  213. }
  214. public override void GetSystemList(RakNetListSystemAddress addresses, RakNetListRakNetGUID guids) {
  215. RakNetPINVOKE.RakPeer_GetSystemList(swigCPtr, RakNetListSystemAddress.getCPtr(addresses), RakNetListRakNetGUID.getCPtr(guids));
  216. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  217. }
  218. public override void AddToBanList(string IP, uint milliseconds) {
  219. RakNetPINVOKE.RakPeer_AddToBanList__SWIG_0(swigCPtr, IP, milliseconds);
  220. }
  221. public override void AddToBanList(string IP) {
  222. RakNetPINVOKE.RakPeer_AddToBanList__SWIG_1(swigCPtr, IP);
  223. }
  224. public override void RemoveFromBanList(string IP) {
  225. RakNetPINVOKE.RakPeer_RemoveFromBanList(swigCPtr, IP);
  226. }
  227. public override void ClearBanList() {
  228. RakNetPINVOKE.RakPeer_ClearBanList(swigCPtr);
  229. }
  230. public override bool IsBanned(string IP) {
  231. bool ret = RakNetPINVOKE.RakPeer_IsBanned(swigCPtr, IP);
  232. return ret;
  233. }
  234. public override void SetLimitIPConnectionFrequency(bool b) {
  235. RakNetPINVOKE.RakPeer_SetLimitIPConnectionFrequency(swigCPtr, b);
  236. }
  237. public override void Ping(SystemAddress target) {
  238. RakNetPINVOKE.RakPeer_Ping__SWIG_0(swigCPtr, SystemAddress.getCPtr(target));
  239. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  240. }
  241. public override bool Ping(string host, ushort remotePort, bool onlyReplyOnAcceptingConnections, uint connectionSocketIndex) {
  242. bool ret = RakNetPINVOKE.RakPeer_Ping__SWIG_1(swigCPtr, host, remotePort, onlyReplyOnAcceptingConnections, connectionSocketIndex);
  243. return ret;
  244. }
  245. public override bool Ping(string host, ushort remotePort, bool onlyReplyOnAcceptingConnections) {
  246. bool ret = RakNetPINVOKE.RakPeer_Ping__SWIG_2(swigCPtr, host, remotePort, onlyReplyOnAcceptingConnections);
  247. return ret;
  248. }
  249. public override int GetAveragePing(AddressOrGUID systemIdentifier) {
  250. int ret = RakNetPINVOKE.RakPeer_GetAveragePing(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
  251. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  252. return ret;
  253. }
  254. public override int GetLastPing(AddressOrGUID systemIdentifier) {
  255. int ret = RakNetPINVOKE.RakPeer_GetLastPing(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
  256. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  257. return ret;
  258. }
  259. public override int GetLowestPing(AddressOrGUID systemIdentifier) {
  260. int ret = RakNetPINVOKE.RakPeer_GetLowestPing(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
  261. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  262. return ret;
  263. }
  264. public override void SetOccasionalPing(bool doPing) {
  265. RakNetPINVOKE.RakPeer_SetOccasionalPing(swigCPtr, doPing);
  266. }
  267. public override void SetOfflinePingResponse(string data, uint length) {
  268. RakNetPINVOKE.RakPeer_SetOfflinePingResponse__SWIG_0(swigCPtr, data, length);
  269. }
  270. public override SystemAddress GetInternalID(SystemAddress systemAddress, int index) {
  271. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeer_GetInternalID__SWIG_0(swigCPtr, SystemAddress.getCPtr(systemAddress), index), true);
  272. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  273. return ret;
  274. }
  275. public override SystemAddress GetInternalID(SystemAddress systemAddress) {
  276. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeer_GetInternalID__SWIG_1(swigCPtr, SystemAddress.getCPtr(systemAddress)), true);
  277. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  278. return ret;
  279. }
  280. public override SystemAddress GetInternalID() {
  281. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeer_GetInternalID__SWIG_2(swigCPtr), true);
  282. return ret;
  283. }
  284. public override SystemAddress GetExternalID(SystemAddress target) {
  285. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeer_GetExternalID(swigCPtr, SystemAddress.getCPtr(target)), true);
  286. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  287. return ret;
  288. }
  289. public override RakNetGUID GetMyGUID() {
  290. RakNetGUID ret = new RakNetGUID(RakNetPINVOKE.RakPeer_GetMyGUID(swigCPtr), true);
  291. return ret;
  292. }
  293. public override SystemAddress GetMyBoundAddress(int socketIndex) {
  294. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeer_GetMyBoundAddress__SWIG_0(swigCPtr, socketIndex), true);
  295. return ret;
  296. }
  297. public override SystemAddress GetMyBoundAddress() {
  298. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeer_GetMyBoundAddress__SWIG_1(swigCPtr), true);
  299. return ret;
  300. }
  301. public override RakNetGUID GetGuidFromSystemAddress(SystemAddress input) {
  302. RakNetGUID ret = new RakNetGUID(RakNetPINVOKE.RakPeer_GetGuidFromSystemAddress(swigCPtr, SystemAddress.getCPtr(input)), false);
  303. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  304. return ret;
  305. }
  306. public override SystemAddress GetSystemAddressFromGuid(RakNetGUID input) {
  307. SystemAddress ret = new SystemAddress(RakNetPINVOKE.RakPeer_GetSystemAddressFromGuid(swigCPtr, RakNetGUID.getCPtr(input)), true);
  308. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  309. return ret;
  310. }
  311. public override bool GetClientPublicKeyFromSystemAddress(SystemAddress input, string client_public_key) {
  312. bool ret = RakNetPINVOKE.RakPeer_GetClientPublicKeyFromSystemAddress(swigCPtr, SystemAddress.getCPtr(input), client_public_key);
  313. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  314. return ret;
  315. }
  316. public override void SetTimeoutTime(uint timeMS, SystemAddress target) {
  317. RakNetPINVOKE.RakPeer_SetTimeoutTime(swigCPtr, timeMS, SystemAddress.getCPtr(target));
  318. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  319. }
  320. public override uint GetTimeoutTime(SystemAddress target) {
  321. uint ret = RakNetPINVOKE.RakPeer_GetTimeoutTime(swigCPtr, SystemAddress.getCPtr(target));
  322. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  323. return ret;
  324. }
  325. public override int GetMTUSize(SystemAddress target) {
  326. int ret = RakNetPINVOKE.RakPeer_GetMTUSize(swigCPtr, SystemAddress.getCPtr(target));
  327. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  328. return ret;
  329. }
  330. public override uint GetNumberOfAddresses() {
  331. uint ret = RakNetPINVOKE.RakPeer_GetNumberOfAddresses(swigCPtr);
  332. return ret;
  333. }
  334. public override string GetLocalIP(uint index) {
  335. string ret = RakNetPINVOKE.RakPeer_GetLocalIP(swigCPtr, index);
  336. return ret;
  337. }
  338. public override bool IsLocalIP(string ip) {
  339. bool ret = RakNetPINVOKE.RakPeer_IsLocalIP(swigCPtr, ip);
  340. return ret;
  341. }
  342. public override void AllowConnectionResponseIPMigration(bool allow) {
  343. RakNetPINVOKE.RakPeer_AllowConnectionResponseIPMigration(swigCPtr, allow);
  344. }
  345. public override bool AdvertiseSystem(string host, ushort remotePort, string data, int dataLength, uint connectionSocketIndex) {
  346. bool ret = RakNetPINVOKE.RakPeer_AdvertiseSystem__SWIG_0(swigCPtr, host, remotePort, data, dataLength, connectionSocketIndex);
  347. return ret;
  348. }
  349. public override bool AdvertiseSystem(string host, ushort remotePort, string data, int dataLength) {
  350. bool ret = RakNetPINVOKE.RakPeer_AdvertiseSystem__SWIG_1(swigCPtr, host, remotePort, data, dataLength);
  351. return ret;
  352. }
  353. public override void SetSplitMessageProgressInterval(int interval) {
  354. RakNetPINVOKE.RakPeer_SetSplitMessageProgressInterval(swigCPtr, interval);
  355. }
  356. public override int GetSplitMessageProgressInterval() {
  357. int ret = RakNetPINVOKE.RakPeer_GetSplitMessageProgressInterval(swigCPtr);
  358. return ret;
  359. }
  360. public override void SetUnreliableTimeout(uint timeoutMS) {
  361. RakNetPINVOKE.RakPeer_SetUnreliableTimeout(swigCPtr, timeoutMS);
  362. }
  363. public override void SendTTL(string host, ushort remotePort, int ttl, uint connectionSocketIndex) {
  364. RakNetPINVOKE.RakPeer_SendTTL__SWIG_0(swigCPtr, host, remotePort, ttl, connectionSocketIndex);
  365. }
  366. public override void SendTTL(string host, ushort remotePort, int ttl) {
  367. RakNetPINVOKE.RakPeer_SendTTL__SWIG_1(swigCPtr, host, remotePort, ttl);
  368. }
  369. public override void AttachPlugin(PluginInterface2 plugin) {
  370. RakNetPINVOKE.RakPeer_AttachPlugin(swigCPtr, PluginInterface2.getCPtr(plugin));
  371. }
  372. public override void DetachPlugin(PluginInterface2 messageHandler) {
  373. RakNetPINVOKE.RakPeer_DetachPlugin(swigCPtr, PluginInterface2.getCPtr(messageHandler));
  374. }
  375. public override void PushBackPacket(Packet packet, bool pushAtHead) {
  376. RakNetPINVOKE.RakPeer_PushBackPacket(swigCPtr, Packet.getCPtr(packet), pushAtHead);
  377. }
  378. public override void ChangeSystemAddress(RakNetGUID guid, SystemAddress systemAddress) {
  379. RakNetPINVOKE.RakPeer_ChangeSystemAddress(swigCPtr, RakNetGUID.getCPtr(guid), SystemAddress.getCPtr(systemAddress));
  380. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  381. }
  382. public override Packet AllocatePacket(uint dataSize) {
  383. IntPtr cPtr = RakNetPINVOKE.RakPeer_AllocatePacket(swigCPtr, dataSize);
  384. Packet ret = (cPtr == IntPtr.Zero) ? null : new Packet(cPtr, false);
  385. return ret;
  386. }
  387. public override void WriteOutOfBandHeader(BitStream bitStream) {
  388. RakNetPINVOKE.RakPeer_WriteOutOfBandHeader(swigCPtr, BitStream.getCPtr(bitStream));
  389. }
  390. public override void ApplyNetworkSimulator(float packetloss, ushort minExtraPing, ushort extraPingVariance) {
  391. RakNetPINVOKE.RakPeer_ApplyNetworkSimulator(swigCPtr, packetloss, minExtraPing, extraPingVariance);
  392. }
  393. public override void SetPerConnectionOutgoingBandwidthLimit(uint maxBitsPerSecond) {
  394. RakNetPINVOKE.RakPeer_SetPerConnectionOutgoingBandwidthLimit(swigCPtr, maxBitsPerSecond);
  395. }
  396. public override bool IsNetworkSimulatorActive() {
  397. bool ret = RakNetPINVOKE.RakPeer_IsNetworkSimulatorActive(swigCPtr);
  398. return ret;
  399. }
  400. public override RakNetStatistics GetStatistics(SystemAddress systemAddress, RakNetStatistics rns) {
  401. IntPtr cPtr = RakNetPINVOKE.RakPeer_GetStatistics__SWIG_0(swigCPtr, SystemAddress.getCPtr(systemAddress), RakNetStatistics.getCPtr(rns));
  402. RakNetStatistics ret = (cPtr == IntPtr.Zero) ? null : new RakNetStatistics(cPtr, false);
  403. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  404. return ret;
  405. }
  406. public override RakNetStatistics GetStatistics(SystemAddress systemAddress) {
  407. IntPtr cPtr = RakNetPINVOKE.RakPeer_GetStatistics__SWIG_1(swigCPtr, SystemAddress.getCPtr(systemAddress));
  408. RakNetStatistics ret = (cPtr == IntPtr.Zero) ? null : new RakNetStatistics(cPtr, false);
  409. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  410. return ret;
  411. }
  412. public override bool GetStatistics(int index, RakNetStatistics rns) {
  413. bool ret = RakNetPINVOKE.RakPeer_GetStatistics__SWIG_2(swigCPtr, index, RakNetStatistics.getCPtr(rns));
  414. return ret;
  415. }
  416. public override uint GetReceiveBufferSize() {
  417. uint ret = RakNetPINVOKE.RakPeer_GetReceiveBufferSize(swigCPtr);
  418. return ret;
  419. }
  420. public override bool SendOutOfBand(string host, ushort remotePort, string data, uint dataLength, uint connectionSocketIndex) {
  421. bool ret = RakNetPINVOKE.RakPeer_SendOutOfBand__SWIG_0(swigCPtr, host, remotePort, data, dataLength, connectionSocketIndex);
  422. return ret;
  423. }
  424. public override bool SendOutOfBand(string host, ushort remotePort, string data, uint dataLength) {
  425. bool ret = RakNetPINVOKE.RakPeer_SendOutOfBand__SWIG_1(swigCPtr, host, remotePort, data, dataLength);
  426. return ret;
  427. }
  428. public new uint Send(byte[] inByteArray, int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast) {
  429. uint ret = RakNetPINVOKE.RakPeer_Send__SWIG_4(swigCPtr, inByteArray, length, (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast);
  430. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  431. return ret;
  432. }
  433. public new void SendLoopback(byte[] inByteArray, int length) {
  434. RakNetPINVOKE.RakPeer_SendLoopback__SWIG_1(swigCPtr, inByteArray, length);
  435. }
  436. public new void SetOfflinePingResponse(byte[] inByteArray, uint length) {
  437. RakNetPINVOKE.RakPeer_SetOfflinePingResponse__SWIG_1(swigCPtr, inByteArray, length);
  438. }
  439. public new bool AdvertiseSystem(string host, ushort remotePort, byte[] inByteArray, int dataLength, uint connectionSocketIndex) {
  440. bool ret = RakNetPINVOKE.RakPeer_AdvertiseSystem__SWIG_2(swigCPtr, host, remotePort, inByteArray, dataLength, connectionSocketIndex);
  441. return ret;
  442. }
  443. public new bool AdvertiseSystem(string host, ushort remotePort, byte[] inByteArray, int dataLength) {
  444. bool ret = RakNetPINVOKE.RakPeer_AdvertiseSystem__SWIG_3(swigCPtr, host, remotePort, inByteArray, dataLength);
  445. return ret;
  446. }
  447. private string CSharpGetIncomingPasswordHelper(string passwordData, ref int passwordDataLength) {
  448. string ret = RakNetPINVOKE.RakPeer_CSharpGetIncomingPasswordHelper(swigCPtr, passwordData, ref passwordDataLength);
  449. return ret;
  450. }
  451. public new void SetIncomingPassword(byte[] passwordDataByteArray, int passwordDataLength) {
  452. RakNetPINVOKE.RakPeer_SetIncomingPassword__SWIG_1(swigCPtr, passwordDataByteArray, passwordDataLength);
  453. }
  454. public new void GetIncomingPassword(byte[] passwordDataByteArray, ref int passwordDataLength) {
  455. RakNetPINVOKE.RakPeer_GetIncomingPassword(swigCPtr, passwordDataByteArray, ref passwordDataLength);
  456. }
  457. private void CSharpGetOfflinePingResponseHelper(byte[] inOutByteArray, out uint outLength) {
  458. RakNetPINVOKE.RakPeer_CSharpGetOfflinePingResponseHelper(swigCPtr, inOutByteArray, out outLength);
  459. }
  460. public new bool GetConnectionList(RakNetListSystemAddress remoteSystems, ref ushort numberOfSystems) {
  461. bool ret = RakNetPINVOKE.RakPeer_GetConnectionList(swigCPtr, RakNetListSystemAddress.getCPtr(remoteSystems), ref numberOfSystems);
  462. return ret;
  463. }
  464. }
  465. }
粤ICP备19079148号