mc5-api-client 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mc5_api_client/client.py +513 -0
- {mc5_api_client-1.0.1.dist-info → mc5_api_client-1.0.3.dist-info}/METADATA +93 -52
- {mc5_api_client-1.0.1.dist-info → mc5_api_client-1.0.3.dist-info}/RECORD +7 -7
- {mc5_api_client-1.0.1.dist-info → mc5_api_client-1.0.3.dist-info}/LICENSE +0 -0
- {mc5_api_client-1.0.1.dist-info → mc5_api_client-1.0.3.dist-info}/WHEEL +0 -0
- {mc5_api_client-1.0.1.dist-info → mc5_api_client-1.0.3.dist-info}/entry_points.txt +0 -0
- {mc5_api_client-1.0.1.dist-info → mc5_api_client-1.0.3.dist-info}/top_level.txt +0 -0
mc5_api_client/client.py
CHANGED
|
@@ -1211,6 +1211,519 @@ class MC5Client:
|
|
|
1211
1211
|
if self.token_generator:
|
|
1212
1212
|
self.token_generator.close()
|
|
1213
1213
|
|
|
1214
|
+
# Events API
|
|
1215
|
+
|
|
1216
|
+
def get_events(self, event_type: str = None, status: str = None) -> List[Dict[str, Any]]:
|
|
1217
|
+
"""
|
|
1218
|
+
Fetch all active and upcoming game events.
|
|
1219
|
+
|
|
1220
|
+
Args:
|
|
1221
|
+
event_type: Filter by event type (e.g., "sem_1875", "mc5_activities_event")
|
|
1222
|
+
status: Filter by status ("active", "ended", "upcoming")
|
|
1223
|
+
|
|
1224
|
+
Returns:
|
|
1225
|
+
List of event objects with detailed information
|
|
1226
|
+
"""
|
|
1227
|
+
url = f"{self.BASE_URLS['osiris']}/events"
|
|
1228
|
+
params = {}
|
|
1229
|
+
|
|
1230
|
+
if event_type:
|
|
1231
|
+
params['category'] = event_type
|
|
1232
|
+
if status:
|
|
1233
|
+
params['status'] = status
|
|
1234
|
+
|
|
1235
|
+
events = self._make_request("GET", url, params=params)
|
|
1236
|
+
return events if isinstance(events, list) else []
|
|
1237
|
+
|
|
1238
|
+
def get_event_details(self, event_name: str) -> Dict[str, Any]:
|
|
1239
|
+
"""
|
|
1240
|
+
Get detailed information about a specific event including tasks and milestones.
|
|
1241
|
+
|
|
1242
|
+
Args:
|
|
1243
|
+
event_name: The name/identifier of the event
|
|
1244
|
+
|
|
1245
|
+
Returns:
|
|
1246
|
+
Detailed event information with parsed tasks and milestones
|
|
1247
|
+
"""
|
|
1248
|
+
events = self.get_events()
|
|
1249
|
+
for event in events:
|
|
1250
|
+
if isinstance(event, dict) and event.get('name') == event_name:
|
|
1251
|
+
return self._parse_event_template(event)
|
|
1252
|
+
return {}
|
|
1253
|
+
|
|
1254
|
+
def _parse_event_template(self, event: Dict[str, Any]) -> Dict[str, Any]:
|
|
1255
|
+
"""
|
|
1256
|
+
Parse event template to extract tasks and milestones information.
|
|
1257
|
+
|
|
1258
|
+
Args:
|
|
1259
|
+
event: Raw event data from API
|
|
1260
|
+
|
|
1261
|
+
Returns:
|
|
1262
|
+
Parsed event with structured tasks and milestones
|
|
1263
|
+
"""
|
|
1264
|
+
parsed_event = {
|
|
1265
|
+
'name': event.get('name'),
|
|
1266
|
+
'category': event.get('category'),
|
|
1267
|
+
'description': event.get('description'),
|
|
1268
|
+
'start_date': event.get('start_date'),
|
|
1269
|
+
'end_date': event.get('end_date'),
|
|
1270
|
+
'status': event.get('status'),
|
|
1271
|
+
'tasks': [],
|
|
1272
|
+
'milestones': [],
|
|
1273
|
+
'tournament_info': None
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
template = event.get('_template', {})
|
|
1277
|
+
if template:
|
|
1278
|
+
tuning = template.get('event_tuning', {})
|
|
1279
|
+
|
|
1280
|
+
# Parse tasks
|
|
1281
|
+
tasks_data = tuning.get('_tasks', {}).get('value', [])
|
|
1282
|
+
for task in tasks_data:
|
|
1283
|
+
parsed_task = {
|
|
1284
|
+
'milestone_id': task.get('_milestone_id'),
|
|
1285
|
+
'points': task.get('points', 0),
|
|
1286
|
+
'condition': task.get('condition', {}),
|
|
1287
|
+
'award': task.get('award', {}),
|
|
1288
|
+
'condition_type': self._extract_condition_type(task.get('condition', {})),
|
|
1289
|
+
'reward': self._extract_reward(task.get('award', {}))
|
|
1290
|
+
}
|
|
1291
|
+
parsed_event['tasks'].append(parsed_task)
|
|
1292
|
+
|
|
1293
|
+
# Parse milestones
|
|
1294
|
+
milestones_data = tuning.get('milestones', {}).get('value', [])
|
|
1295
|
+
for milestone in milestones_data:
|
|
1296
|
+
parsed_milestone = {
|
|
1297
|
+
'milestone_id': milestone.get('_milestone_id'),
|
|
1298
|
+
'condition': milestone.get('condition', 0),
|
|
1299
|
+
'award': milestone.get('award', {}),
|
|
1300
|
+
'reward': self._extract_reward(milestone.get('award', {}))
|
|
1301
|
+
}
|
|
1302
|
+
parsed_event['milestones'].append(parsed_milestone)
|
|
1303
|
+
|
|
1304
|
+
# Parse tournament info if present
|
|
1305
|
+
tournament = template.get('tournament', {})
|
|
1306
|
+
if tournament:
|
|
1307
|
+
parsed_event['tournament_info'] = {
|
|
1308
|
+
'type': tournament.get('type'),
|
|
1309
|
+
'leaderboard': tournament.get('leaderboard', {}),
|
|
1310
|
+
'awards': tournament.get('awards', [])
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
return parsed_event
|
|
1314
|
+
|
|
1315
|
+
def _extract_condition_type(self, condition: Dict[str, Any]) -> str:
|
|
1316
|
+
"""
|
|
1317
|
+
Extract the condition type from task condition data.
|
|
1318
|
+
|
|
1319
|
+
Args:
|
|
1320
|
+
condition: Condition data from task
|
|
1321
|
+
|
|
1322
|
+
Returns:
|
|
1323
|
+
String representing the condition type
|
|
1324
|
+
"""
|
|
1325
|
+
if not condition or 'value' not in condition:
|
|
1326
|
+
return 'unknown'
|
|
1327
|
+
|
|
1328
|
+
value = condition['value']
|
|
1329
|
+
if isinstance(value, dict):
|
|
1330
|
+
# Extract the first key which represents the condition type
|
|
1331
|
+
return list(value.keys())[0] if value else 'unknown'
|
|
1332
|
+
|
|
1333
|
+
return str(value)
|
|
1334
|
+
|
|
1335
|
+
def _extract_reward(self, award: Dict[str, Any]) -> Dict[str, Any]:
|
|
1336
|
+
"""
|
|
1337
|
+
Extract reward information from award data.
|
|
1338
|
+
|
|
1339
|
+
Args:
|
|
1340
|
+
award: Award data from task or milestone
|
|
1341
|
+
|
|
1342
|
+
Returns:
|
|
1343
|
+
Structured reward information
|
|
1344
|
+
"""
|
|
1345
|
+
reward = {'type': 'unknown', 'items': []}
|
|
1346
|
+
|
|
1347
|
+
if not award or 'value' not in award:
|
|
1348
|
+
return reward
|
|
1349
|
+
|
|
1350
|
+
award_value = award['value']
|
|
1351
|
+
if isinstance(award_value, list):
|
|
1352
|
+
for item in award_value:
|
|
1353
|
+
if isinstance(item, dict) and 'value' in item:
|
|
1354
|
+
for reward_type, reward_data in item['value'].items():
|
|
1355
|
+
reward['items'].append({
|
|
1356
|
+
'type': reward_type,
|
|
1357
|
+
'amount': reward_data.get('value', 0) if isinstance(reward_data, dict) else reward_data
|
|
1358
|
+
})
|
|
1359
|
+
reward['type'] = 'items'
|
|
1360
|
+
|
|
1361
|
+
return reward
|
|
1362
|
+
|
|
1363
|
+
def get_daily_tasks(self) -> Dict[str, Any]:
|
|
1364
|
+
"""
|
|
1365
|
+
Get current daily tasks with progress and rewards.
|
|
1366
|
+
|
|
1367
|
+
Returns:
|
|
1368
|
+
Daily tasks event information with parsed tasks and milestones
|
|
1369
|
+
"""
|
|
1370
|
+
events = self.get_events(event_type="mc5_activities_event")
|
|
1371
|
+
for event in events:
|
|
1372
|
+
if 'daily' in event.get('name', '').lower() or 'activities' in event.get('name', '').lower():
|
|
1373
|
+
return self._parse_event_template(event)
|
|
1374
|
+
return {}
|
|
1375
|
+
|
|
1376
|
+
def get_squad_events(self) -> List[Dict[str, Any]]:
|
|
1377
|
+
"""
|
|
1378
|
+
Get all squad/team events.
|
|
1379
|
+
|
|
1380
|
+
Returns:
|
|
1381
|
+
List of squad events with detailed information
|
|
1382
|
+
"""
|
|
1383
|
+
events = self.get_events(event_type="sem_1875")
|
|
1384
|
+
squad_events = []
|
|
1385
|
+
|
|
1386
|
+
for event in events:
|
|
1387
|
+
parsed_event = self._parse_event_template(event)
|
|
1388
|
+
squad_events.append(parsed_event)
|
|
1389
|
+
|
|
1390
|
+
return squad_events
|
|
1391
|
+
|
|
1392
|
+
def get_event_progress(self, event_name: str) -> Dict[str, Any]:
|
|
1393
|
+
"""
|
|
1394
|
+
Get current progress for a specific event (if available).
|
|
1395
|
+
|
|
1396
|
+
Args:
|
|
1397
|
+
event_name: The name/identifier of the event
|
|
1398
|
+
|
|
1399
|
+
Returns:
|
|
1400
|
+
Event progress information
|
|
1401
|
+
"""
|
|
1402
|
+
# This would typically require a different endpoint for user progress
|
|
1403
|
+
# For now, return the event details as a base
|
|
1404
|
+
return self.get_event_details(event_name)
|
|
1405
|
+
|
|
1406
|
+
def calculate_event_rewards(self, event_name: str, current_points: int = 0) -> Dict[str, Any]:
|
|
1407
|
+
"""
|
|
1408
|
+
Calculate potential rewards for an event based on current points.
|
|
1409
|
+
|
|
1410
|
+
Args:
|
|
1411
|
+
event_name: The name/identifier of the event
|
|
1412
|
+
current_points: Current points earned by the player
|
|
1413
|
+
|
|
1414
|
+
Returns:
|
|
1415
|
+
Available milestones and rewards
|
|
1416
|
+
"""
|
|
1417
|
+
event_details = self.get_event_details(event_name)
|
|
1418
|
+
if not event_details:
|
|
1419
|
+
return {}
|
|
1420
|
+
|
|
1421
|
+
available_milestones = []
|
|
1422
|
+
total_rewards = {'type': 'items', 'items': []}
|
|
1423
|
+
|
|
1424
|
+
for milestone in event_details.get('milestones', []):
|
|
1425
|
+
if current_points >= milestone['condition']:
|
|
1426
|
+
# Milestone is available
|
|
1427
|
+
available_milestones.append(milestone)
|
|
1428
|
+
# Add milestone rewards to total
|
|
1429
|
+
if milestone.get('reward', {}).get('items'):
|
|
1430
|
+
total_rewards['items'].extend(milestone['reward']['items'])
|
|
1431
|
+
|
|
1432
|
+
return {
|
|
1433
|
+
'event_name': event_name,
|
|
1434
|
+
'current_points': current_points,
|
|
1435
|
+
'available_milestones': available_milestones,
|
|
1436
|
+
'total_rewards': total_rewards,
|
|
1437
|
+
'next_milestone': self._get_next_milestone(event_details, current_points)
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
def _get_next_milestone(self, event_details: Dict[str, Any], current_points: int) -> Dict[str, Any]:
|
|
1441
|
+
"""
|
|
1442
|
+
Get the next milestone the player can achieve.
|
|
1443
|
+
|
|
1444
|
+
Args:
|
|
1445
|
+
event_details: Parsed event details
|
|
1446
|
+
current_points: Current points earned
|
|
1447
|
+
|
|
1448
|
+
Returns:
|
|
1449
|
+
Next milestone information or empty dict if none available
|
|
1450
|
+
"""
|
|
1451
|
+
milestones = sorted(event_details.get('milestones', []), key=lambda x: x.get('condition', 0))
|
|
1452
|
+
|
|
1453
|
+
for milestone in milestones:
|
|
1454
|
+
if current_points < milestone.get('condition', 0):
|
|
1455
|
+
return milestone
|
|
1456
|
+
|
|
1457
|
+
return {}
|
|
1458
|
+
|
|
1459
|
+
# Account Management
|
|
1460
|
+
|
|
1461
|
+
def import_account_data(self, from_credential: str, secret: str, platform: str = "windows", account_data: Dict[str, Any] = None) -> Dict[str, Any]:
|
|
1462
|
+
"""
|
|
1463
|
+
Import account data from another platform or backup.
|
|
1464
|
+
|
|
1465
|
+
Args:
|
|
1466
|
+
from_credential: Source platform credential (e.g., "microsoftgraph:..." or "anonymous:...")
|
|
1467
|
+
secret: Encrypted verification secret
|
|
1468
|
+
platform: Target platform (default: "windows")
|
|
1469
|
+
account_data: Platform-specific account data (optional)
|
|
1470
|
+
|
|
1471
|
+
Returns:
|
|
1472
|
+
Import result with status and details
|
|
1473
|
+
"""
|
|
1474
|
+
url = f"{self.BASE_URLS['osiris']}/accounts/me/import"
|
|
1475
|
+
params = {
|
|
1476
|
+
"from_credential": from_credential,
|
|
1477
|
+
"secret": secret
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
data = {}
|
|
1481
|
+
if platform:
|
|
1482
|
+
data["platform"] = platform
|
|
1483
|
+
if account_data:
|
|
1484
|
+
data["data"] = account_data
|
|
1485
|
+
|
|
1486
|
+
return self._make_request("POST", url, params=params, data=data)
|
|
1487
|
+
|
|
1488
|
+
def link_account(self, target_credential: str, platform: str = "windows") -> Dict[str, Any]:
|
|
1489
|
+
"""
|
|
1490
|
+
Link current account with another platform account.
|
|
1491
|
+
|
|
1492
|
+
Args:
|
|
1493
|
+
target_credential: Target platform credential to link
|
|
1494
|
+
platform: Target platform (default: "windows")
|
|
1495
|
+
|
|
1496
|
+
Returns:
|
|
1497
|
+
Account linking result
|
|
1498
|
+
"""
|
|
1499
|
+
# This would typically use a specific account linking endpoint
|
|
1500
|
+
# For now, using import as a base implementation
|
|
1501
|
+
return self.import_account_data(
|
|
1502
|
+
from_credential=target_credential,
|
|
1503
|
+
secret="", # Would need proper secret generation
|
|
1504
|
+
platform=platform
|
|
1505
|
+
)
|
|
1506
|
+
|
|
1507
|
+
def get_account_info(self, credential: str = None) -> Dict[str, Any]:
|
|
1508
|
+
"""
|
|
1509
|
+
Get detailed account information including linked platforms.
|
|
1510
|
+
|
|
1511
|
+
Args:
|
|
1512
|
+
credential: Specific credential to query (optional, uses current account if not provided)
|
|
1513
|
+
|
|
1514
|
+
Returns:
|
|
1515
|
+
Account information with platform details
|
|
1516
|
+
"""
|
|
1517
|
+
# This would typically use a specific account info endpoint
|
|
1518
|
+
# For now, returning profile as base information
|
|
1519
|
+
return self.get_profile()
|
|
1520
|
+
|
|
1521
|
+
def unlink_account(self, platform_credential: str) -> Dict[str, Any]:
|
|
1522
|
+
"""
|
|
1523
|
+
Unlink a previously linked platform account.
|
|
1524
|
+
|
|
1525
|
+
Args:
|
|
1526
|
+
platform_credential: Platform credential to unlink
|
|
1527
|
+
|
|
1528
|
+
Returns:
|
|
1529
|
+
Unlink result
|
|
1530
|
+
"""
|
|
1531
|
+
# This would typically use a specific unlink endpoint
|
|
1532
|
+
# For now, returning a placeholder response
|
|
1533
|
+
return {
|
|
1534
|
+
"status": "success",
|
|
1535
|
+
"message": "Account unlink functionality requires specific endpoint implementation",
|
|
1536
|
+
"unlinked_credential": platform_credential
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
def migrate_account_data(self, from_platform: str, to_platform: str, include_data: List[str] = None) -> Dict[str, Any]:
|
|
1540
|
+
"""
|
|
1541
|
+
Migrate account data between platforms.
|
|
1542
|
+
|
|
1543
|
+
Args:
|
|
1544
|
+
from_platform: Source platform
|
|
1545
|
+
to_platform: Target platform
|
|
1546
|
+
include_data: List of data types to include (e.g., ["profile", "inventory", "progress"])
|
|
1547
|
+
|
|
1548
|
+
Returns:
|
|
1549
|
+
Migration result with status and details
|
|
1550
|
+
"""
|
|
1551
|
+
if include_data is None:
|
|
1552
|
+
include_data = ["profile", "inventory", "progress"]
|
|
1553
|
+
|
|
1554
|
+
# This would typically use a specific migration endpoint
|
|
1555
|
+
# For now, returning a placeholder response
|
|
1556
|
+
return {
|
|
1557
|
+
"status": "success",
|
|
1558
|
+
"message": "Account migration functionality requires specific endpoint implementation",
|
|
1559
|
+
"from_platform": from_platform,
|
|
1560
|
+
"to_platform": to_platform,
|
|
1561
|
+
"included_data": include_data
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
# Alias/Dogtags System
|
|
1565
|
+
|
|
1566
|
+
def convert_dogtag_to_alias(self, dogtag: str) -> str:
|
|
1567
|
+
"""
|
|
1568
|
+
Convert a dogtag (player ID) to alias format.
|
|
1569
|
+
|
|
1570
|
+
Args:
|
|
1571
|
+
dogtag: Dogtag in XXXX format (hexadecimal)
|
|
1572
|
+
|
|
1573
|
+
Returns:
|
|
1574
|
+
Alias string
|
|
1575
|
+
"""
|
|
1576
|
+
if not dogtag or len(dogtag) != 4:
|
|
1577
|
+
return dogtag
|
|
1578
|
+
|
|
1579
|
+
alias = ""
|
|
1580
|
+
for char in dogtag.lower():
|
|
1581
|
+
if char.isdigit():
|
|
1582
|
+
# Digit: subtract 2 using modulo 10 arithmetic
|
|
1583
|
+
digit = int(char)
|
|
1584
|
+
new_digit = (digit - 2) % 10
|
|
1585
|
+
alias += str(new_digit)
|
|
1586
|
+
elif char.isalpha():
|
|
1587
|
+
# Letter: subtract 2 from ASCII value
|
|
1588
|
+
new_char = chr(ord(char) - 2)
|
|
1589
|
+
alias += new_char
|
|
1590
|
+
else:
|
|
1591
|
+
alias += char
|
|
1592
|
+
|
|
1593
|
+
return alias
|
|
1594
|
+
|
|
1595
|
+
def convert_alias_to_dogtag(self, alias: str) -> str:
|
|
1596
|
+
"""
|
|
1597
|
+
Convert an alias back to dogtag format.
|
|
1598
|
+
|
|
1599
|
+
Args:
|
|
1600
|
+
alias: Alias string
|
|
1601
|
+
|
|
1602
|
+
Returns:
|
|
1603
|
+
Dogtag in XXXX format
|
|
1604
|
+
"""
|
|
1605
|
+
if not alias or len(alias) != 4:
|
|
1606
|
+
return alias
|
|
1607
|
+
|
|
1608
|
+
dogtag = ""
|
|
1609
|
+
for char in alias.lower():
|
|
1610
|
+
if char.isdigit():
|
|
1611
|
+
# Digit: add 2 using modulo 10 arithmetic
|
|
1612
|
+
digit = int(char)
|
|
1613
|
+
new_digit = (digit + 2) % 10
|
|
1614
|
+
dogtag += str(new_digit)
|
|
1615
|
+
elif char.isalpha():
|
|
1616
|
+
# Letter: add 2 to ASCII value
|
|
1617
|
+
new_char = chr(ord(char) + 2)
|
|
1618
|
+
dogtag += new_char
|
|
1619
|
+
else:
|
|
1620
|
+
dogtag += char
|
|
1621
|
+
|
|
1622
|
+
return dogtag
|
|
1623
|
+
|
|
1624
|
+
def get_alias_info(self, alias_id: str) -> Dict[str, Any]:
|
|
1625
|
+
"""
|
|
1626
|
+
Retrieve player information using alias/dogtag.
|
|
1627
|
+
|
|
1628
|
+
Args:
|
|
1629
|
+
alias_id: Player's alias (e.g., "d33d") or dogtag
|
|
1630
|
+
|
|
1631
|
+
Returns:
|
|
1632
|
+
Player account information
|
|
1633
|
+
"""
|
|
1634
|
+
# Convert to alias if it's a dogtag
|
|
1635
|
+
if len(alias_id) == 4 and all(c in '0123456789abcdefABCDEF' for c in alias_id):
|
|
1636
|
+
alias_id = self.convert_dogtag_to_alias(alias_id)
|
|
1637
|
+
|
|
1638
|
+
url = f"{self.BASE_URLS['janus']}/games/mygame/alias/{alias_id}"
|
|
1639
|
+
return self._make_request("GET", url)
|
|
1640
|
+
|
|
1641
|
+
def search_player_by_alias(self, alias: str) -> Dict[str, Any]:
|
|
1642
|
+
"""
|
|
1643
|
+
Search for a player by their alias.
|
|
1644
|
+
|
|
1645
|
+
Args:
|
|
1646
|
+
alias: Player alias to search for
|
|
1647
|
+
|
|
1648
|
+
Returns:
|
|
1649
|
+
Player information if found
|
|
1650
|
+
"""
|
|
1651
|
+
return self.get_alias_info(alias)
|
|
1652
|
+
|
|
1653
|
+
# Game Configuration
|
|
1654
|
+
|
|
1655
|
+
def get_asset_metadata(self, asset_path: str) -> Dict[str, Any]:
|
|
1656
|
+
"""
|
|
1657
|
+
Get hash metadata for specific game assets.
|
|
1658
|
+
|
|
1659
|
+
Args:
|
|
1660
|
+
asset_path: Asset path (e.g., "videos_HD_UPD18_pvx")
|
|
1661
|
+
|
|
1662
|
+
Returns:
|
|
1663
|
+
Asset metadata including hash
|
|
1664
|
+
"""
|
|
1665
|
+
url = f"{self.BASE_URLS['iris']}/assets/{self.client_id}/{asset_path}/metadata/hash"
|
|
1666
|
+
return self._make_request("GET", url)
|
|
1667
|
+
|
|
1668
|
+
def get_game_object_catalog(self) -> List[Dict[str, Any]]:
|
|
1669
|
+
"""
|
|
1670
|
+
Get the catalog of in-game objects (currencies, weapons, items, etc.).
|
|
1671
|
+
|
|
1672
|
+
Returns:
|
|
1673
|
+
List of game objects with detailed information
|
|
1674
|
+
"""
|
|
1675
|
+
# This would typically use a dynamic URL with timestamp
|
|
1676
|
+
# For now, using a placeholder URL
|
|
1677
|
+
import time
|
|
1678
|
+
url = f"https://iris16-gold.gameloft.com/game_object_{int(time.time())}"
|
|
1679
|
+
try:
|
|
1680
|
+
return self._make_request("GET", url)
|
|
1681
|
+
except:
|
|
1682
|
+
# Fallback to basic catalog if dynamic URL fails
|
|
1683
|
+
return []
|
|
1684
|
+
|
|
1685
|
+
def get_service_urls(self) -> Dict[str, str]:
|
|
1686
|
+
"""
|
|
1687
|
+
Get service URLs for the current region and client.
|
|
1688
|
+
|
|
1689
|
+
Returns:
|
|
1690
|
+
Dictionary of service URLs
|
|
1691
|
+
"""
|
|
1692
|
+
url = f"https://eve.gameloft.com/config/{self.client_id}/datacenters/eur/urls"
|
|
1693
|
+
try:
|
|
1694
|
+
return self._make_request("GET", url)
|
|
1695
|
+
except:
|
|
1696
|
+
# Return default URLs if endpoint fails
|
|
1697
|
+
return {
|
|
1698
|
+
"osiris": "https://eur-osiris.gameloft.com",
|
|
1699
|
+
"janus": "https://eur-janus.gameloft.com",
|
|
1700
|
+
"iris": "https://eur-iris.gameloft.com",
|
|
1701
|
+
"hermes": "https://eur-hermes.gameloft.com"
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
def get_game_config(self, config_type: str = "basic") -> Dict[str, Any]:
|
|
1705
|
+
"""
|
|
1706
|
+
Get game configuration data.
|
|
1707
|
+
|
|
1708
|
+
Args:
|
|
1709
|
+
config_type: Type of configuration to retrieve ("basic", "advanced", "all")
|
|
1710
|
+
|
|
1711
|
+
Returns:
|
|
1712
|
+
Game configuration data
|
|
1713
|
+
"""
|
|
1714
|
+
config_data = {
|
|
1715
|
+
"service_urls": self.get_service_urls(),
|
|
1716
|
+
"client_id": self.client_id
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
if config_type in ["advanced", "all"]:
|
|
1720
|
+
config_data["game_objects"] = self.get_game_object_catalog()
|
|
1721
|
+
|
|
1722
|
+
if config_type == "all":
|
|
1723
|
+
config_data["asset_metadata"] = "Use get_asset_metadata() for specific assets"
|
|
1724
|
+
|
|
1725
|
+
return config_data
|
|
1726
|
+
|
|
1214
1727
|
def __enter__(self):
|
|
1215
1728
|
"""Context manager entry."""
|
|
1216
1729
|
return self
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mc5-api-client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: A comprehensive Python library for interacting with the Modern Combat 5 API
|
|
5
5
|
Home-page: https://pypi.org/project/mc5-api-client/
|
|
6
6
|
Author: Chizoba
|
|
@@ -104,12 +104,14 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
104
104
|
|
|
105
105
|
## � Installation & Publishing
|
|
106
106
|
|
|
107
|
-
### 🚀 Install from PyPI
|
|
107
|
+
### 🚀 Install from PyPI
|
|
108
108
|
|
|
109
109
|
```bash
|
|
110
|
-
pip install
|
|
110
|
+
pip install mc5_api_client
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
+
✅ **Published and Available!** The MC5 API Client is now live on PyPI and ready for worldwide use!
|
|
114
|
+
|
|
113
115
|
### 📦 Install from Local Package
|
|
114
116
|
|
|
115
117
|
```bash
|
|
@@ -121,62 +123,57 @@ cd mc5-api-client-1.0.0
|
|
|
121
123
|
pip install .
|
|
122
124
|
```
|
|
123
125
|
|
|
124
|
-
### 📤 Publishing
|
|
125
|
-
|
|
126
|
-
The package has been successfully built! You now have:
|
|
126
|
+
### 📤 Publishing Status
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
✅ **Wheel Distribution**: `dist/mc5_api_client-1.0.0-py3-none-any.whl`
|
|
128
|
+
🎉 **Successfully Published!** The package is now available on PyPI:
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
✅ **Package Name**: `mc5_api_client`
|
|
131
|
+
✅ **Version**: `1.0.1`
|
|
132
|
+
✅ **PyPI URL**: https://pypi.org/project/mc5_api_client/
|
|
133
|
+
✅ **Installation**: `pip install mc5_api_client`
|
|
134
|
+
✅ **CLI Command**: `mc5 --help`
|
|
132
135
|
|
|
133
|
-
|
|
134
|
-
# Install twine if you haven't already
|
|
135
|
-
pip install twine
|
|
136
|
+
### 📦 Package Files
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
# Or upload to Test PyPI first
|
|
141
|
-
twine upload --repository testpypi dist/*
|
|
142
|
-
```
|
|
138
|
+
✅ **Source Distribution**: `dist/mc5_api_client-1.0.1.tar.gz`
|
|
139
|
+
✅ **Wheel Distribution**: `dist/mc5_api_client-1.0.1-py3-none-any.whl`
|
|
143
140
|
|
|
144
141
|
### 🔧 Build Status
|
|
145
142
|
|
|
146
|
-
✅ **Compilation Successful** - No critical errors
|
|
147
|
-
⚠️ **Warnings Fixed** - Configuration warnings resolved
|
|
148
|
-
✅ **All Examples Included** - 7 comprehensive example scripts
|
|
149
|
-
✅ **CLI Entry Points** - `mc5` command available
|
|
150
|
-
✅ **Dependencies Managed** - All requirements included
|
|
151
|
-
|
|
152
|
-
## �🚀 Let's Get Started!
|
|
153
143
|
|
|
154
144
|
### Step 1: Install the Library
|
|
155
145
|
|
|
156
146
|
Just run this in your terminal (Command Prompt/PowerShell):
|
|
157
147
|
|
|
158
148
|
```bash
|
|
159
|
-
pip install
|
|
149
|
+
pip install mc5_api_client
|
|
160
150
|
```
|
|
161
151
|
|
|
162
|
-
|
|
152
|
+
### Step 2: Verify Installation
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Check the CLI
|
|
156
|
+
mc5 --help
|
|
157
|
+
mc5 version
|
|
158
|
+
|
|
159
|
+
# Test in Python
|
|
160
|
+
python -c "import mc5_api_client; print('✅ MC5 API Client ready!')"
|
|
161
|
+
```
|
|
163
162
|
|
|
164
|
-
### Step
|
|
163
|
+
### Step 3: Your First Program
|
|
165
164
|
|
|
166
|
-
|
|
165
|
+
Copy and paste this simple example to get started:
|
|
167
166
|
|
|
168
167
|
```python
|
|
168
|
+
# Save this as my_mc5_script.py
|
|
169
169
|
from mc5_api_client import MC5Client
|
|
170
170
|
|
|
171
|
-
#
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
password="sSJKzhQ5l4vrFgov"
|
|
175
|
-
)
|
|
171
|
+
# Replace with your actual credentials
|
|
172
|
+
username = "YOUR_USERNAME_HERE"
|
|
173
|
+
password = "YOUR_PASSWORD_HERE"
|
|
176
174
|
|
|
177
|
-
#
|
|
178
|
-
|
|
179
|
-
print(f"Hey {profile['name']}! You're level {profile['level']}")
|
|
175
|
+
# Create client and login
|
|
176
|
+
client = MC5Client(username=username, password=password)
|
|
180
177
|
|
|
181
178
|
# See what's happening in the game
|
|
182
179
|
events = client.get_events()
|
|
@@ -747,8 +744,8 @@ from mc5_api_client import MC5Client
|
|
|
747
744
|
|
|
748
745
|
def squad_management_bot():
|
|
749
746
|
client = MC5Client(
|
|
750
|
-
username="
|
|
751
|
-
password="
|
|
747
|
+
username="YOUR_USERNAME_HERE",
|
|
748
|
+
password="YOUR_PASSWORD_HERE"
|
|
752
749
|
)
|
|
753
750
|
|
|
754
751
|
group_id = "your-group-id"
|
|
@@ -794,8 +791,8 @@ from mc5_api_client import MC5Client
|
|
|
794
791
|
|
|
795
792
|
def private_messaging_bot():
|
|
796
793
|
client = MC5Client(
|
|
797
|
-
username="
|
|
798
|
-
password="
|
|
794
|
+
username="YOUR_USERNAME_HERE",
|
|
795
|
+
password="YOUR_PASSWORD_HERE"
|
|
799
796
|
)
|
|
800
797
|
|
|
801
798
|
# Check inbox for new messages
|
|
@@ -843,8 +840,8 @@ from datetime import datetime
|
|
|
843
840
|
|
|
844
841
|
def track_squad_performance():
|
|
845
842
|
client = MC5Client(
|
|
846
|
-
username="
|
|
847
|
-
password="
|
|
843
|
+
username="YOUR_USERNAME_HERE",
|
|
844
|
+
password="YOUR_PASSWORD_HERE"
|
|
848
845
|
)
|
|
849
846
|
|
|
850
847
|
group_id = "your-group-id"
|
|
@@ -879,8 +876,8 @@ Celebrate squad achievements automatically:
|
|
|
879
876
|
```python
|
|
880
877
|
def celebrate_achievements():
|
|
881
878
|
client = MC5Client(
|
|
882
|
-
username="
|
|
883
|
-
password="
|
|
879
|
+
username="YOUR_USERNAME_HERE",
|
|
880
|
+
password="YOUR_PASSWORD_HERE"
|
|
884
881
|
)
|
|
885
882
|
|
|
886
883
|
group_id = "your-group-id"
|
|
@@ -917,8 +914,8 @@ Create a custom leaderboard system:
|
|
|
917
914
|
```python
|
|
918
915
|
def create_custom_leaderboard():
|
|
919
916
|
client = MC5Client(
|
|
920
|
-
username="
|
|
921
|
-
password="
|
|
917
|
+
username="YOUR_USERNAME_HERE",
|
|
918
|
+
password="YOUR_PASSWORD_HERE"
|
|
922
919
|
)
|
|
923
920
|
|
|
924
921
|
group_id = "your-group-id"
|
|
@@ -962,6 +959,7 @@ The library comes with comprehensive examples to get you started:
|
|
|
962
959
|
- `examples/squad_wall_management.py` - Squad wall communication examples
|
|
963
960
|
- `examples/private_messaging.py` - Private messaging and inbox management
|
|
964
961
|
- `examples/message_management.py` - Advanced message management and bulk deletion
|
|
962
|
+
- `examples/advanced_features.py` - Events, account management, alias system, game config
|
|
965
963
|
|
|
966
964
|
### 🚀 Advanced Examples
|
|
967
965
|
- Squad management bot with automated updates
|
|
@@ -1009,6 +1007,45 @@ The library comes with comprehensive examples to get you started:
|
|
|
1009
1007
|
- ✅ Bulk stat updates
|
|
1010
1008
|
- ✅ Real-time activity monitoring
|
|
1011
1009
|
|
|
1010
|
+
### � Events API (10+ Methods)
|
|
1011
|
+
- ✅ Get all active and upcoming events
|
|
1012
|
+
- ✅ Filter events by type and status
|
|
1013
|
+
- ✅ Get detailed event information with tasks and milestones
|
|
1014
|
+
- ✅ Parse event templates and extract rewards
|
|
1015
|
+
- ✅ Get daily tasks with progress tracking
|
|
1016
|
+
- ✅ Get squad events and tournament information
|
|
1017
|
+
- ✅ Calculate event rewards based on current points
|
|
1018
|
+
- ✅ Track event progress and next milestones
|
|
1019
|
+
- ✅ Extract task conditions and reward types
|
|
1020
|
+
- ✅ Support for multiple event categories
|
|
1021
|
+
|
|
1022
|
+
### 👤 Account Management (5+ Methods)
|
|
1023
|
+
- ✅ Import account data from other platforms
|
|
1024
|
+
- ✅ Link accounts across different platforms
|
|
1025
|
+
- ✅ Get detailed account information
|
|
1026
|
+
- ✅ Unlink platform accounts
|
|
1027
|
+
- ✅ Migrate account data between platforms
|
|
1028
|
+
- ✅ Support for cross-platform data transfer
|
|
1029
|
+
- ✅ Account verification and validation
|
|
1030
|
+
|
|
1031
|
+
### 🏷️ Alias/Dogtags System (4+ Methods)
|
|
1032
|
+
- ✅ Convert dogtags to alias format
|
|
1033
|
+
- ✅ Convert aliases back to dogtags
|
|
1034
|
+
- ✅ Get player information using alias/dogtag
|
|
1035
|
+
- ✅ Search for players by alias
|
|
1036
|
+
- ✅ Support for hexadecimal player IDs
|
|
1037
|
+
- ✅ Automatic format detection
|
|
1038
|
+
- ✅ Mathematical conversion algorithms
|
|
1039
|
+
|
|
1040
|
+
### ⚙️ Game Configuration (4+ Methods)
|
|
1041
|
+
- ✅ Get asset hash metadata
|
|
1042
|
+
- ✅ Get game object catalog
|
|
1043
|
+
- ✅ Get service URLs for current region
|
|
1044
|
+
- ✅ Get comprehensive game configuration
|
|
1045
|
+
- ✅ Support for multiple config types
|
|
1046
|
+
- ✅ Asset metadata tracking
|
|
1047
|
+
- ✅ Service URL management
|
|
1048
|
+
- ✅ Game object categorization
|
|
1012
1049
|
### 💬 Complete Communication System (6+ Methods)
|
|
1013
1050
|
- ✅ Send private messages with rich formatting
|
|
1014
1051
|
- ✅ Include kill signatures and colors
|
|
@@ -1075,7 +1112,7 @@ Want to contribute or modify the library?
|
|
|
1075
1112
|
|
|
1076
1113
|
```bash
|
|
1077
1114
|
# Clone the project
|
|
1078
|
-
git clone https://github.com/
|
|
1115
|
+
git clone https://github.com/chizoba2026/mc5-api-client
|
|
1079
1116
|
cd mc5-api-client
|
|
1080
1117
|
|
|
1081
1118
|
# Install for development
|
|
@@ -1120,18 +1157,20 @@ Stuck on something? No worries!
|
|
|
1120
1157
|
|
|
1121
1158
|
## 🔗 Useful Links
|
|
1122
1159
|
|
|
1123
|
-
This is the **most comprehensive Modern Combat 5 API library** ever created! With **
|
|
1160
|
+
This is the **most comprehensive Modern Combat 5 API library** ever created! With **95+ methods** across **14 major categories**, you can:
|
|
1124
1161
|
|
|
1125
1162
|
- 🏰 **Manage entire clans** from creation to disbandment
|
|
1126
1163
|
- 👥 **Control squad members** with real-time stat updates
|
|
1127
1164
|
- 💬 **Complete communication system** - Private messages, squad wall, alerts
|
|
1165
|
+
- 📅 **Advanced events system** - Daily tasks, squad events, milestones
|
|
1166
|
+
- 👤 **Account management** - Import, link, migrate across platforms
|
|
1167
|
+
- 🏷️ **Alias/dogtags system** - Player ID conversion and search
|
|
1168
|
+
- ⚙️ **Game configuration** - Assets, catalogs, service URLs
|
|
1128
1169
|
- 🎯 **Customize everything** with kill signatures and rich formatting
|
|
1129
1170
|
- 📊 **Track performance** with detailed analytics
|
|
1130
1171
|
- 🎮 **Automate gameplay** with custom bots and scripts
|
|
1131
1172
|
- 🏆 **Create leaderboards** and ranking systems
|
|
1132
1173
|
- 🔄 **Schedule tasks** and monitor activity
|
|
1133
|
-
- 📱 **Manage messages** with inbox and reply systems
|
|
1134
|
-
|
|
1135
1174
|
|
|
1136
1175
|
**Perfect for:**
|
|
1137
1176
|
- 🏆 Squad leaders who want to automate management
|
|
@@ -1142,9 +1181,11 @@ This is the **most comprehensive Modern Combat 5 API library** ever created! Wit
|
|
|
1142
1181
|
- 🏅 Competitive players seeking advantages
|
|
1143
1182
|
- 💬 Community managers handling communications
|
|
1144
1183
|
- 📧 Support teams providing assistance
|
|
1184
|
+
- 📅 Event coordinators managing tournaments
|
|
1185
|
+
- 🏷️ Player search and identification systems
|
|
1145
1186
|
|
|
1146
1187
|
**Ready to dominate Modern Combat 5?** 🚀
|
|
1147
1188
|
|
|
1148
1189
|
```bash
|
|
1149
|
-
pip install
|
|
1190
|
+
pip install mc5_api_client
|
|
1150
1191
|
mc5 --help # See all commands!
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
mc5_api_client/__init__.py,sha256=VtZ8P-CwnjHSq6VmSuBwVttNXIK3qoOrFuNxXMVeaMc,1021
|
|
2
2
|
mc5_api_client/auth.py,sha256=Yj_6s8KmtbswWbR6q816d8soIirUF2aD_KWxg-jNqR0,9978
|
|
3
3
|
mc5_api_client/cli.py,sha256=KegNTxwq28gu_vrffc_cXcALrHzUBDHd-5DqKyYp4p0,17284
|
|
4
|
-
mc5_api_client/client.py,sha256=
|
|
4
|
+
mc5_api_client/client.py,sha256=JJxXvPZMJh_Gfp_tO-X2cBmLlbWb-V3zp5RgDT71hsI,58264
|
|
5
5
|
mc5_api_client/exceptions.py,sha256=o7od4GrEIlgq6xSNUjZdh74xoDTytF3PLcMq5ewRiJw,2683
|
|
6
6
|
mc5_api_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
mc5_api_client-1.0.
|
|
8
|
-
mc5_api_client-1.0.
|
|
9
|
-
mc5_api_client-1.0.
|
|
10
|
-
mc5_api_client-1.0.
|
|
11
|
-
mc5_api_client-1.0.
|
|
12
|
-
mc5_api_client-1.0.
|
|
7
|
+
mc5_api_client-1.0.3.dist-info/LICENSE,sha256=M0UBQ4B3pB9XcV54_jhVP681xyauF8GB6YK_rKmuXzk,1064
|
|
8
|
+
mc5_api_client-1.0.3.dist-info/METADATA,sha256=Z6-UrwQ13kJ4n0RmEkWIbbOb6aaZvkFDaY5E9VU_URo,35719
|
|
9
|
+
mc5_api_client-1.0.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
10
|
+
mc5_api_client-1.0.3.dist-info/entry_points.txt,sha256=2kruOpleFYK3Jl1MoQwGyqCd-Pj4kQWngXmIjnXx_gE,48
|
|
11
|
+
mc5_api_client-1.0.3.dist-info/top_level.txt,sha256=eYJe4ue9j1ig_jFY5Z05mDqpizUEV7TYpk5lBXVd4kA,15
|
|
12
|
+
mc5_api_client-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|