diff options
author | Jesusaves <cpntb1@ymail.com> | 2023-09-08 01:27:30 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2023-09-08 01:27:30 -0300 |
commit | 6cf7cb8a324d7e06e236a81e5130d336fe3c9e8a (patch) | |
tree | f32a062fc489d627a04a2b0379a180210355ed78 | |
parent | 06b0d04f209050e620b00e6991da29006dda6bae (diff) | |
download | server-6cf7cb8a324d7e06e236a81e5130d336fe3c9e8a.tar.gz server-6cf7cb8a324d7e06e236a81e5130d336fe3c9e8a.tar.bz2 server-6cf7cb8a324d7e06e236a81e5130d336fe3c9e8a.tar.xz server-6cf7cb8a324d7e06e236a81e5130d336fe3c9e8a.zip |
It is still used as restriction for quests, however.
(You can't pick a quest with AP cost > your own AP)
-rw-r--r-- | player.py | 49 |
1 files changed, 0 insertions, 49 deletions
@@ -33,27 +33,6 @@ from threading import Timer # Internal function for ApTimer, DO NOT CAST manually # FIXME: Maybe find a better replacement for this def ap_updater(token): - global ApTimer, Player - - # TODO: What if token is no longer valid? (Maybe use queue instead?) - Player[token]["ap"]+=1 - if (Player[token]["ap"] < Player[token]["max_ap"]): - try: - ApTimer[token].cancel() - del ApTimer[token] - except: - pass - ApTimer[token]=Timer(AP_REGEN_TIME_F, ap_updater, args=[token]) - ApTimer[token].daemon=True - ApTimer[token].start() - - # Send APREFRESH packet to client - try: - usr=cli_search(Player[token]["userid"]) - usr.send_message("APREFRESH:%d" % Player[token]["ap"]) - except: - traceback.print_exc() - stdout("Unable to send AP Info for token %s" % token) return # Internal function for SQL, DO NOT CAST manually @@ -87,28 +66,6 @@ def inventoryplace(token): # Adds/Deletes AP from a user, manages the ApTimer def update_ap(token, newval): - global ApTimer, Player - - running=False - if (Player[token]["ap"] < Player[token]["max_ap"]): - running=True - - # Update AP - # TODO: Do we allow over-the-cap AP? - Player[token]["ap"]+=int(newval) - - # Handle the timer - if (not running and Player[token]["ap"] < Player[token]["max_ap"]): - ApTimer[token]=Timer(AP_REGEN_TIME_F, ap_updater, args=[token]) - ApTimer[token].daemon=True - ApTimer[token].start() - if (running and Player[token]["ap"] >= Player[token]["max_ap"]): - # If it is not running/error: We don't care (very rare error) - try: - ApTimer[token].cancel() - except: - pass - return # Function which list all unit id on party @@ -417,12 +374,6 @@ def get_data(args, token): Player[token]["ap"]=int(min(Player[token]["max_ap"], Player[token]["ap"]+delta)) Player[token]["aptime"]=now()-delta2 - # This is only to start the timer if needed - if (Player[token]["ap"] < Player[token]["max_ap"]): - ApTimer[token]=Timer(AP_REGEN_TIME_F-delta2, ap_updater, args=[token]) - ApTimer[token].daemon=True - ApTimer[token].start() - # Daily login rewards Player[token]["code"]=daily_login(token) |