Thread: i was looking in my source and wandering...

Results 1 to 5 of 5
  1. #1 i was looking in my source and wandering... 
    Registered Member

    Join Date
    Jun 2009
    Posts
    703
    Thanks given
    2
    Thanks received
    7
    Rep Power
    233
    are any of this stuff important?. for wild attacking because it ant working for some reason
    Code:
    public void UsePacket() {
    	/*if (Focus == 0 && packetType == 241) {
    	    for (int i = 0; i < 26; i++) {
    		if (silentPackets[i] <= 0) {
    		    silentPackets[i] = packetType;
    		    break;
    		}
    	    }
    	    silentMouseLog++;
    	    if (silentMouseLog >= 5)
    		appendSilentMouse();
    	    if (silentMouseLog >= 25) {
    		appendtoTempBanned();
    		disconnected = true;
    	    }
    	}*/
    just wandering if i should uncomment this or this
    Code:
    /*if ((Focus != 0 || packetType == 3 || packetType == 202)
    	    && packetDelay <= 0) {
    	    silentMouseLog = 0;
    	    for (int i = 0; i < 26; i++)
    		silentPackets[i] = -1;*/
    Code:
    /*public boolean PacketProcess()
        {
    		try {
            if(PlayerHandler.players[playerId] == null || disconnected || in == null)
            {
    			System.out.println("Disconnected 5");
                return false;
            }
            if(timeOutCounter++ <= 15)
            {
                //break;
    			//System.out.println("Disconnected ");
    			//runStream = false;
           // disconnected = true;
            }
            
         //   return false;
            int i;
            i = 0;
            i = in.available();
            if(i == 0)
            {
                return false;
            }
            if(packetType == -1)
            {
                packetType = in.read() & 0xff;
                packetType = packetType - inStreamDecryption.getNextKey() & 0xff;
                packetSize = packetSizes[packetType];
                i--;
            }
            if(packetSize != -1)
            {
                //break;
            }
            if(i > 0)
            {
                packetSize = in.read() & 0xff;
                i--;
               // break;
            }
            //return false;
            if(i < packetSize)
            {
                return false;
            }
            fillInStream(packetSize);
            timeOutCounter = 0;
            if(packetType > 0)
            {
    			System.out.println("recieved packet: "+packetType);
                UsePacket();
               // break;
            }
            packetType = -1;
            //return false;
           // Exception exception;
            //exception;
            packetType = -1;
            runStream = false;
            if(combatDelay <= 0 && deathDelay < 0)
            {
    			//System.out.println("Disconnected 7");
                //disconnected = true;
            }
           // return false;
            if(packetType == 72 || packetType == 128)
            {
                if(IsAttackingNPC && !IsDead)
                {
                    if(Server.s.npcHandler.npcs[attacknpc] != null)
                    {
                        if(!Server.s.npcHandler.npcs[attacknpc].IsDead)
                        {
                            attackNpc();
                        } else
                        {
                            IsAttackingNPC = false;
                        }
                    } else
                    {
                        IsAttackingNPC = false;
                    }
                }
                if(attackingPlayer && !IsDead)
                {
                    //
                    if(PlayerHandler.players[attackingPlayerId] != null)
                    {
                        //
                        if(!PlayerHandler.players[attackingPlayerId].IsDead)
                        {
                            attackPlayer();
                        } else
                        {
                            attackingPlayer = false;
                        }
                    } else
                    {
                        attackingPlayer = false;
                    }
                }
            }
    		} catch (Exception e){
    		}
            packetType = -1;
            return true;
    		
        } */
    this is packet process which has been canceled out and been replaced with this
    Code:
    public boolean PacketProcess() {
    		if (disconnected) {
    			System.out.println("Disconnected ");
    			return false;
    		}
            try {
    			parseOutgoingPackets();
                if (timeOutCounter++ > 20/* && logoutButton*/) {
                    System.out.println("Disconnected "+playerName+", Data transfer timeout.");
                    disconnected = true;
                    return false;
                }
                if(in == null) return false;
                int avail = in.available();
                if(avail == 0) return false;
    
                if(packetType == -1) {
                    packetType = in.read() & 0xff;
                    if(inStreamDecryption != null)
                        packetType = packetType - inStreamDecryption.getNextKey() & 0xff;
                    packetSize = packetSizes[packetType];
                    avail--;
                }
                if(packetSize == -1) {
                    if(avail > 0) {
                        packetSize = in.read() & 0xff;
                        avail--;
                    }
                    else return false;
                }
                if(avail < packetSize) return false;
                fillInStream(packetSize);
                timeOutCounter = 0;
                UsePacket();
                packetType = -1;
            } catch(java.lang.Exception __ex) {
                System.out.println("Exception encountered while parsing incoming packets from "+playerName+".");
                __ex.printStackTrace(); 
                disconnected = true;
            }
            return true;
        }
    as you can see in the other packet process it says attack player so shall i delete the process which isnt canceled out?
    Reply With Quote  
     

  2. #2  
    Registered Member
    G0nzo's Avatar
    Join Date
    Feb 2009
    Posts
    4,960
    Thanks given
    514
    Thanks received
    546
    Rep Power
    1735
    top bit is all important
    Computer Science Graduate, Java Expert
    Need help with something? PM me
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Jun 2009
    Posts
    703
    Thanks given
    2
    Thanks received
    7
    Rep Power
    233
    ok so shall i uncomment it?.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jul 2008
    Posts
    2,056
    Thanks given
    26
    Thanks received
    98
    Rep Power
    0
    neither is important for wild attacking in particular,
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Jun 2009
    Posts
    703
    Thanks given
    2
    Thanks received
    7
    Rep Power
    233
    ok... back to searching for me..
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •