Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Development v40 Beta Edition Source | Merry Christmas

Newbie Spellweaver
Joined
Jul 17, 2008
Messages
51
Reaction score
4
I'm stuck. Wouldn't mind some help though.


zWE6xs2 - Development v40 Beta Edition Source | Merry Christmas - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
I'm stuck. Wouldn't mind some help though.

Lol if you can fix the SQL error why can't you fix a NPE?

Line 619 on getCharInfo of MaplePacketCreator:
Code:
for (int map : chr.getVIPRockMaps()) {
                    mplew.writeInt(map);
                }

Line 1363 on getVIPRockMaps of MapleCharacter:
Code:
public int[] getVIPRockMaps() {
            int[] rockmaps = new int[] {999999999, 999999999, 999999999, 999999999, 999999999};
            try {
                PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("SELECT mapid FROM trocklocations WHERE cid = ?");
                ps.setInt(1, id);
                ResultSet rs = ps.executeQuery();
                int i = 0;
                while (rs.next()) {
                    rockmaps[i] = (rs.getInt("mapid"));
                    i++;
                }
                rs.close();
                ps.close();
            } catch (SQLException se) {
                return null;
            }
            return rockmaps;
        }

Look at the code closely to see what would reference a null pointer exception. :)
 
Newbie Spellweaver
Joined
Dec 24, 2013
Messages
85
Reaction score
21
This is cool, although it does take some time to edit the sql to work. Why not release a clean copy of your sql?
 
FutureLegend's Owner
Joined
Feb 10, 2011
Messages
470
Reaction score
99
that, or a sql error that isn't getting outputted and just returning null.

Well anyways, this is what the guy PMed me

tenkirokun said:
rockmaps = (rs.getInt("mapid"));

I got that. That is the reference.

What can i do now to solve the NullPointerException?


Which means that even if we POINT at the null reference ourselves, he doesn't know what to check even though it's before his eyes.. pretty hopeless.

Look dude, if I showed you this
PHP:
rockmaps[i] = (rs.getInt("mapid"));
, that means you have to go to your database and first confirm that the column "mapid" exist, then check if it's NULL. Same for any other statement which might be null. Why are you trying to open a server prior to learning the basics of coding / debugging?
 
Newbie Spellweaver
Joined
Jul 17, 2008
Messages
51
Reaction score
4
The thing is, I get the error upon character selection. Not when I use a teleport rock. Why would the error be coming from there?
 
FutureLegend's Owner
Joined
Feb 10, 2011
Messages
470
Reaction score
99
The thing is, I get the error upon character selection. Not when I use a teleport rock. Why would the error be coming from there?

"PlayerLoggedInHandler" Isn't called when you use a teleport rock...
 
Newbie Spellweaver
Joined
Jan 5, 2015
Messages
17
Reaction score
0
Some methods called on character creation get called when you change maps/channels too. So that's why its being called
 
Newbie Spellweaver
Joined
Jul 17, 2008
Messages
51
Reaction score
4
Look dude, if I showed you this
PHP:
rockmaps[i] = (rs.getInt("mapid"));
, that means you have to go to your database and first confirm that the column "mapid" exist, then check if it's NULL. Same for any other statement which might be null. Why are you trying to open a server prior to learning the basics of coding / debugging?

I went into my database, trocklocations > Mapid exist and it's not NULL.
 
Newbie Spellweaver
Joined
Jul 17, 2008
Messages
51
Reaction score
4
I was using the SQL that was inside the folder of xtras in the download. Do you think that SQL is corrupted much? Should i attempt using a different SQL?
 
Newbie Spellweaver
Joined
Jan 5, 2015
Messages
17
Reaction score
0
I was using the SQL that was inside the folder of xtras in the download. Do you think that SQL is corrupted much? Should i attempt using a different SQL?
No sql released will help, just gonna need to slowly fix one.
 
C# developer
Joined
Dec 4, 2013
Messages
656
Reaction score
80
Leechers should learn how to fix released stuffs. otherwise, this is just wrong.
 
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
I was using the SQL that was inside the folder of xtras in the download. Do you think that SQL is corrupted much? Should i attempt using a different SQL?

it's funny cuz u don't get it looooooooool

i gave you the complete answer to your problem and you were too blind to see it lmao

also, if you knew anything about packets (you've been here since 2008 and can't fix an sql error in the first place?), teleport rocks have saved locations which default at map 999999999 which are loaded on the character info packet sent when you login.. getCharInfo iterates to check your saved locations, which the savedlocations are grabbed through the sql.
 
Back
Top