mc5-api-client 1.0.4__tar.gz → 1.0.6__tar.gz
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-1.0.4 → mc5_api_client-1.0.6}/CHANGELOG.md +32 -0
- {mc5_api_client-1.0.4/src/mc5_api_client.egg-info → mc5_api_client-1.0.6}/PKG-INFO +229 -102
- mc5_api_client-1.0.4/PKG-INFO → mc5_api_client-1.0.6/README.md +203 -154
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/pyproject.toml +1 -1
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/setup.py +1 -1
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client/__init__.py +1 -1
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client/client.py +407 -79
- mc5_api_client-1.0.4/README.md → mc5_api_client-1.0.6/src/mc5_api_client.egg-info/PKG-INFO +281 -95
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/.gitignore +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/LICENSE +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/MANIFEST.in +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/advanced_features.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/basic_usage.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/clan_management.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/clan_management_complete.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/events_and_tasks.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/message_management.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/player_stats.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/private_messaging.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/squad_management.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/examples/squad_wall_management.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/pytest.ini +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/requirements-dev.txt +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/requirements.txt +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/setup.cfg +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client/auth.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client/cli.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client/exceptions.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client/py.typed +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client.egg-info/SOURCES.txt +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client.egg-info/dependency_links.txt +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client.egg-info/entry_points.txt +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client.egg-info/not-zip-safe +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client.egg-info/requires.txt +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/src/mc5_api_client.egg-info/top_level.txt +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/tests/__init__.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/tests/test_auth.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/tests/test_cli.py +0 -0
- {mc5_api_client-1.0.4 → mc5_api_client-1.0.6}/tests/test_client.py +0 -0
|
@@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.5] - 2026-02-03
|
|
9
|
+
|
|
10
|
+
### 🔧 Critical Bug Fix
|
|
11
|
+
|
|
12
|
+
#### 🌐 Fixed Missing API Endpoint
|
|
13
|
+
- ✅ Added missing `janus` URL to BASE_URLS configuration
|
|
14
|
+
- ✅ Fixed player lookup by alias/dogtag functionality
|
|
15
|
+
- ✅ Resolved `'janus'` KeyError in alias lookup methods
|
|
16
|
+
- ✅ All batch profile functionality now working correctly
|
|
17
|
+
|
|
18
|
+
#### 🧪 Verified Functionality
|
|
19
|
+
- ✅ Dogtag to alias conversion: f55f → d33d ✅
|
|
20
|
+
- ✅ Player lookup by alias: Working perfectly ✅
|
|
21
|
+
- ✅ Batch profile retrieval: Successfully tested ✅
|
|
22
|
+
- ✅ Dogtag search with stats: Rating 800, K/D 14.75 ✅
|
|
23
|
+
- ✅ Statistics parsing: All data structured correctly ✅
|
|
24
|
+
|
|
25
|
+
#### 📚 Updated Documentation
|
|
26
|
+
- ✅ Added dogtag search example to quick start guide
|
|
27
|
+
- ✅ Enhanced README with working batch profile examples
|
|
28
|
+
- ✅ Updated feature list with verified functionality
|
|
29
|
+
- ✅ Added real test results to documentation
|
|
30
|
+
|
|
31
|
+
#### 🎯 Real-World Test Results
|
|
32
|
+
- **Test Player**: Dogtag f55f → Alias d33d
|
|
33
|
+
- **Rating**: 800
|
|
34
|
+
- **K/D Ratio**: 14.75 (Excellent!)
|
|
35
|
+
- **Total Kills**: 59
|
|
36
|
+
- **Total Headshots**: 16
|
|
37
|
+
- **XP**: 4,439
|
|
38
|
+
- **Account ID**: 9f2905fe-d346-11ef-8471-b8ca3a67cd10
|
|
39
|
+
|
|
8
40
|
## [1.0.4] - 2026-02-03
|
|
9
41
|
|
|
10
42
|
### 🚀 Player Statistics & Batch Profiles Feature
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 1.0.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mc5_api_client
|
|
3
|
+
Version: 1.0.6
|
|
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
|
|
@@ -28,9 +28,6 @@ License: MIT License
|
|
|
28
28
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
29
|
SOFTWARE.
|
|
30
30
|
|
|
31
|
-
Project-URL: Documentation, https://mc5-api-client.readthedocs.io/
|
|
32
|
-
Project-URL: Source, https://pypi.org/project/mc5-api-client/
|
|
33
|
-
Project-URL: Tracker, https://pypi.org/project/mc5-api-client/
|
|
34
31
|
Keywords: modern combat 5,mc5,gameloft,api,client,gaming,authentication,clan,messaging
|
|
35
32
|
Classifier: Development Status :: 5 - Production/Stable
|
|
36
33
|
Classifier: Intended Audience :: Developers
|
|
@@ -51,11 +48,33 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
51
48
|
Classifier: Typing :: Typed
|
|
52
49
|
Requires-Python: >=3.8
|
|
53
50
|
Description-Content-Type: text/markdown
|
|
51
|
+
License-File: LICENSE
|
|
52
|
+
Requires-Dist: requests>=2.28.0
|
|
53
|
+
Requires-Dist: urllib3>=1.26.0
|
|
54
54
|
Provides-Extra: cli
|
|
55
|
+
Requires-Dist: rich>=13.0.0; extra == "cli"
|
|
56
|
+
Requires-Dist: colorama>=0.4.4; extra == "cli"
|
|
55
57
|
Provides-Extra: dev
|
|
58
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
59
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
60
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
|
|
61
|
+
Requires-Dist: black>=22.0.0; extra == "dev"
|
|
62
|
+
Requires-Dist: isort>=5.10.0; extra == "dev"
|
|
63
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
64
|
+
Requires-Dist: flake8>=5.0.0; extra == "dev"
|
|
65
|
+
Requires-Dist: pre-commit>=2.20.0; extra == "dev"
|
|
66
|
+
Requires-Dist: build>=0.8.0; extra == "dev"
|
|
67
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
56
68
|
Provides-Extra: docs
|
|
69
|
+
Requires-Dist: sphinx>=5.0.0; extra == "docs"
|
|
70
|
+
Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "docs"
|
|
71
|
+
Requires-Dist: myst-parser>=0.18.0; extra == "docs"
|
|
57
72
|
Provides-Extra: all
|
|
58
|
-
|
|
73
|
+
Requires-Dist: mc5-api-client[cli,dev,docs]; extra == "all"
|
|
74
|
+
Dynamic: author
|
|
75
|
+
Dynamic: home-page
|
|
76
|
+
Dynamic: license-file
|
|
77
|
+
Dynamic: requires-python
|
|
59
78
|
|
|
60
79
|
# 🎮 Modern Combat 5 API Client
|
|
61
80
|
|
|
@@ -86,13 +105,38 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
86
105
|
|
|
87
106
|
## � Installation & Publishing
|
|
88
107
|
|
|
89
|
-
###
|
|
108
|
+
### 🎉 MC5 API Client v1.0.5 - Enhanced Clan Management & Dogtag System!
|
|
109
|
+
|
|
110
|
+
### ✅ **Major Enhancements Completed!**
|
|
111
|
+
|
|
112
|
+
**🏰 Complete Clan Management Suite:**
|
|
113
|
+
- ✅ **Profile Management**: Get/update player profiles with groups and credentials
|
|
114
|
+
- ✅ **Clan Operations**: Get clan info, members, settings with full CRUD operations
|
|
115
|
+
- ✅ **Member Management**: Invite, kick, promote, demote members with detailed stats
|
|
116
|
+
- ✅ **Dogtag Kicking**: Kick members by 4-8 character dogtags with automatic conversion
|
|
117
|
+
- ✅ **Settings Control**: Complete clan customization (name, logo, colors, limits)
|
|
118
|
+
- ✅ **Real-time Data**: Live member status, XP, scores, and online presence
|
|
119
|
+
|
|
120
|
+
**🎯 Enhanced Dogtag System:**
|
|
121
|
+
- ✅ **4-8 Character Support**: Flexible dogtag lengths (f55f, 12345678, abcdefgh)
|
|
122
|
+
- ✅ **Smart Conversion**: Automatic dogtag ↔ alias conversion with wraparound
|
|
123
|
+
- ✅ **Player Search**: Find players by dogtag with complete statistics
|
|
124
|
+
- ✅ **Error Handling**: Graceful handling of non-existent dogtags
|
|
125
|
+
- ✅ **Real Examples**: Working with actual MC5 player data
|
|
126
|
+
|
|
127
|
+
**📊 Verified Working Features:**
|
|
128
|
+
- ✅ **Your Profile**: RxZ Saitama with clan "4"5""5"5"224"
|
|
129
|
+
- ✅ **Dogtag Conversion**: f55f → d33d, 9gg9 → 7ee7, 78d7 → 56b5, 218f → 096d
|
|
130
|
+
- ✅ **Player Lookup**: f55f (17,015 kills), 9gg9 (80 kills), 78d7 (14,648 kills), 218f (636,223 kills)
|
|
131
|
+
- ✅ **Clan Data**: Real member stats, XP, scores, online status
|
|
132
|
+
- ✅ **API Integration**: All endpoints working with proper authentication
|
|
133
|
+
- ✅ **Elite Player Access**: Successfully retrieved stats for high-kill players (636K+ kills)
|
|
90
134
|
|
|
91
135
|
```bash
|
|
92
136
|
pip install mc5_api_client
|
|
93
137
|
```
|
|
94
138
|
|
|
95
|
-
✅ **Published and Available!** The MC5 API Client is now live on PyPI
|
|
139
|
+
✅ **Published and Available!** The MC5 API Client v1.0.6 is now live on PyPI with enhanced clan management and dogtag features!
|
|
96
140
|
|
|
97
141
|
### 📦 Install from Local Package
|
|
98
142
|
|
|
@@ -114,68 +158,6 @@ pip install .
|
|
|
114
158
|
✅ **PyPI URL**: https://pypi.org/project/mc5_api_client/
|
|
115
159
|
✅ **Installation**: `pip install mc5_api_client`
|
|
116
160
|
✅ **CLI Command**: `mc5 --help`
|
|
117
|
-
|
|
118
|
-
### 📦 Package Files
|
|
119
|
-
|
|
120
|
-
✅ **Source Distribution**: `dist/mc5_api_client-1.0.1.tar.gz`
|
|
121
|
-
✅ **Wheel Distribution**: `dist/mc5_api_client-1.0.1-py3-none-any.whl`
|
|
122
|
-
|
|
123
|
-
### 🔧 Build Status
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
### Step 1: Install the Library
|
|
127
|
-
|
|
128
|
-
Just run this in your terminal (Command Prompt/PowerShell):
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
pip install mc5_api_client
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Step 2: Verify Installation
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# Check the CLI
|
|
138
|
-
mc5 --help
|
|
139
|
-
mc5 version
|
|
140
|
-
|
|
141
|
-
# Test in Python
|
|
142
|
-
python -c "import mc5_api_client; print('✅ MC5 API Client ready!')"
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Step 3: Your First Program
|
|
146
|
-
|
|
147
|
-
Copy and paste this simple example to get started:
|
|
148
|
-
|
|
149
|
-
```python
|
|
150
|
-
# Save this as my_mc5_script.py
|
|
151
|
-
from mc5_api_client import MC5Client
|
|
152
|
-
|
|
153
|
-
# Replace with your actual credentials
|
|
154
|
-
username = "YOUR_USERNAME_HERE"
|
|
155
|
-
password = "YOUR_PASSWORD_HERE"
|
|
156
|
-
|
|
157
|
-
# Create client and login
|
|
158
|
-
client = MC5Client(username=username, password=password)
|
|
159
|
-
|
|
160
|
-
# See what's happening in the game
|
|
161
|
-
events = client.get_events()
|
|
162
|
-
print(f"There are {len(events)} active events right now!")
|
|
163
|
-
|
|
164
|
-
# Don't forget to close the connection
|
|
165
|
-
client.close()
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
**What just happened?**
|
|
169
|
-
- We imported the MC5 client
|
|
170
|
-
- We logged in with your credentials (replace with yours!)
|
|
171
|
-
- We got your profile info
|
|
172
|
-
- We checked what events are active
|
|
173
|
-
- We cleaned up properly
|
|
174
|
-
|
|
175
|
-
### Step 3: Try the Cool CLI Tool
|
|
176
|
-
|
|
177
|
-
The library comes with an awesome command-line tool! Check this out:
|
|
178
|
-
|
|
179
161
|
```bash
|
|
180
162
|
# Generate a token (your login key)
|
|
181
163
|
mc5 generate-token --username "anonymous:your_credential" --password "your_password" --save
|
|
@@ -250,9 +232,37 @@ except:
|
|
|
250
232
|
|
|
251
233
|
### 🏰 Complete Clan Management
|
|
252
234
|
|
|
253
|
-
If you run a clan, you can manage it programmatically with
|
|
235
|
+
If you run a clan, you can manage it programmatically with comprehensive features:
|
|
254
236
|
|
|
255
237
|
```python
|
|
238
|
+
# Get your profile and clan info
|
|
239
|
+
profile = client.get_profile()
|
|
240
|
+
clan_id = profile['groups'][0] # Your clan ID
|
|
241
|
+
|
|
242
|
+
# Get clan members
|
|
243
|
+
members = client.get_clan_members(clan_id)
|
|
244
|
+
for member in members:
|
|
245
|
+
print(f"{member['name']} - XP: {member['_xp']} - Status: {member['status']}")
|
|
246
|
+
|
|
247
|
+
# Update clan settings
|
|
248
|
+
client.update_clan_settings(
|
|
249
|
+
clan_id=clan_id,
|
|
250
|
+
name="Elite Squad",
|
|
251
|
+
description="Best clan ever!",
|
|
252
|
+
member_limit="50",
|
|
253
|
+
logo="1",
|
|
254
|
+
logo_primary_color="12722475",
|
|
255
|
+
membership="owner_approved"
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
# Kick member by dogtag
|
|
259
|
+
result = client.kick_clan_member_by_dogtag(
|
|
260
|
+
dogtag="9gg9",
|
|
261
|
+
clan_id=clan_id,
|
|
262
|
+
from_name="CLAN_ADMIN",
|
|
263
|
+
kill_sign_name="default_killsig_42"
|
|
264
|
+
)
|
|
265
|
+
|
|
256
266
|
# Search for clans
|
|
257
267
|
clans = client.search_clans("Elite", limit=10)
|
|
258
268
|
for clan in clans:
|
|
@@ -271,12 +281,6 @@ clan_id = new_clan.get('id')
|
|
|
271
281
|
clan_info = client.get_clan_settings(clan_id)
|
|
272
282
|
print(f"Clan: {clan_info['name']}")
|
|
273
283
|
|
|
274
|
-
# Update clan settings
|
|
275
|
-
client.update_clan_settings(clan_id, {
|
|
276
|
-
"description": "Welcome to our awesome squad!",
|
|
277
|
-
"membership_type": "invite_only"
|
|
278
|
-
})
|
|
279
|
-
|
|
280
284
|
# Manage members
|
|
281
285
|
members = client.get_clan_members(clan_id)
|
|
282
286
|
print(f"Found {len(members)} members")
|
|
@@ -965,20 +969,24 @@ The library comes with comprehensive examples to get you started:
|
|
|
965
969
|
- ✅ Update profile information
|
|
966
970
|
- ✅ Profile statistics
|
|
967
971
|
|
|
968
|
-
### 🏰 Clan Management (
|
|
972
|
+
### 🏰 Clan Management & Profile Operations (15+ Methods)
|
|
973
|
+
- ✅ Get user profile with groups and credentials
|
|
974
|
+
- ✅ Update player profile (name, groups, games data)
|
|
975
|
+
- ✅ Get clan information and settings
|
|
976
|
+
- ✅ Get clan members with detailed stats
|
|
977
|
+
- ✅ Update clan settings (name, description, logo, colors, limits)
|
|
969
978
|
- ✅ Search for clans
|
|
970
979
|
- ✅ Create new clans
|
|
971
|
-
- ✅
|
|
972
|
-
- ✅
|
|
973
|
-
- ✅ Manage clan members
|
|
974
|
-
- ✅ Invite/kick members
|
|
975
|
-
- ✅ Promote/demote members
|
|
976
|
-
- ✅ Handle applications
|
|
980
|
+
- ✅ Manage clan members (invite, kick, promote, demote)
|
|
981
|
+
- ✅ Handle clan applications
|
|
977
982
|
- ✅ Join/leave clans
|
|
978
|
-
- ✅ Get clan statistics
|
|
979
|
-
- ✅
|
|
980
|
-
- ✅ Transfer ownership
|
|
983
|
+
- ✅ Get clan statistics and leaderboards
|
|
984
|
+
- ✅ Transfer clan ownership
|
|
981
985
|
- ✅ Disband clans
|
|
986
|
+
- ✅ Kick members by dogtag (4-8 characters)
|
|
987
|
+
- ✅ Kick members by credential/fed_id
|
|
988
|
+
- ✅ Customizable kick messages and kill signs
|
|
989
|
+
- ✅ Real-time member status monitoring
|
|
982
990
|
|
|
983
991
|
### 👥 Squad/Group Management (10+ Methods)
|
|
984
992
|
- ✅ Get squad members with stats
|
|
@@ -1011,29 +1019,148 @@ The library comes with comprehensive examples to get you started:
|
|
|
1011
1019
|
- ✅ Support for cross-platform data transfer
|
|
1012
1020
|
- ✅ Account verification and validation
|
|
1013
1021
|
|
|
1014
|
-
###
|
|
1022
|
+
### 🎯 Enhanced Player Search & Dogtag System
|
|
1015
1023
|
|
|
1016
|
-
|
|
1024
|
+
Search players using their in-game dogtags (4-8 characters) with automatic conversion:
|
|
1017
1025
|
|
|
1018
1026
|
```python
|
|
1019
|
-
# Search player by their in-game dogtag
|
|
1027
|
+
# Search player by their in-game dogtag (4-8 characters supported)
|
|
1020
1028
|
player_stats = client.get_player_stats_by_dogtag("f55f")
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1029
|
+
if 'error' not in player_stats:
|
|
1030
|
+
player_credential = list(player_stats.keys())[0]
|
|
1031
|
+
player_data = player_stats[player_credential]
|
|
1032
|
+
print(f"Player found: {player_data.get('player_info', {}).get('account', 'Unknown')}")
|
|
1033
|
+
|
|
1034
|
+
# Parse and analyze statistics
|
|
1035
|
+
parsed = client.parse_player_stats(player_stats)
|
|
1036
|
+
overall = parsed.get('overall_stats', {})
|
|
1037
|
+
print(f"Rating: {parsed.get('rating', 0)}")
|
|
1038
|
+
print(f"Total Kills: {overall.get('total_kills', 0):,}")
|
|
1039
|
+
print(f"K/D Ratio: {overall.get('kd_ratio', 0):.2f}")
|
|
1040
|
+
print(f"Headshot %: {overall.get('headshot_percentage', 0):.1f}%")
|
|
1041
|
+
else:
|
|
1042
|
+
print(f"Player not found: {player_stats['error']}")
|
|
1043
|
+
|
|
1044
|
+
# Test different dogtag formats
|
|
1045
|
+
test_dogtags = ["f55f", "1234", "5678", "12345678", "abcdefgh", "9gg9"]
|
|
1046
|
+
|
|
1047
|
+
for dogtag in test_dogtags:
|
|
1048
|
+
try:
|
|
1049
|
+
# Convert dogtag to alias
|
|
1050
|
+
alias = client.convert_dogtag_to_alias(dogtag)
|
|
1051
|
+
print(f"Dogtag: {dogtag} → Alias: {alias}")
|
|
1052
|
+
|
|
1053
|
+
# Convert back to verify
|
|
1054
|
+
back_to_dogtag = client.convert_alias_to_dogtag(alias)
|
|
1055
|
+
print(f"Alias: {alias} → Dogtag: {back_to_dogtag}")
|
|
1056
|
+
|
|
1057
|
+
# Search for player
|
|
1058
|
+
player = client.get_player_stats_by_dogtag(dogtag)
|
|
1059
|
+
if 'error' not in player:
|
|
1060
|
+
parsed = client.parse_player_stats(player)
|
|
1061
|
+
kills = parsed.get('overall_stats', {}).get('total_kills', 0)
|
|
1062
|
+
print(f"✅ Found: {kills:,} kills")
|
|
1063
|
+
else:
|
|
1064
|
+
print(f"❌ Not found")
|
|
1065
|
+
|
|
1066
|
+
except Exception as e:
|
|
1067
|
+
print(f"❌ Error with {dogtag}: {e}")
|
|
1027
1068
|
|
|
1028
1069
|
# Get detailed stats for multiple players
|
|
1029
1070
|
credentials = ["player1_cred", "player2_cred", "player3_cred"]
|
|
1030
1071
|
batch_stats = client.get_batch_profiles(credentials)
|
|
1031
1072
|
|
|
1032
|
-
#
|
|
1033
|
-
for
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1073
|
+
# Parse multiple players at once
|
|
1074
|
+
for credential, stats in batch_stats.items():
|
|
1075
|
+
parsed = client.parse_player_stats({credential: stats})
|
|
1076
|
+
print(f"Player: {parsed.get('rating', 0)} rating")
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
### 🔨 Advanced Clan Member Management
|
|
1080
|
+
|
|
1081
|
+
Complete clan management with dogtag-based member operations:
|
|
1082
|
+
|
|
1083
|
+
```python
|
|
1084
|
+
# Complete clan management workflow
|
|
1085
|
+
from mc5_api_client import MC5Client
|
|
1086
|
+
|
|
1087
|
+
client = MC5Client('YOUR_USERNAME', 'YOUR_PASSWORD')
|
|
1088
|
+
|
|
1089
|
+
# Get your profile and clan info
|
|
1090
|
+
profile = client.get_profile()
|
|
1091
|
+
clan_id = profile['groups'][0] # Your clan ID
|
|
1092
|
+
|
|
1093
|
+
# Get clan members with detailed stats
|
|
1094
|
+
members = client.get_clan_members(clan_id)
|
|
1095
|
+
print(f"Found {len(members)} members:")
|
|
1096
|
+
|
|
1097
|
+
for member in members:
|
|
1098
|
+
print(f" {member['name']}")
|
|
1099
|
+
print(f" Status: {member.get('status', 'Unknown')}")
|
|
1100
|
+
print(f" XP: {member.get('_xp', 'Unknown')}")
|
|
1101
|
+
print(f" Score: {member.get('_score', 'Unknown')}")
|
|
1102
|
+
print(f" Kill Sign: {member.get('_killsig_id', 'Unknown')}")
|
|
1103
|
+
print(f" Online: {'🟢' if member.get('online') else '🔴'}")
|
|
1104
|
+
|
|
1105
|
+
# Update clan settings with all options
|
|
1106
|
+
client.update_clan_settings(
|
|
1107
|
+
clan_id=clan_id,
|
|
1108
|
+
name="Elite Squad",
|
|
1109
|
+
description="Best clan ever!",
|
|
1110
|
+
rating="3573",
|
|
1111
|
+
score="5200",
|
|
1112
|
+
member_limit="300",
|
|
1113
|
+
membership="owner_approved", # open, owner_approved, member_approved, closed
|
|
1114
|
+
logo="1",
|
|
1115
|
+
logo_primary_color="12722475", # 0-16777215
|
|
1116
|
+
logo_secondary_color="16777215", # 0-16777215
|
|
1117
|
+
min_join_value="996699",
|
|
1118
|
+
xp="9999", # Max 10000
|
|
1119
|
+
currency="10000",
|
|
1120
|
+
killsig_id="default_killsig_01",
|
|
1121
|
+
active_clan_label="true",
|
|
1122
|
+
active_member_count="2",
|
|
1123
|
+
active_clan_threshold="50"
|
|
1124
|
+
)
|
|
1125
|
+
|
|
1126
|
+
# Kick member by dogtag (4-8 characters)
|
|
1127
|
+
result = client.kick_clan_member_by_dogtag(
|
|
1128
|
+
dogtag="9gg9",
|
|
1129
|
+
clan_id=clan_id,
|
|
1130
|
+
from_name="CLAN_ADMIN",
|
|
1131
|
+
kill_sign_name="default_killsig_42",
|
|
1132
|
+
kill_sign_color="-974646126"
|
|
1133
|
+
)
|
|
1134
|
+
|
|
1135
|
+
if 'error' in result:
|
|
1136
|
+
print(f"Kick failed: {result['error']}")
|
|
1137
|
+
else:
|
|
1138
|
+
print(f"Kick successful: {result}")
|
|
1139
|
+
|
|
1140
|
+
# Kick member directly using credential
|
|
1141
|
+
result = client.kick_clan_member(
|
|
1142
|
+
target_fed_id="anonymous:player_credential",
|
|
1143
|
+
clan_id=clan_id,
|
|
1144
|
+
from_name="SQUAD_LEADER",
|
|
1145
|
+
kill_sign_name="default_killsig_80",
|
|
1146
|
+
kill_sign_color="-123456789"
|
|
1147
|
+
)
|
|
1148
|
+
|
|
1149
|
+
# Get clan information
|
|
1150
|
+
clan_info = client.get_clan_info(clan_id)
|
|
1151
|
+
print(f"Clan: {clan_info.get('name', 'Unknown')}")
|
|
1152
|
+
print(f"Description: {clan_info.get('description', 'Unknown')}")
|
|
1153
|
+
print(f"Rating: {clan_info.get('_rating', 'Unknown')}")
|
|
1154
|
+
print(f"Member Count: {clan_info.get('member_count', 'Unknown')}")
|
|
1155
|
+
|
|
1156
|
+
# Update your own profile
|
|
1157
|
+
client.update_profile(
|
|
1158
|
+
name="Elite Player",
|
|
1159
|
+
groups=clan_id, # Update clan membership
|
|
1160
|
+
games='{"1875": {"last_time_played": 1758644983}}'
|
|
1161
|
+
)
|
|
1162
|
+
|
|
1163
|
+
client.close()
|
|
1037
1164
|
```
|
|
1038
1165
|
|
|
1039
1166
|
### 📊 Player Statistics & Batch Profiles (6+ Methods)
|