Jump to content

L2Jpes Interlude Project


Recommended Posts

you should refactor everything at once so you dont end up having a gazillion refactoring changesets^^

I don't have in mind what my next refactor is going to be, so I commit them separately.

 

I hope you move them in datapack in the future

Fine, now go play with your flying ship.

Link to comment
Share on other sites

I hope you move them in datapack in the future

 

Pointless, if you leave them in the core you can use them for much greater things :

 

Its best to unhardcode stuff like olympiad and such features.

Link to comment
Share on other sites

Guest Elfocrash

Pointless, if you leave them in the core you can use them for much greater things :

 

Its best to unhardcode stuff like olympiad and such features.

It is best to unhardcode as much stuff as you can for obvious reasons + starting with the handlers is a good move as it is easy us fuck.

Link to comment
Share on other sites

Personally, I want java on my eclipse and scripts on the dp

And some people want a million dollar, we cant have everyone satisfied.

Link to comment
Share on other sites

It is best to unhardcode as much stuff as you can for obvious reasons + starting with the handlers is a good move as it is easy us -beep-.

 

Yes its good to unhardcode stuff(altho using them in jars is pretty much the best way for performance gains, or just caching them), but there are things that should not be unhardcoded.

 

Keeping the handlers in the core gives you the possibility of having class based restriction so for example

 

if (itemId = infinite line of itemIds) or if (potions.class)

 

Doesnt seem much but used properly on the places where it can its a pretty good thing.

Link to comment
Share on other sites

And some people want a million dollar, we cant have everyone satisfied.

 

really ?

 

You compare two really different things.

 

On l2j everything is possible while on real life not ;)

Link to comment
Share on other sites

really ?

 

You compare two really different things.

 

On l2j everything is possible while on real life not ;)

I am comparing the desire in general not the specific environment.

Link to comment
Share on other sites

Guest Elfocrash

but there are things that should not be unhardcoded.

I never said he should do it on everything. He can't do it either way knowledgewise to start with.

Link to comment
Share on other sites

Where do we start :) Damn L2J community is still striving and going good. That's interesting news, but now on a more serious note regarding the packs and some replies here.

 

The educational myth

 

Personally, I don't believe L2 to be the best option for educational purposes. Mainly because L2J and generally private servers is a concept way too close to the market. Everything around here is done for the money. It is not a good ground for education when everyone expects your product to reach production state and make money. There are countless of open source projects out there for Java Developers that want to learn to use Java Technologies. Some that I could name are the Jetty Open Source Web Server, Apache Solr Indexer, the NoSQL Cassandra database etc. They all include amazing technologies, JAX-RS, JAXB, EJB3, Spring, Hibernate etc.

 

The new hot L2J Project

 

I'll pretend to be your grandpa, "listen kid", you don't create a new L2J Project just because you want to refractor the code in a way you believe is the right one. If you ask ten people where they want handlers to be, you will get ten different answers, even if they can be in the core, or in the datapack. The same will go for the name of L2PcInstance class. Purity is not a goal you should pursue in real life. On the other hand, chaos isn't a goal either. You can't create a pack full of shitty customs just because you learnt how to adopt every share out there to your pack.

 

Why should a pack exist ?

 

A pack should exist if it gives value to the people that need it. Ask this question to yourself when you create a pack, what am I doing different than the others that will make my target group prefer me over them ? Specifically for your pack, you should ask what does it do better than acis, in which sections does it improve it. That's how you can find your packs identity. I could name some reasons where acis fails and you could succeed. Examples: lack of custom codes, lack of essential things like custom gatekeeper/buffer, lack of SVN access for easy sync.

 

PS:

if (itemId = infinite line of itemIds) or if (potions.class)

That's not a reason for handlers to stay in the core -.-'. And it violates the Liskov principle of Object Oriented Programming.

 

Link to comment
Share on other sites

Where do we start :) Damn L2J community is still striving and going good. That's interesting news, but now on a more serious note regarding the packs and some replies here.

 

The educational myth

 

