Cakewalk.Server.ServerEntity.HandlePacket C# (CSharp) Метод

HandlePacket() защищенный Метод

Incoming packets are pushed here for handling.
protected HandlePacket ( IPacketBase packet ) : void
packet IPacketBase
Результат void
        protected unsafe override void HandlePacket(IPacketBase packet)
        {
            base.HandlePacket(packet);

            //Update state from the client
            if (packet is PushState)
            {
                PushState state = (PushState)packet;
                //Push their state if it's the correct world ID
                if (state.WorldID == WorldID)
                {
                    LastState = state.State;
                }
            }

            //Move the user in to a new zone
            else if (packet is RequestZoneTransfer)
            {
                RequestZoneTransfer request = (RequestZoneTransfer)packet;

                m_world.ZoneManager.RequestZoneTransfer(this, request.ZoneID);
            }

            //Resolve names
            else if (packet is WhoisRequest)
            {
                WhoisRequest request = (WhoisRequest)packet;
                WhoisResponse response = PacketFactory.CreatePacket<WhoisResponse>();
                response.WorldID = request.WorldID;
                string name = m_world.GetNameForWorldID(request.WorldID);
                TextHelpers.StringToBuffer(name, response.Name, name.Length);
                DeferredSendPacket(response);
            }
        }