LogCommandParser.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 LogCommandParser : CommandParserInterface {
  12. private HandleRef swigCPtr;
  13. internal LogCommandParser(IntPtr cPtr, bool cMemoryOwn) : base(RakNetPINVOKE.LogCommandParser_SWIGUpcast(cPtr), cMemoryOwn) {
  14. swigCPtr = new HandleRef(this, cPtr);
  15. }
  16. internal static HandleRef getCPtr(LogCommandParser obj) {
  17. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  18. }
  19. ~LogCommandParser() {
  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_LogCommandParser(swigCPtr);
  28. }
  29. swigCPtr = new HandleRef(null, IntPtr.Zero);
  30. }
  31. GC.SuppressFinalize(this);
  32. base.Dispose();
  33. }
  34. }
  35. public static LogCommandParser GetInstance() {
  36. IntPtr cPtr = RakNetPINVOKE.LogCommandParser_GetInstance();
  37. LogCommandParser ret = (cPtr == IntPtr.Zero) ? null : new LogCommandParser(cPtr, false);
  38. return ret;
  39. }
  40. public static void DestroyInstance(LogCommandParser i) {
  41. RakNetPINVOKE.LogCommandParser_DestroyInstance(LogCommandParser.getCPtr(i));
  42. }
  43. public LogCommandParser() : this(RakNetPINVOKE.new_LogCommandParser(), true) {
  44. }
  45. public override bool OnCommand(string command, uint numParameters, string[] parameterList, TransportInterface transport, SystemAddress systemAddress, string originalString) {
  46. bool ret = RakNetPINVOKE.LogCommandParser_OnCommand(swigCPtr, command, numParameters, parameterList, TransportInterface.getCPtr(transport), SystemAddress.getCPtr(systemAddress), originalString);
  47. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  48. return ret;
  49. }
  50. public override string GetName() {
  51. string ret = RakNetPINVOKE.LogCommandParser_GetName(swigCPtr);
  52. return ret;
  53. }
  54. public override void SendHelp(TransportInterface transport, SystemAddress systemAddress) {
  55. RakNetPINVOKE.LogCommandParser_SendHelp(swigCPtr, TransportInterface.getCPtr(transport), SystemAddress.getCPtr(systemAddress));
  56. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  57. }
  58. public void AddChannel(string channelName) {
  59. RakNetPINVOKE.LogCommandParser_AddChannel(swigCPtr, channelName);
  60. }
  61. public void WriteLog(string channelName, string format) {
  62. RakNetPINVOKE.LogCommandParser_WriteLog(swigCPtr, channelName, format);
  63. }
  64. public override void OnNewIncomingConnection(SystemAddress systemAddress, TransportInterface transport) {
  65. RakNetPINVOKE.LogCommandParser_OnNewIncomingConnection(swigCPtr, SystemAddress.getCPtr(systemAddress), TransportInterface.getCPtr(transport));
  66. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  67. }
  68. public override void OnConnectionLost(SystemAddress systemAddress, TransportInterface transport) {
  69. RakNetPINVOKE.LogCommandParser_OnConnectionLost(swigCPtr, SystemAddress.getCPtr(systemAddress), TransportInterface.getCPtr(transport));
  70. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  71. }
  72. public override void OnTransportChange(TransportInterface transport) {
  73. RakNetPINVOKE.LogCommandParser_OnTransportChange(swigCPtr, TransportInterface.getCPtr(transport));
  74. }
  75. }
  76. }
粤ICP备19079148号