Exemplo n.º 1
0
 public void ProcessPacket(IPacket packet)
 {
     if (ResponseHandler.HandlePacket(packet))
     {
         return;
     }
     try
     {
         var hsp = GeneratedProtocol.HandleServerPacket(packet, this, this);
         hsp.Wait();
         if (hsp.Result)
         {
             return;
         }
     }
     catch (Exception e)
     {
         FLLog.Exception("Player", e);
         throw;
     }
     try
     {
         switch (packet)
         {
         case PositionUpdatePacket p:
             //TODO: Error handling
             World?.PositionUpdate(this, p.Position, p.Orientation, p.Speed);
             break;
         }
     }
     catch (Exception e)
     {
         FLLog.Exception("Player", e);
         throw;
     }
 }