147 Commits

Author SHA1 Message Date
Eriks Karls
dd2c20cc41 no message 2020-02-26 12:09:45 +02:00
Eriks Karls
b76ea2c4ae Medal notifications 2020-02-26 12:09:36 +02:00
Eriks Karls
b7211b7c75 Notification parsing and deleting 2020-02-26 12:09:03 +02:00
Eriks Karls
07ba1795d3 WIP: Splitting Citizen class into logical pieces for encapsulation, modularity and easier maintenance 2020-02-24 17:20:16 +02:00
Eriks Karls
fd1880c50f Some notifications are still being displayed the old way 2020-02-19 18:52:40 +02:00
Eriks Karls
f6433908b4 New notifications API 2020-02-18 20:11:34 +02:00
Eriks Karls
5c258d7aae Hey Plato! If You're reading this - fix your variable types and there will be 90% less bugs in Your code!!!
{'weaponId': 6, 'weaponQuantity': 0, 'damage': 120}
{'weaponId': '7', 'weaponQuantity': 1185, 'inClip': 7, 'damage': 200}
{'weaponId': 10, 'weaponQuantity': 0, 'damage': 100}
2020-01-26 20:44:21 +02:00
Eriks Karls
0dd1ae9ac5 Too broad exception was cought without notifying about actual error - when Telegram isn't enabled 2020-01-14 13:42:34 +02:00
Eriks Karls
15e6deebda Battle initialization without valid data should be avoided to not run into strange and hard to trace bugs.
Jsonification updates - if simplejson is available some packages are importing simplejson with try-except and later throwing simplejson errors which should be cought when calling .json() on every request.
Fixed error logging
2020-01-13 21:33:50 +02:00
Eriks Karls
9c64bfac0f Merge branch 'inventory_updates'
* inventory_updates:
  Python 3.8, isort, requirement update
  Representation of Citizen class
  Created method for current products on sale. Updated inventory to also include products on sale

# Conflicts:
#	erepublik/citizen.py
2020-01-13 10:31:05 +02:00
Eriks Karls
1f07f2e270 Update:
Citizen.set_default_weapon() - eRepublik should return list with all available weapon qualities, but when a battle is just launched, they return only dict with barehands
Citizen.fight() - no longer calls self.set_default_weapon()
Citizen.find_battle_and_fight() - now calls self.set_default_weapon() just before fighting
Citizen.update_war_info() - returns previous battle list if responses 'last_updated' isn't more than 30s old

