示例#1
0
 public void sendPacketToTrackedPlayersAndTrackedEntity(Entity entity, Packet packet)
 {
     var entitytrackerentry = (EntityTrackerEntry) trackedEntityHashTable.lookup(entity.entityId);
     if (entitytrackerentry != null)
     {
         entitytrackerentry.sendPacketToTrackedPlayersAndTrackedEntity(packet);
     }
 }
示例#2
0
 public void sendPacket(Packet packet)
 {
     netManager.addToSendQueue(packet);
     field_22004_g = field_15_f;
 }
示例#3
0
 public override void registerPacket(Packet packet)
 {
     logger.warning(
         (new StringBuilder()).append(GetType()).append(" wasn't prepared to deal with a ").append(
             packet.GetType()).toString());
     kickPlayer("Protocol error, unexpected packet");
 }
示例#4
0
文件: Packet.cs 项目: riverar/Crafty
 public static void writePacket(Packet packet, DataOutputStream dataoutputstream)
 {
     dataoutputstream.write(packet.getPacketId());
     packet.writePacketData(dataoutputstream);
 }
示例#5
0
 public override void registerPacket(Packet packet)
 {
     kickUser("Protocol error");
 }
示例#6
0
 public void sendPacketToTrackedPlayers(Packet packet)
 {
     EntityPlayerMP entityplayermp;
     for (Iterator iterator = trackedPlayers.iterator();
          iterator.hasNext();
          entityplayermp.playerNetServerHandler.sendPacket(packet))
     {
         entityplayermp = (EntityPlayerMP) iterator.next();
     }
 }
示例#7
0
 public void sendPacketToTrackedPlayersAndTrackedEntity(Packet packet)
 {
     sendPacketToTrackedPlayers(packet);
     if (trackedEntity is EntityPlayerMP)
     {
         ((EntityPlayerMP) trackedEntity).playerNetServerHandler.sendPacket(packet);
     }
 }
 public void func_12022_a(double d, double d1, double d2, double d3, Packet packet)
 {
     for (int i = 0; i < playerEntities.size(); i++)
     {
         var entityplayermp = (EntityPlayerMP) playerEntities.get(i);
         double d4 = d - entityplayermp.posX;
         double d5 = d1 - entityplayermp.posY;
         double d6 = d2 - entityplayermp.posZ;
         if (d4*d4 + d5*d5 + d6*d6 < d3*d3)
         {
             entityplayermp.playerNetServerHandler.sendPacket(packet);
         }
     }
 }
 public bool sendPacketToPlayer(string s, Packet packet)
 {
     EntityPlayerMP entityplayermp = getPlayerEntity(s);
     if (entityplayermp != null)
     {
         entityplayermp.playerNetServerHandler.sendPacket(packet);
         return true;
     }
     else
     {
         return false;
     }
 }
 public void sendPacketToAllPlayers(Packet packet)
 {
     for (int i = 0; i < playerEntities.size(); i++)
     {
         var entityplayermp = (EntityPlayerMP) playerEntities.get(i);
         entityplayermp.playerNetServerHandler.sendPacket(packet);
     }
 }
示例#11
0
        public void addToSendQueue(Packet packet)
        {
            if (m_isServerTerminating)
            {
                return;
            }

            lock (sendQueueLock)
            {
                sendQueueByteLength += packet.getPacketSize() + 1;
                if (packet.isChunkDataPacket)
                {
                    chunkDataPackets.add(packet);
                }
                else
                {
                    dataPackets.add(packet);
                }
            }
        }
示例#12
0
 public void func_776_a(Packet packet)
 {
     for (int i = 0; i < field_1072_b.size(); i++)
     {
         var entityplayermp = (EntityPlayerMP) field_1072_b.get(i);
         if (entityplayermp.field_420_ah.contains(field_1069_e))
         {
             entityplayermp.playerNetServerHandler.sendPacket(packet);
         }
     }
 }