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!

[release]"@changename" fix.

Newbie Spellweaver
Joined
Apr 17, 2008
Messages
16
Reaction score
0
Open PlayerCommand.java:

Find:
Code:
import net.sf.odinms.net.channel.ChannelServer;

Add Above:
Code:
import net.sf.odinms.database.DatabaseConnection;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

Find:
Code:
player.getMap().addPlayer(player);

Add Above::
Code:
                                try {
                   Connection con = DatabaseConnection.getConnection();
                   PreparedStatement ps;
                   
                    String newname = StringUtil.joinStringFrom(splitted, 1);
                    ps = con.prepareStatement("UPDATE characters SET name = ? WHERE id = ?");
                    ps.setString(1, newname);
                    ps.setInt(2, player.getId());
                    ps.executeUpdate();
                        } catch (SQLException e) {
            mc.dropMessage("Some errors in mysql.");
        }


Enjoy, working changename with sql update.
 
Last edited:
Elite Diviner
Loyal Member
Joined
Nov 22, 2008
Messages
487
Reaction score
1
Re: "@changename" fix.

gj :drool:

Will be testing!
 
Newbie Spellweaver
Joined
Sep 15, 2008
Messages
63
Reaction score
1
Re: "@changename" fix.

Erm can i ask you where is the change name command link??I cant find it in the release section
 
Newbie Spellweaver
Joined
Apr 17, 2008
Messages
16
Reaction score
0
Re: "@changename" fix.

you can found it on Moogra repack.
if you need help just pm me.
 
Mythic Archon
Loyal Member
Joined
Jul 23, 2008
Messages
796
Reaction score
56
Re: "@changename" fix.

this makes it so you have to be logged off. Plus, mine works I think
 
Newbie Spellweaver
Joined
Apr 17, 2008
Messages
16
Reaction score
0
Re: "@changename" fix.

no, he stuck the player
 
Mythic Archon
Loyal Member
Joined
Jul 23, 2008
Messages
796
Reaction score
56
Re: "@changename" fix.

no... it reloads the player, you're missing methods
 
Newbie Spellweaver
Joined
Apr 17, 2008
Messages
16
Reaction score
0
Re: "@changename" fix.

its not update the sql
so you have two players
one stuck with no sql data
and one that cant connect

i check it...
 
Mythic Archon
Loyal Member
Joined
Jul 23, 2008
Messages
796
Reaction score
56
Re: "@changename" fix.

@changename changes 1 person's name. It changes your own name. I've checked. It updates when you log off. I checked. It goes through maplecharacter.java's savetodb. I checkd.
 
Newbie Spellweaver
Joined
Aug 21, 2008
Messages
72
Reaction score
0
Re: "@changename" fix.

its not update the sql
so you have two players
one stuck with no sql data
and one that cant connect

i check it...


oo, there is a simple fix for it...
go to maplecharacter.java
in saveToDB Function
add ,name = ?
before WHERE id = ?
then few lines under that
ps.setString(xx, name); //change xx to the next number it should be..
after
ps.setInt(xx, id); // xx is id positon
it should be after if (update) {
look for it...
 
Mythic Archon
Loyal Member
Joined
Jul 23, 2008
Messages
796
Reaction score
56
Re: "@changename" fix.

it's already there.
 
Experienced Elementalist
Joined
Jun 19, 2008
Messages
233
Reaction score
0
Nice release :)
i guess it could be usefull.
 
Newbie Spellweaver
Joined
Sep 15, 2008
Messages
63
Reaction score
1
Hmm so can anyone of you just post the whole @changename code here??I downloaded sinems repack xD.Dont want to download moogra to find that command.
 
Newbie Spellweaver
Joined
Jan 30, 2008
Messages
41
Reaction score
2
Moogra's your does stuck the player. And will require a server restart, hes works good. Nice job.
 
Newbie Spellweaver
Joined
Apr 17, 2008
Messages
16
Reaction score
0
savetoDB isnt saves name, but you can add name paramter..
 
Back
Top