Esempio n. 1
0
        public void WaitStart()
        {
            IPacket packet;

            if (!started)
            {
                while (connection.PollPacket(out packet))
                {
                    HandlePacket(packet);
                    if (packet is BaseEnterPacket || packet is SpawnPlayerPacket)
                    {
                        started = true;
                    }
                }
            }
        }
        //Use only for Single Player
        //Works because the data is already loaded,
        //and this is really only waiting for the embedded server to start
        public void WaitStart()
        {
            IPacket packet;
            bool    started = false;

            while (!started)
            {
                while (connection.PollPacket(out packet))
                {
                    HandlePacket(packet);
                    if (packet is BaseEnterPacket || packet is SpawnPlayerPacket)
                    {
                        started = true;
                    }
                }
                Game.Yield();
            }
        }