|
14 | 14 | ColorData = namedtuple('ColorData',['a','r','g','b']) |
15 | 15 | BnetData = namedtuple('BnetData',['unknown1','unknown2','subregion','uid']) |
16 | 16 |
|
| 17 | +class DepotHash(object): |
| 18 | + url_template = 'http://{0}.depot.battle.net:1119/{1}.{2}' |
| 19 | + |
| 20 | + def __init__(self, bytes): |
| 21 | + self.server = bytes[4:8].strip('\x00 ') |
| 22 | + self.hash = bytes[8:].encode('hex') |
| 23 | + self.type = bytes[0:4] |
| 24 | + |
| 25 | + def __str__(self): |
| 26 | + return self.url_template.format(self.server, self.hash, self.type) |
| 27 | + |
| 28 | + |
17 | 29 | class Team(object): |
18 | 30 | """ |
19 | 31 | The team object primarily a container object for organizing :class:`Player` |
@@ -228,22 +240,6 @@ def __repr__(self): |
228 | 240 |
|
229 | 241 |
|
230 | 242 | class PlayerSummary(): |
231 | | - """ |
232 | | - A class to represent a player in the game summary (.s2gs) |
233 | | - """ |
234 | | - stats_pretty_names = { |
235 | | - 'R' : 'Resources', |
236 | | - 'U' : 'Units', |
237 | | - 'S' : 'Structures', |
238 | | - 'O' : 'Overview', |
239 | | - 'AUR' : 'Average Unspent Resources', |
240 | | - 'RCR' : 'Resource Collection Rate', |
241 | | - 'WC' : 'Workers Created', |
242 | | - 'UT' : 'Units Trained', |
243 | | - 'KUC' : 'Killed Unit Count', |
244 | | - 'SB' : 'Structures Built', |
245 | | - 'SRC' : 'Structures Razed Count' |
246 | | - } |
247 | 243 |
|
248 | 244 | #: The index of the player in the game |
249 | 245 | pid = int() |
@@ -283,8 +279,6 @@ class PlayerSummary(): |
283 | 279 |
|
284 | 280 | def __init__(self, pid): |
285 | 281 | self.unknown2 = dict() |
286 | | - self.stats = dict() |
287 | | - |
288 | 282 | self.pid = pid |
289 | 283 |
|
290 | 284 | def __str__(self): |
|
0 commit comments