- 0
This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
luk19as
Hello guys, i really need help saving the color i chose into the database.
I made a color manager where I can choose colors, but after i chose for example red it wont save after i do restart (relog).
This is the Java code in L2PcInstance:
public void saveName(int color){// Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(false); PreparedStatement statement; statement = con.prepareStatement("UPDATE characters SET name_color=?"+color+" WHERE account_name='"+_accountName+"'"); statement.setString(1, StringToHex(Integer.toHexString(color).toUpperCase())); statement.execute(); statement.close(); statement = null; getAppearance().setNameColor(color); broadcastUserInfo(); } catch(Exception e){} finally { CloseUtil.close(con); con = null; } }This is the code for one color in python .py file:
How can i make my name color to save after i do restart?
Please answer.
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now