mc5-api-client 1.0.19__tar.gz → 1.0.20__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.19/src/mc5_api_client.egg-info → mc5_api_client-1.0.20}/PKG-INFO +102 -6
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/README.md +101 -5
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/pyproject.toml +1 -1
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/setup.py +1 -1
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/__init__.py +1 -1
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20/src/mc5_api_client.egg-info}/PKG-INFO +102 -6
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/.gitignore +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/LICENSE +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/MANIFEST.in +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/admin_squad_management.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/admin_tools.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/advanced_automation.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/advanced_features.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/authentication_example.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/basic_usage.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/clan_management.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/clan_management_complete.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/device_id_example.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/events_and_tasks.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/everyday_mc5.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/everyday_mc5_easy.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/game_launch_example.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/help_system.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/message_management.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/player_stats.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/private_messaging.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/quick_help.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/quick_reference.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/service_location_example.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/simple_usage.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/squad_management.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/examples/squad_wall_management.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/requirements.txt +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/setup.cfg +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/account.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/account_quick.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/admin_client.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/alerts.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/alerts_quick.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/auth.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/cli.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/client.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/debug.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/easy_mc5.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/exceptions.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/federation.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/federation_quick.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/help.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/pc_storage_client.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/pc_storage_quick.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/platform.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/py.typed +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/simple_client.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/squad_battle.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/squad_battle_quick.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/storage_admin.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/telemetry.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/transfer.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client/transfer_quick.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client.egg-info/SOURCES.txt +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client.egg-info/dependency_links.txt +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client.egg-info/entry_points.txt +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client.egg-info/not-zip-safe +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client.egg-info/requires.txt +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/src/mc5_api_client.egg-info/top_level.txt +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/tests/__init__.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/tests/test_auth.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/tests/test_cli.py +0 -0
- {mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/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.20
|
|
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
|
|
@@ -143,10 +143,109 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
143
143
|
### 🎉 MC5 API Client v1.0.18 - Super Easy Interface & Clean API!
|
|
144
144
|
|
|
145
145
|
```bash
|
|
146
|
-
pip install mc5_api_client==1.0.
|
|
146
|
+
pip install mc5_api_client==1.0.20
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
## 🎯 **Usage Examples**
|
|
150
|
+
|
|
151
|
+
### **🎮 Basic Usage (MC5Client)**
|
|
152
|
+
```python
|
|
153
|
+
from mc5_api_client import MC5Client
|
|
154
|
+
|
|
155
|
+
# Initialize the client
|
|
156
|
+
client = MC5Client(
|
|
157
|
+
client_id="1875:55979:6.0.0a:windows:windows",
|
|
158
|
+
username="your_credential",
|
|
159
|
+
password="your_password"
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
# Authenticate
|
|
163
|
+
client.authenticate()
|
|
164
|
+
|
|
165
|
+
# Get profile
|
|
166
|
+
profile = client.get_profile()
|
|
167
|
+
print(f"Profile: {profile}")
|
|
168
|
+
|
|
169
|
+
# Get events
|
|
170
|
+
events = client.get_events()
|
|
171
|
+
print(f"Events: {len(events)} found")
|
|
172
|
+
|
|
173
|
+
# Server status (NEW!)
|
|
174
|
+
status = client.get_server_status()
|
|
175
|
+
print(f"Server Status: {status['status']}")
|
|
176
|
+
|
|
177
|
+
# Close connection
|
|
178
|
+
client.close()
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### **🎯 MC5ApiClient (Backward Compatible)**
|
|
182
|
+
```python
|
|
183
|
+
from mc5_api_client import MC5ApiClient
|
|
184
|
+
|
|
185
|
+
# MC5ApiClient is an alias for MC5Client
|
|
186
|
+
client = MC5ApiClient(
|
|
187
|
+
client_id="1875:55979:6.0.0a:windows:windows",
|
|
188
|
+
username="your_credential",
|
|
189
|
+
password="your_password"
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
# Use the same methods as MC5Client
|
|
193
|
+
client.authenticate()
|
|
194
|
+
status = client.get_server_status()
|
|
195
|
+
info = client.get_server_info()
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### **🔧 Quick Functions (Standalone)**
|
|
199
|
+
```python
|
|
200
|
+
from mc5_api_client import quick_get_account_info, quick_get_active_sessions
|
|
201
|
+
|
|
202
|
+
# Quick functions are standalone, not client methods
|
|
203
|
+
# They require credentials as parameters
|
|
204
|
+
account_info = quick_get_account_info("your_credential", "your_password")
|
|
205
|
+
sessions = quick_get_active_sessions("your_password")
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### **🎮 Game Launch & Service Location (NEW!)**
|
|
209
|
+
```python
|
|
210
|
+
from mc5_api_client import MC5Easy, get_all_services, create_federation_session
|
|
211
|
+
|
|
212
|
+
# Get all MC5 services dynamically
|
|
213
|
+
services = get_all_services()
|
|
214
|
+
print(f"Found {len(services)} services:")
|
|
215
|
+
for service, endpoint in services.items():
|
|
216
|
+
print(f" {service}: {endpoint}")
|
|
217
|
+
|
|
218
|
+
# Create federation session for game launch
|
|
219
|
+
session = create_federation_session(username, password)
|
|
220
|
+
if session.get("success"):
|
|
221
|
+
print(f"Room ID: {session['room_id']}")
|
|
222
|
+
print(f"Controller: {session['controller_host']}")
|
|
223
|
+
|
|
224
|
+
# Or use MC5Easy for complete game management
|
|
225
|
+
with MC5Easy(username, password) as mc5:
|
|
226
|
+
launch_info = mc5.launch_game_session()
|
|
227
|
+
print(f"Game ready: {launch_info['launch_command']}")
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### **🌐 Global ID & Device Management (NEW!)**
|
|
231
|
+
```python
|
|
232
|
+
from mc5_api_client import get_global_id, generate_device_id
|
|
233
|
+
|
|
234
|
+
# Get global device ID
|
|
235
|
+
global_id = get_global_id()
|
|
236
|
+
print(f"Global ID: {global_id}")
|
|
237
|
+
|
|
238
|
+
# Generate unique device ID
|
|
239
|
+
device_id = generate_device_id()
|
|
240
|
+
print(f"Device ID: {device_id}")
|
|
241
|
+
|
|
242
|
+
# With MC5Easy
|
|
243
|
+
with MC5Easy(username, password) as mc5:
|
|
244
|
+
device_info = mc5.get_device_info()
|
|
245
|
+
print(f"Device: {device_info}")
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## 📱 **Run Examples:** Completed!
|
|
150
249
|
|
|
151
250
|
**🎯 Super Easy Interface (NEW in v1.0.18):**
|
|
152
251
|
- ✅ **MC5Easy Module** - One-line functions for everyday tasks
|
|
@@ -1348,8 +1447,6 @@ finally:
|
|
|
1348
1447
|
**Security Benefits:**
|
|
1349
1448
|
- ✅ **Additional Layer**: Tokens are encrypted before transmission
|
|
1350
1449
|
- ✅ **Custom Nonce**: Support for custom nonce values
|
|
1351
|
-
- ✅ **Backward Compatible**: Works with existing authentication flow
|
|
1352
|
-
- ✅ **Error Handling**: Proper validation and error recovery
|
|
1353
1450
|
|
|
1354
1451
|
### 🏆 **Checking Leaderboards**
|
|
1355
1452
|
|
|
@@ -1369,7 +1466,6 @@ if hasattr(client, 'get_leaderboard'):
|
|
|
1369
1466
|
# print(f"Top {len(leaderboard.get('players', []))} players")
|
|
1370
1467
|
else:
|
|
1371
1468
|
print("❌ get_leaderboard method not found")
|
|
1372
|
-
```
|
|
1373
1469
|
|
|
1374
1470
|
### 🖥️ CLI Commands - Currently Available
|
|
1375
1471
|
|
|
@@ -65,10 +65,109 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
65
65
|
### 🎉 MC5 API Client v1.0.18 - Super Easy Interface & Clean API!
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
pip install mc5_api_client==1.0.
|
|
68
|
+
pip install mc5_api_client==1.0.20
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
## 🎯 **Usage Examples**
|
|
72
|
+
|
|
73
|
+
### **🎮 Basic Usage (MC5Client)**
|
|
74
|
+
```python
|
|
75
|
+
from mc5_api_client import MC5Client
|
|
76
|
+
|
|
77
|
+
# Initialize the client
|
|
78
|
+
client = MC5Client(
|
|
79
|
+
client_id="1875:55979:6.0.0a:windows:windows",
|
|
80
|
+
username="your_credential",
|
|
81
|
+
password="your_password"
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# Authenticate
|
|
85
|
+
client.authenticate()
|
|
86
|
+
|
|
87
|
+
# Get profile
|
|
88
|
+
profile = client.get_profile()
|
|
89
|
+
print(f"Profile: {profile}")
|
|
90
|
+
|
|
91
|
+
# Get events
|
|
92
|
+
events = client.get_events()
|
|
93
|
+
print(f"Events: {len(events)} found")
|
|
94
|
+
|
|
95
|
+
# Server status (NEW!)
|
|
96
|
+
status = client.get_server_status()
|
|
97
|
+
print(f"Server Status: {status['status']}")
|
|
98
|
+
|
|
99
|
+
# Close connection
|
|
100
|
+
client.close()
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### **🎯 MC5ApiClient (Backward Compatible)**
|
|
104
|
+
```python
|
|
105
|
+
from mc5_api_client import MC5ApiClient
|
|
106
|
+
|
|
107
|
+
# MC5ApiClient is an alias for MC5Client
|
|
108
|
+
client = MC5ApiClient(
|
|
109
|
+
client_id="1875:55979:6.0.0a:windows:windows",
|
|
110
|
+
username="your_credential",
|
|
111
|
+
password="your_password"
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
# Use the same methods as MC5Client
|
|
115
|
+
client.authenticate()
|
|
116
|
+
status = client.get_server_status()
|
|
117
|
+
info = client.get_server_info()
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### **🔧 Quick Functions (Standalone)**
|
|
121
|
+
```python
|
|
122
|
+
from mc5_api_client import quick_get_account_info, quick_get_active_sessions
|
|
123
|
+
|
|
124
|
+
# Quick functions are standalone, not client methods
|
|
125
|
+
# They require credentials as parameters
|
|
126
|
+
account_info = quick_get_account_info("your_credential", "your_password")
|
|
127
|
+
sessions = quick_get_active_sessions("your_password")
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### **🎮 Game Launch & Service Location (NEW!)**
|
|
131
|
+
```python
|
|
132
|
+
from mc5_api_client import MC5Easy, get_all_services, create_federation_session
|
|
133
|
+
|
|
134
|
+
# Get all MC5 services dynamically
|
|
135
|
+
services = get_all_services()
|
|
136
|
+
print(f"Found {len(services)} services:")
|
|
137
|
+
for service, endpoint in services.items():
|
|
138
|
+
print(f" {service}: {endpoint}")
|
|
139
|
+
|
|
140
|
+
# Create federation session for game launch
|
|
141
|
+
session = create_federation_session(username, password)
|
|
142
|
+
if session.get("success"):
|
|
143
|
+
print(f"Room ID: {session['room_id']}")
|
|
144
|
+
print(f"Controller: {session['controller_host']}")
|
|
145
|
+
|
|
146
|
+
# Or use MC5Easy for complete game management
|
|
147
|
+
with MC5Easy(username, password) as mc5:
|
|
148
|
+
launch_info = mc5.launch_game_session()
|
|
149
|
+
print(f"Game ready: {launch_info['launch_command']}")
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### **🌐 Global ID & Device Management (NEW!)**
|
|
153
|
+
```python
|
|
154
|
+
from mc5_api_client import get_global_id, generate_device_id
|
|
155
|
+
|
|
156
|
+
# Get global device ID
|
|
157
|
+
global_id = get_global_id()
|
|
158
|
+
print(f"Global ID: {global_id}")
|
|
159
|
+
|
|
160
|
+
# Generate unique device ID
|
|
161
|
+
device_id = generate_device_id()
|
|
162
|
+
print(f"Device ID: {device_id}")
|
|
163
|
+
|
|
164
|
+
# With MC5Easy
|
|
165
|
+
with MC5Easy(username, password) as mc5:
|
|
166
|
+
device_info = mc5.get_device_info()
|
|
167
|
+
print(f"Device: {device_info}")
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 📱 **Run Examples:** Completed!
|
|
72
171
|
|
|
73
172
|
**🎯 Super Easy Interface (NEW in v1.0.18):**
|
|
74
173
|
- ✅ **MC5Easy Module** - One-line functions for everyday tasks
|
|
@@ -1270,8 +1369,6 @@ finally:
|
|
|
1270
1369
|
**Security Benefits:**
|
|
1271
1370
|
- ✅ **Additional Layer**: Tokens are encrypted before transmission
|
|
1272
1371
|
- ✅ **Custom Nonce**: Support for custom nonce values
|
|
1273
|
-
- ✅ **Backward Compatible**: Works with existing authentication flow
|
|
1274
|
-
- ✅ **Error Handling**: Proper validation and error recovery
|
|
1275
1372
|
|
|
1276
1373
|
### 🏆 **Checking Leaderboards**
|
|
1277
1374
|
|
|
@@ -1291,7 +1388,6 @@ if hasattr(client, 'get_leaderboard'):
|
|
|
1291
1388
|
# print(f"Top {len(leaderboard.get('players', []))} players")
|
|
1292
1389
|
else:
|
|
1293
1390
|
print("❌ get_leaderboard method not found")
|
|
1294
|
-
```
|
|
1295
1391
|
|
|
1296
1392
|
### 🖥️ CLI Commands - Currently Available
|
|
1297
1393
|
|
|
@@ -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.20"
|
|
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"}
|
|
@@ -33,7 +33,7 @@ def read_requirements():
|
|
|
33
33
|
setup(
|
|
34
34
|
name="mc5_api_client",
|
|
35
35
|
use_scm_version=False,
|
|
36
|
-
version="1.0.
|
|
36
|
+
version="1.0.20",
|
|
37
37
|
description="A comprehensive Python library for interacting with the Modern Combat 5 API",
|
|
38
38
|
long_description=read_readme(),
|
|
39
39
|
long_description_content_type="text/markdown",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mc5_api_client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.20
|
|
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
|
|
@@ -143,10 +143,109 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
143
143
|
### 🎉 MC5 API Client v1.0.18 - Super Easy Interface & Clean API!
|
|
144
144
|
|
|
145
145
|
```bash
|
|
146
|
-
pip install mc5_api_client==1.0.
|
|
146
|
+
pip install mc5_api_client==1.0.20
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
## 🎯 **Usage Examples**
|
|
150
|
+
|
|
151
|
+
### **🎮 Basic Usage (MC5Client)**
|
|
152
|
+
```python
|
|
153
|
+
from mc5_api_client import MC5Client
|
|
154
|
+
|
|
155
|
+
# Initialize the client
|
|
156
|
+
client = MC5Client(
|
|
157
|
+
client_id="1875:55979:6.0.0a:windows:windows",
|
|
158
|
+
username="your_credential",
|
|
159
|
+
password="your_password"
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
# Authenticate
|
|
163
|
+
client.authenticate()
|
|
164
|
+
|
|
165
|
+
# Get profile
|
|
166
|
+
profile = client.get_profile()
|
|
167
|
+
print(f"Profile: {profile}")
|
|
168
|
+
|
|
169
|
+
# Get events
|
|
170
|
+
events = client.get_events()
|
|
171
|
+
print(f"Events: {len(events)} found")
|
|
172
|
+
|
|
173
|
+
# Server status (NEW!)
|
|
174
|
+
status = client.get_server_status()
|
|
175
|
+
print(f"Server Status: {status['status']}")
|
|
176
|
+
|
|
177
|
+
# Close connection
|
|
178
|
+
client.close()
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### **🎯 MC5ApiClient (Backward Compatible)**
|
|
182
|
+
```python
|
|
183
|
+
from mc5_api_client import MC5ApiClient
|
|
184
|
+
|
|
185
|
+
# MC5ApiClient is an alias for MC5Client
|
|
186
|
+
client = MC5ApiClient(
|
|
187
|
+
client_id="1875:55979:6.0.0a:windows:windows",
|
|
188
|
+
username="your_credential",
|
|
189
|
+
password="your_password"
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
# Use the same methods as MC5Client
|
|
193
|
+
client.authenticate()
|
|
194
|
+
status = client.get_server_status()
|
|
195
|
+
info = client.get_server_info()
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### **🔧 Quick Functions (Standalone)**
|
|
199
|
+
```python
|
|
200
|
+
from mc5_api_client import quick_get_account_info, quick_get_active_sessions
|
|
201
|
+
|
|
202
|
+
# Quick functions are standalone, not client methods
|
|
203
|
+
# They require credentials as parameters
|
|
204
|
+
account_info = quick_get_account_info("your_credential", "your_password")
|
|
205
|
+
sessions = quick_get_active_sessions("your_password")
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### **🎮 Game Launch & Service Location (NEW!)**
|
|
209
|
+
```python
|
|
210
|
+
from mc5_api_client import MC5Easy, get_all_services, create_federation_session
|
|
211
|
+
|
|
212
|
+
# Get all MC5 services dynamically
|
|
213
|
+
services = get_all_services()
|
|
214
|
+
print(f"Found {len(services)} services:")
|
|
215
|
+
for service, endpoint in services.items():
|
|
216
|
+
print(f" {service}: {endpoint}")
|
|
217
|
+
|
|
218
|
+
# Create federation session for game launch
|
|
219
|
+
session = create_federation_session(username, password)
|
|
220
|
+
if session.get("success"):
|
|
221
|
+
print(f"Room ID: {session['room_id']}")
|
|
222
|
+
print(f"Controller: {session['controller_host']}")
|
|
223
|
+
|
|
224
|
+
# Or use MC5Easy for complete game management
|
|
225
|
+
with MC5Easy(username, password) as mc5:
|
|
226
|
+
launch_info = mc5.launch_game_session()
|
|
227
|
+
print(f"Game ready: {launch_info['launch_command']}")
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### **🌐 Global ID & Device Management (NEW!)**
|
|
231
|
+
```python
|
|
232
|
+
from mc5_api_client import get_global_id, generate_device_id
|
|
233
|
+
|
|
234
|
+
# Get global device ID
|
|
235
|
+
global_id = get_global_id()
|
|
236
|
+
print(f"Global ID: {global_id}")
|
|
237
|
+
|
|
238
|
+
# Generate unique device ID
|
|
239
|
+
device_id = generate_device_id()
|
|
240
|
+
print(f"Device ID: {device_id}")
|
|
241
|
+
|
|
242
|
+
# With MC5Easy
|
|
243
|
+
with MC5Easy(username, password) as mc5:
|
|
244
|
+
device_info = mc5.get_device_info()
|
|
245
|
+
print(f"Device: {device_info}")
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## 📱 **Run Examples:** Completed!
|
|
150
249
|
|
|
151
250
|
**🎯 Super Easy Interface (NEW in v1.0.18):**
|
|
152
251
|
- ✅ **MC5Easy Module** - One-line functions for everyday tasks
|
|
@@ -1348,8 +1447,6 @@ finally:
|
|
|
1348
1447
|
**Security Benefits:**
|
|
1349
1448
|
- ✅ **Additional Layer**: Tokens are encrypted before transmission
|
|
1350
1449
|
- ✅ **Custom Nonce**: Support for custom nonce values
|
|
1351
|
-
- ✅ **Backward Compatible**: Works with existing authentication flow
|
|
1352
|
-
- ✅ **Error Handling**: Proper validation and error recovery
|
|
1353
1450
|
|
|
1354
1451
|
### 🏆 **Checking Leaderboards**
|
|
1355
1452
|
|
|
@@ -1369,7 +1466,6 @@ if hasattr(client, 'get_leaderboard'):
|
|
|
1369
1466
|
# print(f"Top {len(leaderboard.get('players', []))} players")
|
|
1370
1467
|
else:
|
|
1371
1468
|
print("❌ get_leaderboard method not found")
|
|
1372
|
-
```
|
|
1373
1469
|
|
|
1374
1470
|
### 🖥️ CLI Commands - Currently Available
|
|
1375
1471
|
|
|
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
|
|
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.19 → mc5_api_client-1.0.20}/src/mc5_api_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{mc5_api_client-1.0.19 → mc5_api_client-1.0.20}/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
|