Skip to content

Commit b3c9565

Browse files
committed
Fixed error when worlds had over 1k players online
- Fixes #22
1 parent 884cc9c commit b3c9565

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Changelog
66
Due to this library relying on external content, older versions are not guaranteed to work.
77
Try to always use the latest version.
88

9+
.. _v2.3.3:
10+
11+
2.3.3 (2019-11-04)
12+
==================
13+
- Fixed bug with world parsing when there are more than 1000 players online.
14+
915
.. _v2.3.2:
1016

1117
2.3.2 (2019-10-17)

tibiapy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from tibiapy.creature import *
1414
from tibiapy.client import *
1515

16-
__version__ = '2.3.2'
16+
__version__ = '2.3.3'
1717

1818
from logging import NullHandler
1919

tibiapy/world.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ListedWorld(abc.BaseWorld):
3131
The current status of the world.
3232
online_count: :class:`int`
3333
The number of currently online players in the world.
34+
3435
location: :class:`WorldLocation`
3536
The physical location of the game servers.
3637
pvp_type: :class:`PvpType`
@@ -341,7 +342,7 @@ def _parse_world_info(self, world_info_table):
341342
value = value.replace("\xa0", " ")
342343
world_info[field] = value
343344
try:
344-
self.online_count = int(world_info.pop("players_online"))
345+
self.online_count = parse_integer(world_info.pop("players_online"))
345346
except KeyError:
346347
self.online_count = 0
347348
self.location = try_enum(WorldLocation, world_info.pop("location"))
@@ -579,7 +580,7 @@ def _parse_worlds(self, world_rows):
579580
elif name == "World":
580581
continue
581582
try:
582-
online = int(cols[1].text.strip())
583+
online = parse_integer(cols[1].text.strip())
583584
except ValueError:
584585
online = 0
585586
status = "Offline"

0 commit comments

Comments
 (0)