public static FT_ConnectProcess GetInstance()
        {
            IntPtr            cPtr = RakNetPINVOKE.FT_ConnectProcess_GetInstance();
            FT_ConnectProcess ret  = (cPtr == IntPtr.Zero) ? null : new FT_ConnectProcess(cPtr, false);

            return(ret);
        }
Exemple #2
0
        public void Start()
        {
            InitPeer();

            if (_State == RakNetClientState.PeerInitOK)
            {
                StartupResult result = _peer.Startup(1, _socketDesc, 1);
                Log.Debug("Start Result: " + result);
                if (result == StartupResult.RAKNET_STARTED)
                {
                    _State = RakNetClientState.StartUpOK;

                    RakNet.FT_ConnectProcess process = new RakNet.FT_ConnectProcess();
                    process.SetResultHandler(new RakNetClientResultHandler(this));
                    AttachInterface2(process);

                    ConnectionAttemptResult connectResult = _peer.Connect(_sServerIP, _nServerPort, "", 0);
                    Log.Debug("Connect Result: " + connectResult);
                    if (ConnectionAttemptResult.CONNECTION_ATTEMPT_STARTED == connectResult)
                    {
                        _State = RakNetClientState.ConnectOK;

                        _systemAddress = new SystemAddress(_sServerIP, _nServerPort);

                        _ReadThread.Start();
                    }
                    else
                    {
                        _State = RakNetClientState.ConnectError;
                    }
                }
                else
                {
                    Log.Debug("RakNet.RakPeerInterface.GetInstance() Error : " + result);
                    _State = RakNetClientState.StartUpError;
                }
            }
        }
 public static void DestroyInstance(FT_ConnectProcess i) {
   RakNetPINVOKE.FT_ConnectProcess_DestroyInstance(FT_ConnectProcess.getCPtr(i));
 }
 internal static HandleRef getCPtr(FT_ConnectProcess obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
 public static void DestroyInstance(FT_ConnectProcess i)
 {
     RakNetPINVOKE.FT_ConnectProcess_DestroyInstance(FT_ConnectProcess.getCPtr(i));
 }
 internal static HandleRef getCPtr(FT_ConnectProcess obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }