Jump to content

Recommended Posts

Posted

I have found a bug, no - mistake :

<set name="type" val="L2MultiShopInstance"/> <--- donatenpc, have to be right like this, was val="L2MultiShop"

 

  • 4 weeks later...
Posted (edited)
  • Updated to aCis 360.
  • Cleaned a bit. 
  • Removed MultiShopManager file. Everything moved to L2MultiShopInstance.

Some(the most) of those checks can be easily bypassed if you know how. I won't give you the way to fix those checks. So, I mentioned this just to have a clue.

Edited by 'Baggos'
Posted

You managed to make Java look like some scripting language.

You have done it many times in shares :P 

( I do not say so to offend you ) is just share code

but they said ( while you forgot it ) :)

Some(the most) of those checks can be easily bypassed if you know how. I won't give you the way to fix those checks. So, I mentioned this just to have a clue.

Good luck.

 

shares is for help newbies to see how work code ( no one share is ready for used in live server )

 

ty for share 

Posted (edited)

 

no one share is ready for used in live server 

 

Why? if the code is properly coded its ready. thats why we are coding :D

 

You can use many many alternative ways of coding, especially in baggos shop. 

 

Example this code:

   if (command.startsWith("donate"))
   {
       StringTokenizer st = new StringTokenizer(command);
       st.nextToken();
       try
       {
           String type = st.nextToken();
           switch (type)
           {
               case "Noblesse":
                   Nobless(player);
                   break;
               case "ChangeSex":
                   Sex(player);
                   break;
               case "CleanPk":
                   CleanPk(player);
                   break;
               case "FullRec":
                   Rec(player);
                   break;
               case "ChangeClass":
                   final NpcHtmlMessage html = new NpcHtmlMessage(0);
                   html.setFile("data/html/mods/donateNpc/50091-2.htm");
                   player.sendPacket(html);
                   break;
           }
       }
       catch (Exception e)
       {
       }
   }

can be written in this way even if switch case maybe will be more safer,readable

	Method callingMethod = L2MultiShopInstance.class.getMethod(st.nextToken(), L2PcInstance.class);
	callingMethod.invoke(new L2MultiShopInstance(), player);

Ofc there must be some changes for example in methods name so they can be called by exactly the same name of the token ...

Nvm the coding style of a person is different from others but this doesn't mean that isn't correct ;)

 

(For sure this example is usefull when you have to call many methods so, you just avoid the switch case ...)

Edited by melron
Posted

Why? if the code is properly coded its ready. thats why we are coding :D

can you show me one shared code ready ? ( how is in shared section ? )

Posted

Why did you have to code everything static in the NpcInstance?

 

Also SO MUCH REDUNDANT code.

 

I mean what is that:

You repeat this for every class while you would have the class id to be the command substring then parse it as an integer and all those 300 lines of code become 6.

 

You managed to make Java look like some scripting language.

The most parts of this code, it was on MultiManager file(As I said I moved everything to MultiInstance). That's why I used static methods. But yes, I should change it now.

 

About the other, can be done with x,y ways for sure, and will be more clean/smaller/readable. I used this way at the beginning of this code(December) and maybe I should give a other view as I did with some others parts.

Thanks for mention it.

 

shares is for help newbies to see how work code ( no one share is ready for used in live server )

ty for share 

Sure, some shares are pretty much a ready review of something, but that's not mean you shouldn't have something clean for a newbie to understand the basic things. :P 

Posted

can you show me one shared code ready ? ( how is in shared section ? )

What you mean? i can show you a classic code .online. the way its working isn't correct?

 

All i want to say is, that in this forum 70% of the members (+me) we are trying to improve ourselves and being better but this doesn't mean

we cannot make a correct code...

Posted

Sure, some shares are pretty much a ready review of something, but that's not mean you shouldn't have something clean for a newbie to understand the basic things. :P

i have help many people from this forum ... if i want this don't learn java ( just can i give it ready code ) 

if they don't stay to find the " bug " can't learn l2j

 

What you mean? i can show you a classic code .online. the way its working isn't correct?

 

All i want to say is, that in this forum 70% of the members (+me) we are trying to improve ourselves and being better but this doesn't mean

we cannot make a correct code...

i don't mean you can't create 1 correct code ( and for sure i don't try to offend no one who share codes )
but think the 99% of share is codes ( who i don't need on my pc , so can i share it ) before delete it ... ( this i thinking )
Posted

can you show me one shared code ready ? ( how is in shared section ? )

My AIO system for example, offline shops.. You can use it for live server without fear :D
Posted

 

i don't mean you can't create 1 correct code ( and for sure i don't try to offend no one who share codes )
but think the 99% of share is codes ( who i don't need on my pc , so can i share it ) before delete it ... ( this i thinking )

 

 

I was not offended relax :P

 

If i understand well you mean 99% of the codes that are shared here are from guys that they think the code is useless for them and they say "i will share it to get some reputation"?
If yes , i agree in some cases ... besides, why someone will share a 'rare' code without getting some money? Ofcourse there are exceptions ...
Posted

A shared code is an examble to work on it or even with a base create another one mod..its usefull for the users who want to learn java..when someone starts must read and understand the code..then all is possible..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...