Skip to content

olympiad points

Featured Replies

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

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?

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

  • Author

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";

 

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?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.