Jump to content

Ovenuç®

Members
  • Posts

    533
  • Credits

  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by Ovenuç®

  1. Pfff let me explain it in even simpler words. This is not a Double check because the one is in the AttackRequest fine and the other is in the L2Character or whatever file. Yeah it passes through

    both files so it might be a double check for L2phx BUT for java coding as a sum it is a MUST check to prevent NPEs which will cuz memory leaks and -beep- up your stability. Dont think what

    you do as a player and that this might look impossible. L2Char or PcInst are huge classes with 24/7 used methods. If these methods are not null checked then you are -beep-ed.

     

     

    I cant make it simpler.

     

    just now i test it i remove the null check and i cant attack without phx and with phx...

  2. CT2.5 l2j code...

     

     

    // =========================================================
    // Method - Private
    /**
     * Launch a physical attack against a target (Simple, Bow, Pole or Dual).<BR><BR>
     *
     * <B><U> Actions</U> :</B><BR><BR>
     * <li>Get the active weapon (always equiped in the right hand) </li><BR><BR>
     * <li>If weapon is a bow, check for arrows, MP and bow re-use delay (if necessary, equip the L2PcInstance with arrows in left hand)</li>
     * <li>If weapon is a bow, consume MP and set the new period of bow non re-use </li><BR><BR>
     * <li>Get the Attack Speed of the L2Character (delay (in milliseconds) before next attack) </li>
     * <li>Select the type of attack to start (Simple, Bow, Pole or Dual) and verify if SoulShot are charged then start calculation</li>
     * <li>If the Server->Client packet Attack contains at least 1 hit, send the Server->Client packet Attack to the L2Character AND to all L2PcInstance in the _KnownPlayers of the L2Character</li>
     * <li>Notify AI with EVT_READY_TO_ACT</li><BR><BR>
     *
     * @param target The L2Character targeted
     *
     */
    protected void doAttack(L2Character target)
    {
    	if (Config.DEBUG)
    		_log.fine(getName()+" doAttack: target="+target);
    
    	if (!isAlikeDead() && target != null)
    	{
    		if (this instanceof L2Npc && target.isAlikeDead()
    				|| !getKnownList().knowsObject(target))
    		{
    			getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
    			sendPacket(ActionFailed.STATIC_PACKET);
    			return;
    		}
    		else if (this instanceof L2PcInstance)
    		{
    			if (target.isDead())
    			{
    				getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
    				sendPacket(ActionFailed.STATIC_PACKET);
    				return;
    			}
    
    			L2PcInstance actor = (L2PcInstance)this;
    			/*
    			 * Players riding wyvern or with special (flying) transformations can do melee attacks, only with skills
    			 */
    			if ((actor.isMounted() && actor.getMountNpcId() == 12621)
    					|| (actor.isTransformed() && !actor.getTransformation().canDoMeleeAttack()))
    			{
    				sendPacket(ActionFailed.STATIC_PACKET);
    				return;
    			}
    		}
    	}
    
    	if (isAttackingDisabled())
    		return;

  3. AHAHAHAH I WILL CRY NOW THEY PUT THAT CODE

     

    ESI RE ELFO SE PARAKALW MIN PERNIS MEROS SE KOUBENTA PIGENE MA8E TI KANEI TO DOATTACK KAI TO DOCAST KAI META ELA NA BGALIS GNWMI.. AN LEW PSEMATA OTI TO ELEGES ROTAME KAI TRYSKEL..

     

    OSO GIA AUTO TWRA MPIKE KAI PALI EINAI AXRISTO KAI DEN EINAI GIA TO L2PHX EINAI GIA TA MOBS!!!

  4. Okay mister i do it again(btw i just requested maxtor to make a dumbest user award just for you), The null checks are safety checks as a part of the code style you use and they are needed for the reason of beeing NPE safe, sometimes yes you'll have unnecessary null checks but in EVERY case when an object can be null you should have a null check, thats just common sense in java.

     

    As for the AttackRequest and doAttack, i say it again the AttackRequest null check is a null check for l2pcinstance class means that if the gameclient which is l2pcinstance is null than the AttackRequest fails and the packet not beeing send, altho when you look at the doAttack method it applies to players,monsters(and all their subclasses), also to summons and pets. Now since a pet for example cant be a pcinstance aka a player you'll need a null check. So its not a double null check but a necessary addition because it does matter if l2pcinstance is null or l2character is null(or l2summon for that matter).

     

     

    intrepid you get your answers if i go to post on l2jserver community that they will be lough all with you you know it that allready.. so say yes i am wrong!

    or i will go now on l2j community to post you code

     

     

    SO YOU ARE BETTER DEV FROM L2J DEVS BECAUSE L2J DEVS THEY DIDNT USE NULL CHECK IN doAttack

  5. re panivlaka sou ipa 5 fores oti to ena trexei mia fora enw to alo den stamataei pes tpt alo arketa me to doAttack ena gamimeno null check einai re stoke

     

     

    ahahah re ta pisteueis auta pou les? EILIKRINA? TA PISTEUEIS? PANTA PANTA PANTA MA PANTA TO PHX XTIPAEI CLIENTPACKETS!!! KAI META PAEI STA INNER CODING ELA EXETE LA8OS KAI DEN TO PARADEXESTE!!! APLA EGINES GELIOS APO TIN STIGMI POU MILISES GIA PHX KAI LES GAMA TA CLIENTPACKETS POS NA GAMISO TA CLIENTPACKETS OTAN TO PHX DOULEUEI MONO ME AUTA KAI TO BAD CODING TOUS!!

  6. yeap, phx sends the same packet as the client sends

    for example

     

    client sends FF AB FF 6A 00 00 00

    phx sends FF AB FF 6A 00 00 00

     

    server gets FF AB FF 6A 00 00 00

     

     

    SO HOW YOU WILL GO TO INSIDE CODE doAttack IF YOU HAVE CHECK METHOD ON ATTAACKREQUEST CLIENT PACKET SO INSIDE doAttack the code is bad you never use it!!!

     

     

    [GR]

     

    ELLINIKA POS 8A PERASIS TO CLIENTPACKET ME TO PHX AN EXEIS IDI EKEI ENA NULL CHECK!!! EFOSON TO PHX DOULEUEI MONO ME CLIENTPACKETS!

     

    EXIGISE TO MOU AUTO KAI 8A PW NAI RE EXEIS DIKIO K EXO ADIKO!

  7. To start with, in java you should have null checks as much as possible in your methods either way but i cant explain how it is more. I mean

    xdem explains exactly how it works.

     

    [GR]

     

    ESI ME DOULEUEIS TIN ALLI FORA SOU EXIGOUSA OTI TO DOATTACK DEN EXEI KAMIA SXESI ME TO DOCAST KAI MOU ELEGES PIGENE NA AFERESIS TO NULL CHECK KAI KANE TO SKILL TOU SORCER XORIS TARGET NA DEIS.. -beep-E ME ELFO..

     

    min mou peis oti ta bgazo apo to mialo mou...

  8. Ovenuc, we explained to you alredy many times. Your retardness makes my head spin, but beeing good guy Intrepid i'll explain it again. AttackRequest packet does have nothing to do with that method because attackrequest is not exclusively used in the doAttack method. Also the doAttack method needs the null check so that in case of somehow you manage to cast something without any target, the NPE gets caught instead of just causing a mess with no log about it.

     

    Now i understand that you want to act like a big guy, but just like the rest you stuck on the level of "peasant" and instead of improving and trying to understand the code you rage about you just rage about it calling others noobs. Thing is you should stop doing that, stand on your own 2 feet, start coding and the shut the hell up. When you gained some decent knowledge we will talk about such things, since so far its pointless to talk with you about java because you are totally clueless.

     

    EXPLAIN ME INTREPID WHY YOU NEED DOUBLE NULL CHECK IF YOU CANT BYPASS WITH PHX THE CLIENTPACKETS

     

    ALL IN MXC KNOWS L2PHX WORKING WITH CLIENTPACKETS SO YOU ARE WRONG! NOT ME

  9. forget the packet moron, put ur head that the packet is called ONCE and the facking method doAttack is looped

     

    gtfo

     

     

     

     

    axaxaxaxaxaxa

     

    CREATE NOW 1 SCRIPT FOR PHX AND USE IT!! IF YOU WILL TRY TO ATTACK TO SOMEONE YOU WILL BYPASS FIRST AttackRequest.java WAKE UP MORON!!!

     

     

    SO WHY YOU NEED DOUBLE NULL CHECK INSIDE TO DOATTACK IF YOU CANT BYPASS THE CLIENTPACKET! EXPLAIN IT!!

  10. listen, I dont care if your iq is less than 50 but look how it goes

     

    the packets triggers ONCE the doAttack takes place until u stop it or until u cant attack anymore, which means IT WORKS LIKE A LOOP

     

    L2PHX WORKING WITH CLIENT PACKETS!! ALL IN MXC KNOWS THAT YOU CANT BYPASS CLIENTPACKETS WITH PHX (PHX FIND BAD CODING IN CLIENTPACKETS AND CALL THE OTHER METHODS!) INSIDE  IF YOU HAVE FIXED THE CLIENT PACKETS L2PHX IS DEAD!!! IN YOU SERVER

  11.  

    You still can't get it do you ?

     

    RequestAttack comes when the player decides to attack a target, the packet is send ONCE it triggers ONCE but the doAttack method which is called by RequestAttack schedules more doAttack(s) according to the player's attack speed.

     

    omg you are really stupid!!!

     

    IF YOU HAVE NULL TARGET HOW YOU WILL BYPASS THE CLIENT PACKET EXPLAIN IT!!!

     

    L2 IS CLIENT PACKETS AND SERVERPACKETS 1 ACTION = 1 CLIENTPACKET METHOD!

  12. because doAttack sets Intention to Attack and shedules another doAttack after the first doAttack is finished, in the meanswhile the target can die/deleted or idk

     

    next question plis

    OMG? REALLY?

     

    if someone is null you cant bypass Attackrequest and the checks there..!!!!

     

    if someone is dead

     

    then you use that ...

     

    if (target.isDead())

    {

    getAI().setIntention(CtrlIntention.ACTIVE);

    sendPacket(ActionFailed.STATIC_PACKET);

    return;

    }

     

    ok xdem? so you dont need double null checks for the same method!!

  13. why you need null check in method  doAttack explain me that.. first for all.. :)

     

    lets learn the people some of l2 java..

     

    .network.clientpackets open AttackRequest.java that is the first step to attack if in there is all complete.. then you to method doAttack for simple hits (no skills)

     

    inside file AttackRequest.kava you will find that..

     

    if (activeChar.getTargetId() == _objectId)

    {

    target = activeChar.getTarget();

    }

    else

    {

    target = L2World.getInstance().findObject(_objectId);

    }

    if (target == null)

    {

    return;

    }[/quote]

     

     

    so you have double method for null check pro developer!!

  14. mono afto mou bgazi sto eclipse ...

    try (Connection con = L2DatabaseFactory.getInstance().getConnection())

    {

    PreparedStatement statement = con.prepareStatement(OLYMPIAD_LOAD_NOBLES);

    ResultSet rset = statement.executeQuery();

     

    while (rset.next())

    {

    StatsSet statDat = new StatsSet();

    int charId = rset.getInt(CHAR_ID);

    statDat.set(CLASS_ID, rset.getInt(CLASS_ID));

    statDat.set(CHAR_NAME, rset.getString(CHAR_NAME));

    statDat.set(POINTS, rset.getInt(POINTS));

    statDat.set(COMP_DONE, rset.getInt(COMP_DONE));

    statDat.set("to_save", false);

     

    _nobles.put(charId, statDat);

    }   

    rset.close();

    statement.close();

    con.close();

    }

     

    auto sto bgazi to build i sou exei genika error mesa sto eclipse me kokino na fantasto eisai l2jh5?

  15. paw na kanw compile kai mou bgazi error

     

        [javac] try (Connection con = L2DatabaseFactory.getInstance().getConnection())

        [javac]     ^

        [javac]  (use -source 7 or higher to enable try-with-resources)

     

     

    ti prepei na kanw; 3erei kaneis;

     

    den nomizo na einai mono auto to error..

×
×
  • Create New...