コード例 #1
0
    bool StartupPeer(uint _uiNumSlots)
    {
        //m_cRnPeer = RakNet.RakPeerInterface.GetInstance();
        m_cRnPeer = new RakNet.RakPeer();


        RakNet.SocketDescriptor tSocketDesc    = new RakNet.SocketDescriptor((ushort)m_usPort, "");
        RakNet.StartupResult    eStartupResult = m_cRnPeer.Startup(_uiNumSlots, tSocketDesc, 1);
        bool bPeerStarted = false;


        if (eStartupResult != RakNet.StartupResult.RAKNET_STARTED)
        {
            Logger.WriteError("Raknet peer failed to start. ErrorCode({0})", eStartupResult);
        }
        else
        {
            m_cRnPeer.SetMaximumIncomingConnections((ushort)_uiNumSlots);
            m_cRnPeer.SetOccasionalPing(true);
            SendCounter  = 0;
            bPeerStarted = true;


            Logger.Write("Server started with port ({0}) NumSlots({1})", m_usPort, _uiNumSlots);
        }

        return(bPeerStarted);
    }
コード例 #2
0
    bool StartupPeer()
    {
        m_cRnPeer = new RakNet.RakPeer();
        m_usPort  = (ushort)UnityEngine.Random.Range(10000, 30000);


        RakNet.SocketDescriptor tSocketDesc    = new RakNet.SocketDescriptor((ushort)m_usPort, "");
        RakNet.StartupResult    eStartupResult = m_cRnPeer.Startup(1, tSocketDesc, 1);
        bool bPeerStarted = false;


        if (eStartupResult != RakNet.StartupResult.RAKNET_STARTED)
        {
            Logger.WriteError("Raknet peer failed to start. ErrorCode({0}) Port({1})", eStartupResult, m_usPort);
        }
        else
        {
            bPeerStarted = true;
            m_cRnPeer.SetOccasionalPing(true);

            Logger.Write("Raknet peer started. Port({0})", m_usPort);
        }


        return(bPeerStarted);
    }
コード例 #3
0
ファイル: CNetworkScanner.cs プロジェクト: dacuster/VOID
    // private:


    void StartupPeer()
    {
        m_cRnPeer = new RakNet.RakPeer();
        m_usPort  = (ushort)UnityEngine.Random.Range(10000, 30000);


        RakNet.SocketDescriptor tSocketDesc    = new RakNet.SocketDescriptor((ushort)m_usPort, "");
        RakNet.StartupResult    eStartupResult = m_cRnPeer.Startup(1, tSocketDesc, 1);


        if (eStartupResult != RakNet.StartupResult.RAKNET_STARTED)
        {
            Logger.WriteError("Master server peer failed to start. ErrorCode({0}) Port({1})", eStartupResult, m_usPort);
        }
    }
コード例 #4
0
ファイル: RakPeer.cs プロジェクト: MazingR/stormancer-sdk-cpp
 internal static HandleRef getCPtr(RakPeer obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
コード例 #5
0
ファイル: CNetworkConnection.cs プロジェクト: nulhax/VOID
    bool StartupPeer()
    {
        m_cRnPeer = new RakNet.RakPeer();
        m_usPort = (ushort)UnityEngine.Random.Range(10000, 30000);


        RakNet.SocketDescriptor tSocketDesc = new RakNet.SocketDescriptor((ushort)m_usPort, "");
        RakNet.StartupResult eStartupResult = m_cRnPeer.Startup(1, tSocketDesc, 1);
        bool bPeerStarted = false;


        if (eStartupResult != RakNet.StartupResult.RAKNET_STARTED)
        {
            Logger.WriteError("Raknet peer failed to start. ErrorCode({0}) Port({1})", eStartupResult, m_usPort);
        }
        else
        {
            bPeerStarted = true;
			m_cRnPeer.SetOccasionalPing(true);

            Logger.Write("Raknet peer started. Port({0})", m_usPort);
        }


        return (bPeerStarted);
    }
コード例 #6
0
ファイル: CNetworkScanner.cs プロジェクト: nulhax/VOID
    // private:


	void StartupPeer()
	{
		m_cRnPeer = new RakNet.RakPeer();
		m_usPort = (ushort)UnityEngine.Random.Range(10000, 30000);


		RakNet.SocketDescriptor tSocketDesc = new RakNet.SocketDescriptor((ushort)m_usPort, "");
		RakNet.StartupResult eStartupResult = m_cRnPeer.Startup(1, tSocketDesc, 1);


		if (eStartupResult != RakNet.StartupResult.RAKNET_STARTED)
		{
			Logger.WriteError("Master server peer failed to start. ErrorCode({0}) Port({1})", eStartupResult, m_usPort);
		}
	}
コード例 #7
0
ファイル: RakPeer.cs プロジェクト: songotony/RType-Client
 internal static HandleRef getCPtr(RakPeer obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
コード例 #8
0
ファイル: CNetworkServer.cs プロジェクト: nulhax/VOID
    bool StartupPeer(uint _uiNumSlots)
    {
        //m_cRnPeer = RakNet.RakPeerInterface.GetInstance();
        m_cRnPeer = new RakNet.RakPeer();


        RakNet.SocketDescriptor tSocketDesc = new RakNet.SocketDescriptor((ushort)m_usPort, "");
        RakNet.StartupResult eStartupResult = m_cRnPeer.Startup(_uiNumSlots, tSocketDesc, 1);
        bool bPeerStarted = false;


        if (eStartupResult != RakNet.StartupResult.RAKNET_STARTED)
        {
            Logger.WriteError("Raknet peer failed to start. ErrorCode({0})", eStartupResult);
        }
        else
        {
            m_cRnPeer.SetMaximumIncomingConnections((ushort)_uiNumSlots);
			m_cRnPeer.SetOccasionalPing(true);
			SendCounter = 0;
            bPeerStarted = true;


            Logger.Write("Server started with port ({0}) NumSlots({1})", m_usPort, _uiNumSlots);
        }

        return (bPeerStarted);
    }