Personally, I don't believe L2 to be the best option for educational purposes. Mainly because L2J and generally private servers is a concept way too close to the market. Everything around here is done for the money. It is not a good ground for education when everyone expects your product to reach production state and make money. There are countless of open source projects out there for Java Developers that want to learn to use Java Technologies. Some that I could name are the Jetty Open Source Web Server, Apache Solr Indexer, the NoSQL Cassandra database etc. They all include amazing technologies, JAX-RS, JAXB, EJB3, Spring, Hibernate etc.

 

The new hot L2J Project

 

I'll pretend to be your grandpa, "listen kid", you don't create a new L2J Project just because you want to refractor the code in a way you believe is the right one. If you ask ten people where they want handlers to be, you will get ten different answers, even if they can be in the core, or in the datapack. The same will go for the name of L2PcInstance class. Purity is not a goal you should pursue in real life. On the other hand, chaos isn't a goal either. You can't create a pack full of shitty customs just because you learnt how to adopt every share out there to your pack.

 

Why should a pack exist ?

 

A pack should exist if it gives value to the people that need it. Ask this question to yourself when you create a pack, what am I doing different than the others that will make my target group prefer me over them ? Specifically for your pack, you should ask what does it do better than acis, in which sections does it improve it. That's how you can find your packs identity. I could name some reasons where acis fails and you could succeed. Examples: lack of custom codes, lack of essential things like custom gatekeeper/buffer, lack of SVN access for easy sync.

 

PS:That's not a reason for handlers to stay in the core -.-'. And it violates the Liskov principle of Object Oriented Programming.

 

 

Okay than i'll be more specific, heres a part from the l2jfree global restriction engine

 

public final boolean canUseItemHandler(Class<? extends IItemHandler> clazz, int itemId, L2Playable activeChar,

L2ItemInstance item, L2PcInstance player)

{

if (clazz == SummonItems.class)

{

if (player != null && isInFunEvent(player) && started() && !allowSummon())

{

activeChar.sendPacket(ActionFailed.STATIC_PACKET);

return false;

}

}

else if (clazz == Potions.class)

{

if (player != null && isInFunEvent(player) && started() && !allowPotions())

{

player.sendPacket(ActionFailed.STATIC_PACKET);

return false;

}

}

 

return true;

}

 

Same can be done with a specific skillhandler, skilltargethandler, admincommand handler or whatever you wish. Mainly for me thats the reason why i keep handlers in the core. Things like that in my book worth more than unhardcoding something becuse if you look it(and dont think about what l2j does because most of their stuff is just eyecandy or theoretically good stuff executed badly), you get better functionality over a simple convention of code design.

Link to comment
Share on other sites

Wow, you take things a bit too serious, Leluche. There is no reason for competition, there is no reason to create a project to compete acis and try to make something better than this. Also, there are no rules for creating a new project.

 

I do it for the lols as I said to the first post, that most of you missed, and as you can see at some previous replies haters gonna hate. If I want to refactor everything to food names I am gonna do it and the last thing I have in mind about this project is earning money.

Link to comment
Share on other sites

public final boolean canUseItemHandler(Class<? extends IItemHandler> clazz, int itemId, L2Playable activeChar,

        L2ItemInstance item, L2PcInstance player)

  {

      if (clazz == SummonItems.class) // Implementation agnostic ?

      {

        if (player != null && isInFunEvent(player) && started() && !allowSummon())

        {

            activeChar.sendPacket(ActionFailed.STATIC_PACKET);

            return false;

        }

      }

      else if (clazz == Potions.class) //Implementation agnostic ?

      {

        if (player != null && isInFunEvent(player) && started() && !allowPotions())

        {

            player.sendPacket(ActionFailed.STATIC_PACKET);

            return false;

        }

      }

     

      return true;

  }

 

This is a bad coding practice.

 

public final boolean canUseItemHandler(itemHandler handler, int itemId, L2Playable activeChar,

        L2ItemInstance item, L2PcInstance player)

  {

    boolean result = false;

 

    result = handler.evaluateConditions(itemId,activeChar,item,player); // ItemHandler interface includes evaluateConditions(...);

     

    return result;

  }

 

Easier, faster and implementation agnostic since this code section does not need to know the class type of the handler to evaluate. And it avoids reflecting on the Class<?> equality.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock