as I have lost my pack (L2J archid) forum account (I still wait for ya Sethek :P), I post here, as it can help more people, and it's not a relative question to L2Jarchid, but java in general.
NPE... For NullPointerException. I got a lot of those errors, for many different things.
- my voicedcommandhandlers bug cause of that ;
- sieges doors make this error, but work ;
-throne siege is buggy too, when i try to sit on it i got an NPE.
So I would like to ask : what are those errors, and how I can fix it. I ask for theory, and perhaps if u got an existing exemple to show (from any pack, I don't care) it would be cute.
I got a really lil idea about it ; I think it's an exception which come when something is null. But got no idea if I have to set a variable for that, etc.
Those errors seem to occur when I double click, or more accuratly, when I already made that action one time.
For example, castle doors ; one click on any door and i can still move. If I click on one door, and click one time on another door, no error too. But if I double click on any gate, I got NPE error, and my character is "stuck" until I click on me.
About my voicecommand, it's more drama as it bugs the entire command : when you type .stats you got stats (shared on this forum :P), it's bug differently according if i'm an admin or no. I didn't understand how, but it happens and block the command (only show one NPE error w/o show something anymore) until a client restart...
I "coded" this voicecommandhandler 3 times, 3 differents ways (using or no the npchtmlmessage, and reading sources from L2j interlude, l2jfree interlude, and l2jumbrella gracia 1.5). I don't understand, cause my voicecommander is P.E.R.F.E.C.T and it makes me cry to see I spend so much time on a stupid NPE error lol.
Well, any point of view can help... If you need screenshots of errors, just tell me.
Exception in thread Normal packet Pool xx
java.lang.NullPointerException
at ihateNPE.gamerserver.network.clientpackets.L2GameClientPacket.run
(xx = number of the error, it goes ++ each time...)
And no I didn't mod L2gameclientpacket... And ofc, it's not ihateNPE :p.
For many reasons:
1) modernizing code base, increase maintainability and reduce effort for development of new feature: split code into business layers, for example data from datapack, npc/item templates, world objects; remove circular dependencies between layers; create API-like objects; remove duplicated code (copy-pasts); using external libraries to replace some part of the code
2) using modern tools like ORMs (EF core) with ability to use different DBMS (I already switched from MySQL to PostgreSQL) ; generators for in-game interfaces (L2 html's)
I'm thinking also about using Akka (agent) library in the future for world objects and their interaction.
3) optimizations: for example reducing memory usage and memory allocations with C# structs
Question
Tryskell
Hi all,
as I have lost my pack (L2J archid) forum account (I still wait for ya Sethek :P), I post here, as it can help more people, and it's not a relative question to L2Jarchid, but java in general.
NPE... For NullPointerException. I got a lot of those errors, for many different things.
- my voicedcommandhandlers bug cause of that ;
- sieges doors make this error, but work ;
-throne siege is buggy too, when i try to sit on it i got an NPE.
So I would like to ask : what are those errors, and how I can fix it. I ask for theory, and perhaps if u got an existing exemple to show (from any pack, I don't care) it would be cute.
I got a really lil idea about it ; I think it's an exception which come when something is null. But got no idea if I have to set a variable for that, etc.
Those errors seem to occur when I double click, or more accuratly, when I already made that action one time.
For example, castle doors ; one click on any door and i can still move. If I click on one door, and click one time on another door, no error too. But if I double click on any gate, I got NPE error, and my character is "stuck" until I click on me.
About my voicecommand, it's more drama as it bugs the entire command : when you type .stats you got stats (shared on this forum :P), it's bug differently according if i'm an admin or no. I didn't understand how, but it happens and block the command (only show one NPE error w/o show something anymore) until a client restart...
I "coded" this voicecommandhandler 3 times, 3 differents ways (using or no the npchtmlmessage, and reading sources from L2j interlude, l2jfree interlude, and l2jumbrella gracia 1.5). I don't understand, cause my voicecommander is P.E.R.F.E.C.T and it makes me cry to see I spend so much time on a stupid NPE error lol.
Well, any point of view can help... If you need screenshots of errors, just tell me.
(xx = number of the error, it goes ++ each time...)
And no I didn't mod L2gameclientpacket... And ofc, it's not ihateNPE :p.
Link to comment
Share on other sites
10 answers to this question
Recommended Posts