New:
Citizen.get_battle_for_war(war_id) - returns Battle instance for specific war, if battle is active for given war
2020-01-13 10:28:42 +02:00
Eriks Karls
71d204843d Python 3.8, isort, requirement update 2020-01-09 12:03:11 +02:00
Eriks Karls
d9305214eb Representation of Citizen class 2020-01-07 19:55:31 +02:00
Eriks Karls
5556d5f772 Created method for current products on sale. Updated inventory to also include products on sale 2020-01-07 16:28:42 +02:00
Eriks Karls
bedaeeefd1 Battle division update 2020-01-07 11:15:40 +02:00
Eriks Karls
a2447959e7 fight must receive battle id as int, added warnings support 2020-01-05 10:53:26 +02:00
Eriks Karls
3599dc40fc More logging, Citizen.get_raw_surplus() fixed and moved to Citizen.my_companies.get_wam_raw_usage() 2020-01-02 22:42:40 +02:00
Eriks Karls
6ba727a781 promo spam loop 2020-01-02 18:49:38 +02:00
Eriks Karls
e374aa8a54 Implemented division switching,
improved multi bomb deploy with auto traveling,
Citizen.fight() simplified battle data gathering logic -> Citizen.shoot logic improved
Citizen.all_battles are now defaultdict with default value of empty/invalid battle, for times when trying to do things with battle which is not in all_battle dict
2019-12-18 16:25:52 +02:00
Eriks Karls
12aee23739 Variable and method redeclaration 2019-12-18 11:44:18 +02:00
Eriks Karls
39093accd0 Type hinting. Class parameter defined lists where shared accross instances. 2019-12-13 19:30:43 +02:00
Eriks Karls
aba8c15fd3 AutoPost medals 2019-12-03 15:22:35 +02:00
Eriks Karls
f294506a2d Updated wars list, added default weapon choosing (q7 - ground, bare hands - air) 2019-12-03 09:52:53 +02:00
Eriks Karls
fd56c6c389 By default sort battles by time 2019-12-03 09:44:14 +02:00
Eriks Karls
4f613ee5ac remvoed unused variables 2019-12-03 09:43:55 +02:00
Eriks Karls
a7dd528597 Citizen get() and post() signature update, check if server isn't compaining about request flooding 2019-12-03 09:42:51 +02:00
Eriks Karls
90bec82630 12th anniversary minimal methods 2019-11-21 11:06:29 +02:00
Eriks Karls
66f459c692 Inventory structure update 2019-10-30 19:42:05 +02:00
Eriks Karls
ef27960ff1 no message 2019-10-30 19:35:40 +02:00
Eriks Karls
c48af9a891 Thread stopping 2019-10-30 18:16:18 +02:00
Eriks Karls
e060f67666 More inventory structure updates 2019-10-29 16:06:07 +02:00
Eriks Karls
06d8d1c0b5 Telegram threading queue has been messing with error reporting 2019-10-29 16:05:22 +02:00
Eriks Karls
adda8dcb54 Structure requests by year/month/date folders, to keep requests in cleaner format.
The same medal kind (Maverick div BHs) can have different reward value - group them by kind-reward.
Citizen.post bugfix (with no data and json arguments) TODO: Must check where post is called without data or json
2019-10-28 14:17:45 +02:00
Eriks Karls
c7f084436d Inventory structure update 2019-10-18 18:18:39 +03:00
Eriks Karls
3d895bd085 Damage calculation 2019-10-16 15:09:28 +03:00
Eriks Karls
b1eefcc662 CSRF Attack Detecked loop on POST requests. 2019-10-15 20:03:22 +03:00
Eriks Karls
41798c446c Return successfully transfered item count 2019-10-15 11:28:56 +03:00
Eriks Karls
074da3adbe Telegram reporter queue bug 2019-10-14 19:21:00 +03:00
Eriks Karls
ffa2fc109c Travel for fighting fixed 2019-10-14 13:14:30 +03:00
Eriks Karls
f7f4028f32 Revert "Travel for fighting"
This reverts commit 07c88810923b7051e997db746076a9e18656c0f5.
2019-10-14 13:03:36 +03:00
Eriks Karls
e91705ce90 no message 2019-10-14 13:03:19 +03:00
Eriks Karls
ca65a1ffe1 iPython indexer infinite loop and crash 2019-10-14 12:54:59 +03:00
Eriks Karls
07c8881092 Travel for fighting 2019-10-13 23:50:45 +03:00
Eriks Karls
25e534f783 Always print should_fight message 2019-10-08 09:32:00 +03:00
Eriks Karls
daa071f0f5 RTD build image url fixed, setup.py typo 2019-10-08 09:31:09 +03:00
Eriks Karls
6b2c073abe Damage booster activisation update and bugfix 2019-10-01 09:59:22 +03:00
Eriks Karls
c298d66086 Don't allow to fight before WeekChange even if force_fight (levelup, 75pp etc) 2019-10-01 09:58:37 +03:00
Eriks Karls
fe9a118875 Telegram loop traceback formatting
Fixed double code execution in Citizen.update_citizen_info(None) calling Citizen.update_citizen_info(html) and executing code twice.
2019-09-29 09:40:25 +03:00
Eriks Karls
17c73c79a7 Trying to find how and where Telegram spam happens 2019-09-28 16:03:31 +03:00
Eriks Karls
71a7f55338 Changes in eRepublik html 2019-09-27 11:50:51 +03:00