Dear developers,
Is it possible develop a storage color character's name in the database ? Many of my players want to have a constant color name their characters, so after restarting the server color nick remained
Name Color in Database
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- LasTravel
- Posts: 888
- Joined: Tue Jan 05, 2010 12:08 am
- Location: Spain
Re: Name Color in Database
Name, nick? You mean Title or name?
On epilogue title color are stored on db.
On epilogue title color are stored on db.
- badboy29
- Posts: 417
- Joined: Fri Apr 24, 2009 5:34 am
- Location: Brazil
-
- Posts: 21
- Joined: Fri Mar 05, 2010 2:08 pm
Re: Name Color in Database
I mean name color (nickname)LasTravel wrote:Name, nick? You mean Title or name?
On epilogue title color are stored on db.
- badboy29
- Posts: 417
- Joined: Fri Apr 24, 2009 5:34 am
- Location: Brazil
-
- Posts: 62
- Joined: Thu May 07, 2009 7:11 pm
Re: Name Color in Database
Try this patch.
Code: Select all
Index: l2jserver/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 4092) +++ l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -269,9 +269,9 @@ private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE charId=? AND class_index=?"; // Character Character SQL String Definitions: - private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,last_recom_date,createTime) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,last_recom_date,createTime,nick_color) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=? WHERE charId=?"; - private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime,language FROM characters WHERE charId=?"; + private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime,nick_color,language FROM characters WHERE charId=?"; // Character Teleport Bookmark: private static final String INSERT_TP_BOOKMARK = "INSERT INTO character_tpbookmark (charId,Id,x,y,z,icon,tag,name) values (?,?,?,?,?,?,?,?)"; @@ -416,6 +416,9 @@ /** The PvP Flag state of the L2PcInstance (0=White, 1=Purple) */ private byte _pvpFlag; + + /** The NickName Character Color */ + private String _nickColor = new String("FFFFFF"); /** The Fame of this L2PcInstance */ private int _fame; @@ -7123,6 +7126,7 @@ statement.setLong(36, 0); statement.setLong(37,System.currentTimeMillis()); statement.setLong(38,getCreateTime()); + statement.setString(39, _nickColor); statement.executeUpdate(); statement.close(); @@ -7199,6 +7203,9 @@ player.setNewbie(rset.getInt("newbie")); player.setNoble(rset.getInt("nobless")==1); + //Custom: NickName Color + player.setNickNameColor(rset.getString("nick_color")); + player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time")); if (player.getClanJoinExpiryTime() < System.currentTimeMillis()) { @@ -7383,6 +7390,16 @@ } /** + * @param string + */ + private void setNickNameColor(String color) + { + int decode = 0; + decode = Integer.decode("0x"+color); + getAppearance().setNameColor(decode); + } + + /** * @return */ public Forum getMail()
I use google translate.
-
- Posts: 21
- Joined: Fri Mar 05, 2010 2:08 pm
Re: Name Color in Database
I can do it myself, but it is inconvenient that with each update will have to edit the source code.
Last edited by reblock on Tue Jul 06, 2010 9:26 am, edited 1 time in total.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: Name Color in Database
??? Do synchronization, not update.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- Mctavish
- Posts: 140
- Joined: Sat Aug 20, 2011 7:05 am
- Location: Queen City of The South
Re: Name Color in Database
i tried this code but i got an error when i log-in my character

any solution bro? or i did something wrong?
hhmm btw im using last rev of L2J-Freya...

any solution bro? or i did something wrong?
hhmm btw im using last rev of L2J-Freya...
