mc5-api-client 1.0.11__tar.gz → 1.0.13__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.11 → mc5_api_client-1.0.13}/PKG-INFO +32 -35
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/README.md +31 -34
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/pyproject.toml +1 -1
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/__init__.py +1 -1
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/cli.py +1 -1
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/client.py +38 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/simple_client.py +101 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/PKG-INFO +32 -35
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/.gitignore +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/CHANGELOG.md +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/LICENSE +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/MANIFEST.in +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/admin_squad_management.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/advanced_automation.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/advanced_features.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/basic_usage.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/clan_management.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/clan_management_complete.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/events_and_tasks.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/help_system.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/message_management.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/player_stats.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/private_messaging.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/quick_help.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/simple_usage.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/squad_management.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/examples/squad_wall_management.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/pytest.ini +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/requirements-dev.txt +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/requirements.txt +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/setup.cfg +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/setup.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/admin_client.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/auth.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/exceptions.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/help.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client/py.typed +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/SOURCES.txt +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/dependency_links.txt +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/entry_points.txt +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/not-zip-safe +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/requires.txt +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/top_level.txt +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/tests/__init__.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/tests/test_auth.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/tests/test_cli.py +0 -0
- {mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/tests/test_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mc5_api_client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.13
|
|
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
|
|
@@ -108,9 +108,9 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
108
108
|
- ⚡ **One-Liner Functions**: Quick search and kick operations!
|
|
109
109
|
- 🎯 **User-Friendly**: Designed for beginners and clan leaders!
|
|
110
110
|
- 🚀 **NEW: Admin Capabilities**: Use admin credentials for enhanced squad management!
|
|
111
|
-
- ⭐ **NEW: Squad Rating**: Add 5200+ rating to your squad with admin privileges!
|
|
112
111
|
- 🎯 **NEW: Player Score Updates**: Update any player's score, XP, and kill signatures!
|
|
113
112
|
- 🛡️ **NEW: Built-in Help System**: Comprehensive help commands and examples!
|
|
113
|
+
- 🔐 **NEW: Encrypted Token Support**: Generate and encrypt tokens for additional security!
|
|
114
114
|
|
|
115
115
|
## 🚀 Installation
|
|
116
116
|
|
|
@@ -122,14 +122,14 @@ pip install mc5_api_client==1.0.8
|
|
|
122
122
|
|
|
123
123
|
### ✅ **Major Enhancements Completed!**
|
|
124
124
|
|
|
125
|
-
**🚀 Advanced Automation Features (NEW in v1.0.8):**
|
|
125
|
+
**🚀 Advanced Automation Features (NEW in v1.0.8+):**
|
|
126
126
|
- ✅ **AdminMC5Client**: Enhanced client with admin privileges
|
|
127
|
-
- ✅ **
|
|
128
|
-
- ✅ **Player Score Updates**: Update any player's score, XP, and kill signatures
|
|
127
|
+
- ✅ **Player Score Management**: Update individual player scores, XP, and kill signatures
|
|
129
128
|
- ✅ **Batch Processing**: Search multiple players with loops and conditionals
|
|
130
129
|
- ✅ **Real-time Monitoring**: Continuous activity tracking with while loops
|
|
131
130
|
- ✅ **Smart Clan Cleanup**: Intelligent member management with safety features
|
|
132
131
|
- ✅ **Built-in Help System**: Comprehensive help commands and examples
|
|
132
|
+
- ✅ **Encrypted Token Support**: Generate and encrypt tokens for additional security
|
|
133
133
|
- ✅ **Production Ready**: Thoroughly tested and verified for production use
|
|
134
134
|
|
|
135
135
|
**🎮 Revolutionary Simple Interface (from v1.0.7):**
|
|
@@ -174,12 +174,11 @@ pip install mc5_api_client
|
|
|
174
174
|
|
|
175
175
|
New in v1.0.8! Powerful admin capabilities for enhanced squad management:
|
|
176
176
|
|
|
177
|
-
### **⭐
|
|
178
|
-
|
|
177
|
+
### **⭐ Update Player Scores (Admin Only):**
|
|
179
178
|
```python
|
|
180
179
|
from mc5_api_client import quick_update_player_score
|
|
181
180
|
|
|
182
|
-
#
|
|
181
|
+
# Update any player's score, XP, and kill signature
|
|
183
182
|
result = quick_update_player_score(
|
|
184
183
|
target_user_id="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
185
184
|
score=5200,
|
|
@@ -188,48 +187,47 @@ result = quick_update_player_score(
|
|
|
188
187
|
killsig_id="default_killsig_80"
|
|
189
188
|
)
|
|
190
189
|
|
|
191
|
-
|
|
190
|
+
if result.get('success'):
|
|
191
|
+
print("✅ Player score updated successfully!")
|
|
192
|
+
print(f"New score: {result.get('score')}")
|
|
193
|
+
print(f"New XP: {result.get('xp')}")
|
|
192
194
|
```
|
|
193
195
|
|
|
194
|
-
###
|
|
195
|
-
|
|
196
|
+
### **� Admin Client Usage:**
|
|
196
197
|
```python
|
|
197
198
|
from mc5_api_client import create_admin_client
|
|
198
199
|
|
|
199
|
-
# Create admin client with
|
|
200
|
+
# Create admin client with elevated privileges
|
|
200
201
|
client = create_admin_client()
|
|
201
202
|
client.connect()
|
|
202
203
|
|
|
203
|
-
# Update
|
|
204
|
+
# Update player information
|
|
204
205
|
result = client.update_player_score(
|
|
205
206
|
target_user_id="player_user_id",
|
|
206
207
|
score=10000,
|
|
207
|
-
xp=5000000
|
|
208
|
+
xp=5000000,
|
|
209
|
+
killsig_color="16777215",
|
|
210
|
+
killsig_id="default_killsig_42"
|
|
208
211
|
)
|
|
209
212
|
|
|
210
|
-
# Get squad members
|
|
213
|
+
# Get squad members (if you have access)
|
|
211
214
|
members = client.get_squad_members()
|
|
212
|
-
print(f"
|
|
215
|
+
print(f"Found {len(members)} squad members")
|
|
216
|
+
|
|
217
|
+
# Kick members (if you have permissions)
|
|
218
|
+
# client.kick_member("member_user_id", "Reason for kick")
|
|
213
219
|
|
|
214
220
|
client.close()
|
|
215
221
|
```
|
|
216
222
|
|
|
217
|
-
###
|
|
223
|
+
### **⚠️ Important Admin Limitations:**
|
|
224
|
+
- ✅ **Can Update**: Individual player scores, XP, kill signatures
|
|
225
|
+
- ✅ **Can Kick**: Squad members (with proper permissions)
|
|
226
|
+
- ❌ **Cannot Edit**: Squad rating directly (requires squad ownership)
|
|
227
|
+
- ❌ **Cannot Modify**: Squad settings (requires squad ownership)
|
|
218
228
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
# Add rating using admin credentials
|
|
223
|
-
result = quick_add_squad_rating(
|
|
224
|
-
username="game:mc5_system",
|
|
225
|
-
password="admin",
|
|
226
|
-
rating=5200,
|
|
227
|
-
use_admin=True
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
if 'error' not in result:
|
|
231
|
-
print("✅ 5200 rating added to squad!")
|
|
232
|
-
```
|
|
229
|
+
### **🔧 How It Actually Works:**
|
|
230
|
+
Admin privileges allow you to modify individual player data within a squad, which indirectly affects the squad's overall rating through the sum of member scores, but you cannot directly set the squad's rating value.
|
|
233
231
|
|
|
234
232
|
## 🎮 **Simple Usage for Non-Developers**
|
|
235
233
|
|
|
@@ -400,8 +398,7 @@ client.connect()
|
|
|
400
398
|
player = client.search_player('f55f')
|
|
401
399
|
|
|
402
400
|
# 🔹 Admin Operations
|
|
403
|
-
quick_update_player_score('user_id', 5200)
|
|
404
|
-
quick_add_squad_rating('admin', 'admin', 5200, use_admin=True)
|
|
401
|
+
quick_update_player_score('user_id', 5200, xp=2037745)
|
|
405
402
|
|
|
406
403
|
# 🔹 Error Handling
|
|
407
404
|
try: except AuthenticationError:
|
|
@@ -413,10 +410,10 @@ try: except MC5APIError:
|
|
|
413
410
|
### **🚀 Install from PyPI (Recommended)**
|
|
414
411
|
|
|
415
412
|
```bash
|
|
416
|
-
pip install mc5_api_client==1.0.
|
|
413
|
+
pip install mc5_api_client==1.0.12
|
|
417
414
|
```
|
|
418
415
|
|
|
419
|
-
✅ **Published and Available!** The MC5 API Client v1.0.
|
|
416
|
+
✅ **Published and Available!** The MC5 API Client v1.0.12 is now live on PyPI with accurate admin capabilities, encrypted token support, and corrected documentation!
|
|
420
417
|
|
|
421
418
|
### **� Install from Local Package**
|
|
422
419
|
|
|
@@ -30,9 +30,9 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
30
30
|
- ⚡ **One-Liner Functions**: Quick search and kick operations!
|
|
31
31
|
- 🎯 **User-Friendly**: Designed for beginners and clan leaders!
|
|
32
32
|
- 🚀 **NEW: Admin Capabilities**: Use admin credentials for enhanced squad management!
|
|
33
|
-
- ⭐ **NEW: Squad Rating**: Add 5200+ rating to your squad with admin privileges!
|
|
34
33
|
- 🎯 **NEW: Player Score Updates**: Update any player's score, XP, and kill signatures!
|
|
35
34
|
- 🛡️ **NEW: Built-in Help System**: Comprehensive help commands and examples!
|
|
35
|
+
- 🔐 **NEW: Encrypted Token Support**: Generate and encrypt tokens for additional security!
|
|
36
36
|
|
|
37
37
|
## 🚀 Installation
|
|
38
38
|
|
|
@@ -44,14 +44,14 @@ pip install mc5_api_client==1.0.8
|
|
|
44
44
|
|
|
45
45
|
### ✅ **Major Enhancements Completed!**
|
|
46
46
|
|
|
47
|
-
**🚀 Advanced Automation Features (NEW in v1.0.8):**
|
|
47
|
+
**🚀 Advanced Automation Features (NEW in v1.0.8+):**
|
|
48
48
|
- ✅ **AdminMC5Client**: Enhanced client with admin privileges
|
|
49
|
-
- ✅ **
|
|
50
|
-
- ✅ **Player Score Updates**: Update any player's score, XP, and kill signatures
|
|
49
|
+
- ✅ **Player Score Management**: Update individual player scores, XP, and kill signatures
|
|
51
50
|
- ✅ **Batch Processing**: Search multiple players with loops and conditionals
|
|
52
51
|
- ✅ **Real-time Monitoring**: Continuous activity tracking with while loops
|
|
53
52
|
- ✅ **Smart Clan Cleanup**: Intelligent member management with safety features
|
|
54
53
|
- ✅ **Built-in Help System**: Comprehensive help commands and examples
|
|
54
|
+
- ✅ **Encrypted Token Support**: Generate and encrypt tokens for additional security
|
|
55
55
|
- ✅ **Production Ready**: Thoroughly tested and verified for production use
|
|
56
56
|
|
|
57
57
|
**🎮 Revolutionary Simple Interface (from v1.0.7):**
|
|
@@ -96,12 +96,11 @@ pip install mc5_api_client
|
|
|
96
96
|
|
|
97
97
|
New in v1.0.8! Powerful admin capabilities for enhanced squad management:
|
|
98
98
|
|
|
99
|
-
### **⭐
|
|
100
|
-
|
|
99
|
+
### **⭐ Update Player Scores (Admin Only):**
|
|
101
100
|
```python
|
|
102
101
|
from mc5_api_client import quick_update_player_score
|
|
103
102
|
|
|
104
|
-
#
|
|
103
|
+
# Update any player's score, XP, and kill signature
|
|
105
104
|
result = quick_update_player_score(
|
|
106
105
|
target_user_id="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
107
106
|
score=5200,
|
|
@@ -110,48 +109,47 @@ result = quick_update_player_score(
|
|
|
110
109
|
killsig_id="default_killsig_80"
|
|
111
110
|
)
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
if result.get('success'):
|
|
113
|
+
print("✅ Player score updated successfully!")
|
|
114
|
+
print(f"New score: {result.get('score')}")
|
|
115
|
+
print(f"New XP: {result.get('xp')}")
|
|
114
116
|
```
|
|
115
117
|
|
|
116
|
-
###
|
|
117
|
-
|
|
118
|
+
### **� Admin Client Usage:**
|
|
118
119
|
```python
|
|
119
120
|
from mc5_api_client import create_admin_client
|
|
120
121
|
|
|
121
|
-
# Create admin client with
|
|
122
|
+
# Create admin client with elevated privileges
|
|
122
123
|
client = create_admin_client()
|
|
123
124
|
client.connect()
|
|
124
125
|
|
|
125
|
-
# Update
|
|
126
|
+
# Update player information
|
|
126
127
|
result = client.update_player_score(
|
|
127
128
|
target_user_id="player_user_id",
|
|
128
129
|
score=10000,
|
|
129
|
-
xp=5000000
|
|
130
|
+
xp=5000000,
|
|
131
|
+
killsig_color="16777215",
|
|
132
|
+
killsig_id="default_killsig_42"
|
|
130
133
|
)
|
|
131
134
|
|
|
132
|
-
# Get squad members
|
|
135
|
+
# Get squad members (if you have access)
|
|
133
136
|
members = client.get_squad_members()
|
|
134
|
-
print(f"
|
|
137
|
+
print(f"Found {len(members)} squad members")
|
|
138
|
+
|
|
139
|
+
# Kick members (if you have permissions)
|
|
140
|
+
# client.kick_member("member_user_id", "Reason for kick")
|
|
135
141
|
|
|
136
142
|
client.close()
|
|
137
143
|
```
|
|
138
144
|
|
|
139
|
-
###
|
|
145
|
+
### **⚠️ Important Admin Limitations:**
|
|
146
|
+
- ✅ **Can Update**: Individual player scores, XP, kill signatures
|
|
147
|
+
- ✅ **Can Kick**: Squad members (with proper permissions)
|
|
148
|
+
- ❌ **Cannot Edit**: Squad rating directly (requires squad ownership)
|
|
149
|
+
- ❌ **Cannot Modify**: Squad settings (requires squad ownership)
|
|
140
150
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
# Add rating using admin credentials
|
|
145
|
-
result = quick_add_squad_rating(
|
|
146
|
-
username="game:mc5_system",
|
|
147
|
-
password="admin",
|
|
148
|
-
rating=5200,
|
|
149
|
-
use_admin=True
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
if 'error' not in result:
|
|
153
|
-
print("✅ 5200 rating added to squad!")
|
|
154
|
-
```
|
|
151
|
+
### **🔧 How It Actually Works:**
|
|
152
|
+
Admin privileges allow you to modify individual player data within a squad, which indirectly affects the squad's overall rating through the sum of member scores, but you cannot directly set the squad's rating value.
|
|
155
153
|
|
|
156
154
|
## 🎮 **Simple Usage for Non-Developers**
|
|
157
155
|
|
|
@@ -322,8 +320,7 @@ client.connect()
|
|
|
322
320
|
player = client.search_player('f55f')
|
|
323
321
|
|
|
324
322
|
# 🔹 Admin Operations
|
|
325
|
-
quick_update_player_score('user_id', 5200)
|
|
326
|
-
quick_add_squad_rating('admin', 'admin', 5200, use_admin=True)
|
|
323
|
+
quick_update_player_score('user_id', 5200, xp=2037745)
|
|
327
324
|
|
|
328
325
|
# 🔹 Error Handling
|
|
329
326
|
try: except AuthenticationError:
|
|
@@ -335,10 +332,10 @@ try: except MC5APIError:
|
|
|
335
332
|
### **🚀 Install from PyPI (Recommended)**
|
|
336
333
|
|
|
337
334
|
```bash
|
|
338
|
-
pip install mc5_api_client==1.0.
|
|
335
|
+
pip install mc5_api_client==1.0.12
|
|
339
336
|
```
|
|
340
337
|
|
|
341
|
-
✅ **Published and Available!** The MC5 API Client v1.0.
|
|
338
|
+
✅ **Published and Available!** The MC5 API Client v1.0.12 is now live on PyPI with accurate admin capabilities, encrypted token support, and corrected documentation!
|
|
342
339
|
|
|
343
340
|
### **� Install from Local Package**
|
|
344
341
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "mc5_api_client"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.13"
|
|
8
8
|
description = "A comprehensive Python library for interacting with the Modern Combat 5 API"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {file = "LICENSE"}
|
|
@@ -447,7 +447,7 @@ class MC5CLI:
|
|
|
447
447
|
|
|
448
448
|
def _print_version(self):
|
|
449
449
|
"""Print version information."""
|
|
450
|
-
self._print("MC5 API Client v1.0.
|
|
450
|
+
self._print("MC5 API Client v1.0.13", "cyan")
|
|
451
451
|
self._print("The ultimate Modern Combat 5 API library", "green")
|
|
452
452
|
self._print("Author: Chizoba", "blue")
|
|
453
453
|
self._print("Email: chizoba2026@hotmail.com", "blue")
|
|
@@ -522,6 +522,44 @@ class MC5Client:
|
|
|
522
522
|
url = f"{self.BASE_URLS['osiris']}/accounts/me/clan-applications/{clan_id}"
|
|
523
523
|
return self._make_request("DELETE", url)
|
|
524
524
|
|
|
525
|
+
def get_clan_requests(self, request_type: str = "membership_approval") -> List[Dict[str, Any]]:
|
|
526
|
+
"""
|
|
527
|
+
Get pending clan membership requests for the current user.
|
|
528
|
+
|
|
529
|
+
Args:
|
|
530
|
+
request_type: Type of requests to retrieve (default: "membership_approval")
|
|
531
|
+
|
|
532
|
+
Returns:
|
|
533
|
+
List of clan requests
|
|
534
|
+
"""
|
|
535
|
+
url = f"{self.BASE_URLS['osiris']}/accounts/me/requests"
|
|
536
|
+
params = {
|
|
537
|
+
"request_type": request_type
|
|
538
|
+
}
|
|
539
|
+
response = self._make_request("GET", url, params=params)
|
|
540
|
+
return response if isinstance(response, list) else []
|
|
541
|
+
|
|
542
|
+
def respond_to_clan_request(self, request_id: str, action: str, message: str = "") -> Dict[str, Any]:
|
|
543
|
+
"""
|
|
544
|
+
Respond to a clan membership request (accept/reject).
|
|
545
|
+
|
|
546
|
+
Args:
|
|
547
|
+
request_id: Request ID to respond to
|
|
548
|
+
action: Action to take ("accept" or "reject")
|
|
549
|
+
message: Optional message for the response
|
|
550
|
+
|
|
551
|
+
Returns:
|
|
552
|
+
Response result
|
|
553
|
+
"""
|
|
554
|
+
url = f"{self.BASE_URLS['osiris']}/accounts/me/requests/{request_id}"
|
|
555
|
+
data = {
|
|
556
|
+
"action": action
|
|
557
|
+
}
|
|
558
|
+
if message:
|
|
559
|
+
data["message"] = message
|
|
560
|
+
|
|
561
|
+
return self._make_request("POST", url, data=data)
|
|
562
|
+
|
|
525
563
|
def get_clan_statistics(self, clan_id: str) -> Dict[str, Any]:
|
|
526
564
|
"""
|
|
527
565
|
Get clan statistics and performance data.
|
|
@@ -285,6 +285,107 @@ class SimpleMC5Client:
|
|
|
285
285
|
print(f"❌ Error sending message: {e}")
|
|
286
286
|
return False
|
|
287
287
|
|
|
288
|
+
def get_inbox_messages(self, limit: int = 20) -> List[Dict[str, Any]]:
|
|
289
|
+
"""
|
|
290
|
+
Get messages from your inbox.
|
|
291
|
+
|
|
292
|
+
Args:
|
|
293
|
+
limit: Maximum number of messages to retrieve
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
List of inbox messages
|
|
297
|
+
"""
|
|
298
|
+
try:
|
|
299
|
+
messages = self.client.get_inbox_messages(limit=limit)
|
|
300
|
+
print(f"✅ Retrieved {len(messages)} messages from inbox")
|
|
301
|
+
return messages
|
|
302
|
+
except Exception as e:
|
|
303
|
+
print(f"❌ Error getting inbox messages: {e}")
|
|
304
|
+
return []
|
|
305
|
+
|
|
306
|
+
def delete_message(self, message_id: str) -> bool:
|
|
307
|
+
"""
|
|
308
|
+
Delete a single message from your inbox.
|
|
309
|
+
|
|
310
|
+
Args:
|
|
311
|
+
message_id: ID of the message to delete
|
|
312
|
+
|
|
313
|
+
Returns:
|
|
314
|
+
True if successful, False otherwise
|
|
315
|
+
"""
|
|
316
|
+
try:
|
|
317
|
+
result = self.client.delete_inbox_message(message_id)
|
|
318
|
+
if 'error' not in result:
|
|
319
|
+
print(f"✅ Message {message_id} deleted successfully")
|
|
320
|
+
return True
|
|
321
|
+
else:
|
|
322
|
+
print(f"❌ Failed to delete message: {result.get('error', 'Unknown error')}")
|
|
323
|
+
return False
|
|
324
|
+
except Exception as e:
|
|
325
|
+
print(f"❌ Error deleting message: {e}")
|
|
326
|
+
return False
|
|
327
|
+
|
|
328
|
+
def clear_inbox(self) -> bool:
|
|
329
|
+
"""
|
|
330
|
+
Clear all messages from your inbox.
|
|
331
|
+
|
|
332
|
+
Returns:
|
|
333
|
+
True if successful, False otherwise
|
|
334
|
+
"""
|
|
335
|
+
try:
|
|
336
|
+
result = self.client.clear_inbox()
|
|
337
|
+
if 'error' not in result:
|
|
338
|
+
print(f"✅ Inbox cleared successfully")
|
|
339
|
+
return True
|
|
340
|
+
else:
|
|
341
|
+
print(f"❌ Failed to clear inbox: {result.get('error', 'Unknown error')}")
|
|
342
|
+
return False
|
|
343
|
+
except Exception as e:
|
|
344
|
+
print(f"❌ Error clearing inbox: {e}")
|
|
345
|
+
return False
|
|
346
|
+
|
|
347
|
+
def get_clan_requests(self, request_type: str = "membership_approval") -> List[Dict[str, Any]]:
|
|
348
|
+
"""
|
|
349
|
+
Get pending clan membership requests.
|
|
350
|
+
|
|
351
|
+
Args:
|
|
352
|
+
request_type: Type of requests to retrieve
|
|
353
|
+
|
|
354
|
+
Returns:
|
|
355
|
+
List of clan requests
|
|
356
|
+
"""
|
|
357
|
+
try:
|
|
358
|
+
requests = self.client.get_clan_requests(request_type=request_type)
|
|
359
|
+
print(f"✅ Retrieved {len(requests)} clan requests")
|
|
360
|
+
return requests
|
|
361
|
+
except Exception as e:
|
|
362
|
+
print(f"❌ Error getting clan requests: {e}")
|
|
363
|
+
return []
|
|
364
|
+
|
|
365
|
+
def respond_to_clan_request(self, request_id: str, action: str, message: str = "") -> bool:
|
|
366
|
+
"""
|
|
367
|
+
Respond to a clan membership request.
|
|
368
|
+
|
|
369
|
+
Args:
|
|
370
|
+
request_id: ID of the request to respond to
|
|
371
|
+
action: Action to take ("accept" or "reject")
|
|
372
|
+
message: Optional message for the response
|
|
373
|
+
|
|
374
|
+
Returns:
|
|
375
|
+
True if successful, False otherwise
|
|
376
|
+
"""
|
|
377
|
+
try:
|
|
378
|
+
result = self.client.respond_to_clan_request(request_id, action, message)
|
|
379
|
+
if 'error' not in result:
|
|
380
|
+
print(f"✅ Clan request {action}ed successfully")
|
|
381
|
+
return True
|
|
382
|
+
else:
|
|
383
|
+
print(f"❌ Failed to {action} clan request: {result.get('error', 'Unknown error')}")
|
|
384
|
+
return False
|
|
385
|
+
except Exception as e:
|
|
386
|
+
print(f"❌ Error responding to clan request: {e}")
|
|
387
|
+
return False
|
|
388
|
+
|
|
288
389
|
def get_inactive_members(self, days_inactive: int = 30) -> List[Dict[str, Any]]:
|
|
289
390
|
"""
|
|
290
391
|
Get members who haven't been active for specified days.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mc5_api_client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.13
|
|
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
|
|
@@ -108,9 +108,9 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
108
108
|
- ⚡ **One-Liner Functions**: Quick search and kick operations!
|
|
109
109
|
- 🎯 **User-Friendly**: Designed for beginners and clan leaders!
|
|
110
110
|
- 🚀 **NEW: Admin Capabilities**: Use admin credentials for enhanced squad management!
|
|
111
|
-
- ⭐ **NEW: Squad Rating**: Add 5200+ rating to your squad with admin privileges!
|
|
112
111
|
- 🎯 **NEW: Player Score Updates**: Update any player's score, XP, and kill signatures!
|
|
113
112
|
- 🛡️ **NEW: Built-in Help System**: Comprehensive help commands and examples!
|
|
113
|
+
- 🔐 **NEW: Encrypted Token Support**: Generate and encrypt tokens for additional security!
|
|
114
114
|
|
|
115
115
|
## 🚀 Installation
|
|
116
116
|
|
|
@@ -122,14 +122,14 @@ pip install mc5_api_client==1.0.8
|
|
|
122
122
|
|
|
123
123
|
### ✅ **Major Enhancements Completed!**
|
|
124
124
|
|
|
125
|
-
**🚀 Advanced Automation Features (NEW in v1.0.8):**
|
|
125
|
+
**🚀 Advanced Automation Features (NEW in v1.0.8+):**
|
|
126
126
|
- ✅ **AdminMC5Client**: Enhanced client with admin privileges
|
|
127
|
-
- ✅ **
|
|
128
|
-
- ✅ **Player Score Updates**: Update any player's score, XP, and kill signatures
|
|
127
|
+
- ✅ **Player Score Management**: Update individual player scores, XP, and kill signatures
|
|
129
128
|
- ✅ **Batch Processing**: Search multiple players with loops and conditionals
|
|
130
129
|
- ✅ **Real-time Monitoring**: Continuous activity tracking with while loops
|
|
131
130
|
- ✅ **Smart Clan Cleanup**: Intelligent member management with safety features
|
|
132
131
|
- ✅ **Built-in Help System**: Comprehensive help commands and examples
|
|
132
|
+
- ✅ **Encrypted Token Support**: Generate and encrypt tokens for additional security
|
|
133
133
|
- ✅ **Production Ready**: Thoroughly tested and verified for production use
|
|
134
134
|
|
|
135
135
|
**🎮 Revolutionary Simple Interface (from v1.0.7):**
|
|
@@ -174,12 +174,11 @@ pip install mc5_api_client
|
|
|
174
174
|
|
|
175
175
|
New in v1.0.8! Powerful admin capabilities for enhanced squad management:
|
|
176
176
|
|
|
177
|
-
### **⭐
|
|
178
|
-
|
|
177
|
+
### **⭐ Update Player Scores (Admin Only):**
|
|
179
178
|
```python
|
|
180
179
|
from mc5_api_client import quick_update_player_score
|
|
181
180
|
|
|
182
|
-
#
|
|
181
|
+
# Update any player's score, XP, and kill signature
|
|
183
182
|
result = quick_update_player_score(
|
|
184
183
|
target_user_id="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
185
184
|
score=5200,
|
|
@@ -188,48 +187,47 @@ result = quick_update_player_score(
|
|
|
188
187
|
killsig_id="default_killsig_80"
|
|
189
188
|
)
|
|
190
189
|
|
|
191
|
-
|
|
190
|
+
if result.get('success'):
|
|
191
|
+
print("✅ Player score updated successfully!")
|
|
192
|
+
print(f"New score: {result.get('score')}")
|
|
193
|
+
print(f"New XP: {result.get('xp')}")
|
|
192
194
|
```
|
|
193
195
|
|
|
194
|
-
###
|
|
195
|
-
|
|
196
|
+
### **� Admin Client Usage:**
|
|
196
197
|
```python
|
|
197
198
|
from mc5_api_client import create_admin_client
|
|
198
199
|
|
|
199
|
-
# Create admin client with
|
|
200
|
+
# Create admin client with elevated privileges
|
|
200
201
|
client = create_admin_client()
|
|
201
202
|
client.connect()
|
|
202
203
|
|
|
203
|
-
# Update
|
|
204
|
+
# Update player information
|
|
204
205
|
result = client.update_player_score(
|
|
205
206
|
target_user_id="player_user_id",
|
|
206
207
|
score=10000,
|
|
207
|
-
xp=5000000
|
|
208
|
+
xp=5000000,
|
|
209
|
+
killsig_color="16777215",
|
|
210
|
+
killsig_id="default_killsig_42"
|
|
208
211
|
)
|
|
209
212
|
|
|
210
|
-
# Get squad members
|
|
213
|
+
# Get squad members (if you have access)
|
|
211
214
|
members = client.get_squad_members()
|
|
212
|
-
print(f"
|
|
215
|
+
print(f"Found {len(members)} squad members")
|
|
216
|
+
|
|
217
|
+
# Kick members (if you have permissions)
|
|
218
|
+
# client.kick_member("member_user_id", "Reason for kick")
|
|
213
219
|
|
|
214
220
|
client.close()
|
|
215
221
|
```
|
|
216
222
|
|
|
217
|
-
###
|
|
223
|
+
### **⚠️ Important Admin Limitations:**
|
|
224
|
+
- ✅ **Can Update**: Individual player scores, XP, kill signatures
|
|
225
|
+
- ✅ **Can Kick**: Squad members (with proper permissions)
|
|
226
|
+
- ❌ **Cannot Edit**: Squad rating directly (requires squad ownership)
|
|
227
|
+
- ❌ **Cannot Modify**: Squad settings (requires squad ownership)
|
|
218
228
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
# Add rating using admin credentials
|
|
223
|
-
result = quick_add_squad_rating(
|
|
224
|
-
username="game:mc5_system",
|
|
225
|
-
password="admin",
|
|
226
|
-
rating=5200,
|
|
227
|
-
use_admin=True
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
if 'error' not in result:
|
|
231
|
-
print("✅ 5200 rating added to squad!")
|
|
232
|
-
```
|
|
229
|
+
### **🔧 How It Actually Works:**
|
|
230
|
+
Admin privileges allow you to modify individual player data within a squad, which indirectly affects the squad's overall rating through the sum of member scores, but you cannot directly set the squad's rating value.
|
|
233
231
|
|
|
234
232
|
## 🎮 **Simple Usage for Non-Developers**
|
|
235
233
|
|
|
@@ -400,8 +398,7 @@ client.connect()
|
|
|
400
398
|
player = client.search_player('f55f')
|
|
401
399
|
|
|
402
400
|
# 🔹 Admin Operations
|
|
403
|
-
quick_update_player_score('user_id', 5200)
|
|
404
|
-
quick_add_squad_rating('admin', 'admin', 5200, use_admin=True)
|
|
401
|
+
quick_update_player_score('user_id', 5200, xp=2037745)
|
|
405
402
|
|
|
406
403
|
# 🔹 Error Handling
|
|
407
404
|
try: except AuthenticationError:
|
|
@@ -413,10 +410,10 @@ try: except MC5APIError:
|
|
|
413
410
|
### **🚀 Install from PyPI (Recommended)**
|
|
414
411
|
|
|
415
412
|
```bash
|
|
416
|
-
pip install mc5_api_client==1.0.
|
|
413
|
+
pip install mc5_api_client==1.0.12
|
|
417
414
|
```
|
|
418
415
|
|
|
419
|
-
✅ **Published and Available!** The MC5 API Client v1.0.
|
|
416
|
+
✅ **Published and Available!** The MC5 API Client v1.0.12 is now live on PyPI with accurate admin capabilities, encrypted token support, and corrected documentation!
|
|
420
417
|
|
|
421
418
|
### **� Install from Local Package**
|
|
422
419
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{mc5_api_client-1.0.11 → mc5_api_client-1.0.13}/src/mc5_api_client.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|