Jump to content
  • 0

How to reset Olympiad info instantly


tiguz

Question

Hello! I have a custom feature to change a player's base class. So in order to not mess the olympiad, when a player changes his baseclass, a statement is executed to reset his fights/points.

The db is updated correctly, but back in game, if I restart the char and use /olympiadstat, I still have the old points/fights.

 

I saw in other servers that this info is updated instantly. 

How can I do it instantly too?

atm this is what Im running: 

 

          // Reset olympiad data for this player.

            statement = con.prepareStatement("UPDATE olympiad_nobles SET class_id=?, olympiad_points=?, competitions_done=?, competitions_won=?, competitions_lost=?, competitions_drawn=? WHERE char_Id=?");                        
            statement.setInt(1, player.getClassId().getId());
            statement.setInt(2, 18);
            statement.setInt(3, 0);
            statement.setInt(4, 0);
            statement.setInt(5, 0);
            statement.setInt(6, 0);
            statement.setInt(7, player.getObjectId());
            statement.execute();
            statement.close();

 

Any help is welcome!

Edited by tiguz
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Its because you are changing only the database and that means your new stats will be applied  only after the server restart.

In order to change it instantly you have to do some changes where the player stats are stored about olympiad.

example 

private static final Map<Integer, StatsSet> _nobles = new HashMap<>();
private static final Map<Integer, Integer> _noblesRank = new HashMap<>();

these maps (Olympiad.java) contains infos about players. you should check there if the player is inside and change/add the values

Edited by melron
Link to comment
Share on other sites

  • 0
21 minutes ago, melron said:

Its because you are changing only the database and that means your new stats will be applied  only after the server restart.

In order to change it instantly you have to do some changes where the player stats are stored about olympiad.

example 


private static final Map<Integer, Integer> _noblesRank = new HashMap<>();

this map (Olympiad.java) contains infos about players. you should check there if the player is inside and change/add the values

thx for the reply Melron. but im not sure if I understood what you mean. Can you be more detailed pls?

Link to comment
Share on other sites

  • 0

He can't be more detailed. You have to clear record for that specific player. If you still don't get then, for example _nobles.remove(player.getObjectId());

  • Thanks 1
Link to comment
Share on other sites

  • 0
2 hours ago, tiguz said:

thx for the reply Melron. but im not sure if I understood what you mean. Can you be more detailed pls?

public void removeInfo(final L2PcInstance activeChar)
{
   _noblesRank.remove(activeChar.getObjectId());
}

I can analyze it more if you want.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.



  • Posts

    • Hello MxC! i noticed that hair style change potions  E and F on interlude are not working correct. the visual is totally missplaced or wrong. Where can i find them in patch becasue im stucked. Thanks in advance
    • Visit our website: https://smartaim.cc Reviews from real customers: https://smartaim.cc/index.php?/forum/8-csgo-cheats-reviews/ - Private Undetected League Cheat for Counter-Strike 2 (CS2) with major anti-cheat support: FACEIT, ESPORTAL, GAMERSCLUB, 5EWIN and many others! - Over two years on the market! More than 300 satisfied customers! Features Aimbot: Key Bone Smooth Field of View Recoil Control System (RCS) Friendly Fire Weapon Settings Triggerbot: Key Delay Hitgroup Weapon Settings ESP: Box Style Radius Bone Chams Health Weapon Sound Misc: Panic key (Hot key to disable the cheat during the game, suitable for LAN games or in case you need to disable the cheat for some reason) Auto accept (Automatic game acceptance in CS2 matchmaking) Radar (Opponents and teammates will be shown on the game radar) Stream Bypass (Ability to use a cheat during an online stream) Supported Anti-Cheats List VAC & MATCHMAKING [UNDETECTED] SMAC [UNDETECTED] CYBERSHOKE [UNDETECTED] ESPORTAL [UNDETECTED] GAMERSCLUB [UNDETECTED] FACEIT CLIENT [UNDETECTED] EASY ESPORTS [UNDETECTED] CEVO [UNDETECTED] 5EWIN / 5EPLAY / 5EARENA [UNDETECTED] B5CSGO [UNDETECTED] PERFECT WORLD PVP (PWA)完美世界WANMEI PVP (PWA)  [UNDETECTED] FASTCUP [UNDETECTED] MOSS [UNDETECTED] 99DAMAGE [UNDETECTED] CHALLENGEME.GG [UNDETECTED] AKROS [UNDETECTED]   Payment Methods: CRYPTO, PAYPAL, WECHAT, APPLEPAY and others.   In-game screenshots and video      
    • Like maxcheaters is a thing 🤣🥳🥳🥳
    • LF someone to add drops to mobs over lv 76 on my server, I have tried all of the "Guides" that I could find on the internet and none of them seem to work.  Obviously since this is marketplace I am willing to pay. PM me here or on Discord - offhealz
    • Scammers and liars like him won't make it far here 🙂 Good luck with getting clients. Like TrevorJ - fotis says "clowns".  
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock