Ejemplo n.º 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);
    }
Ejemplo n.º 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);
    }
Ejemplo n.º 3
0
    // 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);
        }
    }
Ejemplo n.º 4
0
 internal static HandleRef getCPtr(RakPeer obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Ejemplo n.º 5
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);
    }
Ejemplo n.º 6
0
    // 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);
		}
	}
Ejemplo n.º 7
0
 internal static HandleRef getCPtr(RakPeer obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Ejemplo n.º 8
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);
    }