Jump to content

Question

6 answers to this question

Recommended Posts

  • 0
Posted
15 hours ago, haskovo said:

hello can someone share code after every match to update the points when someone have 9 match or something

what you mean update the points? and what pack you use?

  • 0
Posted (edited)

Olympiad.java

 

Find this:

 

	private static final String SELECT_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.obj_Id = olympiad_nobles_eom.char_id AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= ? ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";

 

Change it to this:

 

	private static final String SELECT_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.obj_Id = olympiad_nobles.char_id AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= ? ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";

 

Find this:

 

	private void saveNobleData()

 

Change it to this:

 

	public void saveNobleData()

 

 

---

 

OlympiadGameNormal.java

 

Find this:

 

		_playerOne.updateStat(COMP_DONE, 1);
		_playerTwo.updateStat(COMP_DONE, 1);

 

Insert below:

 

Olympiad.getInstance().saveNobleData();

 

 

Test and say if any problems. Not very optimal solution because it updates database for every single participant after each match, but I can't be bothered to explain to you how to make it update for 2 participants and you probably don't care to understand, so just use this or study the classes I mentioned and make your own sql statements.

Edited by An4rchy
  • 0
Posted

i have this there 

private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.obj_Id = olympiad_nobles.char_id AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";

 

  • 0
Posted
17 hours ago, haskovo said:

i have this there 

private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.obj_Id = olympiad_nobles.char_id AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";

 

Yes I think it's the same. Did you change it or was this the one in your source?

 

Also are you using clean aCis or some custom pack based on aCis?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...