mc5-api-client 1.0.17__tar.gz → 1.0.19__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.
Files changed (72) hide show
  1. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/PKG-INFO +165 -20
  2. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/README.md +164 -19
  3. mc5_api_client-1.0.19/examples/authentication_example.py +195 -0
  4. mc5_api_client-1.0.19/examples/device_id_example.py +199 -0
  5. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/everyday_mc5.py +3 -3
  6. mc5_api_client-1.0.19/examples/everyday_mc5_easy.py +186 -0
  7. mc5_api_client-1.0.19/examples/game_launch_example.py +271 -0
  8. mc5_api_client-1.0.19/examples/service_location_example.py +281 -0
  9. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/pyproject.toml +1 -1
  10. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/setup.py +1 -1
  11. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/__init__.py +195 -7
  12. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/client.py +92 -16
  13. mc5_api_client-1.0.19/src/mc5_api_client/easy_mc5.py +682 -0
  14. mc5_api_client-1.0.19/src/mc5_api_client/pc_storage_client.py +229 -0
  15. mc5_api_client-1.0.19/src/mc5_api_client/pc_storage_quick.py +234 -0
  16. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/platform.py +3 -4
  17. mc5_api_client-1.0.19/src/mc5_api_client/storage_admin.py +285 -0
  18. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client.egg-info/PKG-INFO +165 -20
  19. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client.egg-info/SOURCES.txt +9 -3
  20. mc5_api_client-1.0.17/CHANGELOG.md +0 -332
  21. mc5_api_client-1.0.17/pytest.ini +0 -16
  22. mc5_api_client-1.0.17/requirements-dev.txt +0 -25
  23. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/.gitignore +0 -0
  24. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/LICENSE +0 -0
  25. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/MANIFEST.in +0 -0
  26. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/admin_squad_management.py +0 -0
  27. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/admin_tools.py +0 -0
  28. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/advanced_automation.py +0 -0
  29. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/advanced_features.py +0 -0
  30. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/basic_usage.py +0 -0
  31. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/clan_management.py +0 -0
  32. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/clan_management_complete.py +0 -0
  33. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/events_and_tasks.py +0 -0
  34. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/help_system.py +0 -0
  35. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/message_management.py +0 -0
  36. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/player_stats.py +0 -0
  37. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/private_messaging.py +0 -0
  38. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/quick_help.py +0 -0
  39. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/quick_reference.py +0 -0
  40. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/simple_usage.py +0 -0
  41. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/squad_management.py +0 -0
  42. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/examples/squad_wall_management.py +0 -0
  43. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/requirements.txt +0 -0
  44. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/setup.cfg +0 -0
  45. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/account.py +0 -0
  46. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/account_quick.py +0 -0
  47. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/admin_client.py +0 -0
  48. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/alerts.py +0 -0
  49. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/alerts_quick.py +0 -0
  50. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/auth.py +0 -0
  51. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/cli.py +0 -0
  52. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/debug.py +0 -0
  53. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/exceptions.py +0 -0
  54. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/federation.py +0 -0
  55. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/federation_quick.py +0 -0
  56. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/help.py +0 -0
  57. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/py.typed +0 -0
  58. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/simple_client.py +0 -0
  59. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/squad_battle.py +0 -0
  60. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/squad_battle_quick.py +0 -0
  61. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/telemetry.py +0 -0
  62. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/transfer.py +0 -0
  63. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client/transfer_quick.py +0 -0
  64. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client.egg-info/dependency_links.txt +0 -0
  65. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client.egg-info/entry_points.txt +0 -0
  66. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client.egg-info/not-zip-safe +0 -0
  67. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client.egg-info/requires.txt +0 -0
  68. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/src/mc5_api_client.egg-info/top_level.txt +0 -0
  69. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/tests/__init__.py +0 -0
  70. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/tests/test_auth.py +0 -0
  71. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/tests/test_cli.py +0 -0
  72. {mc5_api_client-1.0.17 → mc5_api_client-1.0.19}/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.17
3
+ Version: 1.0.19
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
@@ -81,23 +81,32 @@ Dynamic: requires-python
81
81
  [![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://python.org)
82
82
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
83
83
  [![Author](https://img.shields.io/badge/author-Chizoba-orange.svg)](mailto:chizoba2026@hotmail.com)
84
- [![PyPI Version](https://img.shields.io/badge/pypi-1.0.17-blue.svg)](https://pypi.org/project/mc5-api-client/)
84
+ [![PyPI Version](https://img.shields.io/badge/pypi-1.0.18-blue.svg)](https://pypi.org/project/mc5-api-client/)
85
85
  [![Production Ready](https://img.shields.io/badge/production-ready-brightgreen.svg)](https://pypi.org/project/mc5-api-client/)
86
86
 
87
87
  Hey there! 👋 Welcome to the **Modern Combat 5 API Client** - Comprehensive Python library for interacting with Modern Combat 5 game servers
88
88
 
89
- ## ✨ **New in v1.0.17: Enhanced Android Support & Squad Management!**
90
-
91
- - 📱 **NEW: Android Friend Removal** - Remove friends and send notifications
92
- - 🏰 **NEW: Android Squad Editing** - Complete squad management with rating updates
93
- - 🗑️ **NEW: Friend Management** - Complete friend lifecycle (add, check, remove, notify)
94
- - 📊 **Enhanced Squad Features** - Update squad info, rating, member limits, and more
95
- - 🔄 **Platform Switching** - Switch between PC and Android at runtime
96
- - 📊 **Automatic Error Reporting** - Errors sent to Discord webhook for debugging
97
- - 🔍 **Enhanced Debug Mode** - One-command debugging with colored output
98
- - **Performance Monitoring** - Automatic timing and performance metrics
99
- - 🛠 **Better Error Analysis** - Intelligent suggestions based on error types
100
- - 🎯 **Production Ready** - Comprehensive logging and monitoring system
89
+ ## ✨ **New in v1.0.18: Super Easy Interface & Complete Game Management!**
90
+
91
+ - 🎯 **NEW: MC5Easy** - Super simple one-line functions for everyday tasks
92
+ - 🚀 **NEW: One-Liner Functions** - `check_my_daily_tasks()`, `get_my_mc5_profile()`, `find_mc5_player()`
93
+ - 📝 **NEW: Context Manager** - Auto-connect and auto-cleanup with `with MC5Easy()`
94
+ - 🔧 **NEW: Environment Variables** - Secure credential management with `MC5_USERNAME` and `MC5_PASSWORD`
95
+ - 🌐 **NEW: Service Location** - Dynamic MC5 service endpoint discovery
96
+ - 🎮 **NEW: Federation Sessions** - Complete game launch preparation
97
+ - 🌍 **NEW: Global ID Management** - Device tracking and identification
98
+ - 🔗 **NEW: Connection Monitoring** - Service health and status tracking
99
+ - 🏠 **NEW: Room Discovery** - Find available game rooms
100
+ - 🏰 **PC Storage Admin** - Complete squad management with storage scopes
101
+ - 🔧 **StorageAdminMixin** - Core storage functionality for advanced operations
102
+ - 👤 **System Account Access** - 5 working system accounts discovered
103
+ - 🎯 **Owner Identification** - Complete squad ownership analysis
104
+ - 📊 **Squad Management** - Full CRUD operations for squad data
105
+ - 🛡️ **Security Enhanced** - All credentials sanitized and production ready
106
+ - 📁 **Clean Structure** - Organized file structure for production deployment
107
+ - 🚀 **Performance Optimized** - Removed debug files and optimized for production
108
+ - 📚 **Better Documentation** - Reorganized docs in proper structure
109
+ - 🔒 **Credential Security** - Complete security cleanup implemented
101
110
 
102
111
  ## 🌟 What Can You Do With This?
103
112
 
@@ -131,13 +140,149 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
131
140
 
132
141
  ## 🚀 Installation
133
142
 
134
- ### 🎉 MC5 API Client v1.0.17 - Enhanced Android & Squad Management!
143
+ ### 🎉 MC5 API Client v1.0.18 - Super Easy Interface & Clean API!
144
+
145
+ ```bash
146
+ pip install mc5_api_client==1.0.18
147
+ ```
148
+
149
+ ### ✅ **Major Features Completed!**
150
+
151
+ **🎯 Super Easy Interface (NEW in v1.0.18):**
152
+ - ✅ **MC5Easy Module** - One-line functions for everyday tasks
153
+ - ✅ **Context Manager** - Auto-connect and auto-cleanup with `with MC5Easy()`
154
+ - ✅ **Environment Variables** - Secure credential management
155
+ - ✅ **One-Liner Functions** - `check_my_daily_tasks()`, `get_my_mc5_profile()`, `find_mc5_player()`
156
+ - ✅ **Clean Function Names** - Removed ugly "quick_" prefixes
157
+ - ✅ **Authentication Examples** - Complete authentication guide
158
+
159
+ **🏰 PC Storage Admin (NEW in v1.0.18):**
160
+ - ✅ **PC Storage Admin** - Complete squad management with storage scopes
161
+ - ✅ **StorageAdminMixin** - Core storage functionality for advanced operations
162
+ - ✅ **System Account Access** - 5 working system accounts discovered
163
+ - ✅ **Owner Identification** - Complete squad ownership analysis
164
+ - ✅ **Squad Management** - Full CRUD operations for squad data
165
+
166
+ **🛡️ Production Ready (NEW in v1.0.18):**
167
+ - ✅ **Security Enhanced** - All credentials sanitized and production ready
168
+ - ✅ **Clean Structure** - Organized file structure for production deployment
169
+ - ✅ **Performance Optimized** - Removed debug files and optimized for production
170
+ - ✅ **Better Documentation** - Reorganized docs in proper structure
171
+ - ✅ **Credential Security** - Complete security cleanup implemented
172
+
173
+ ## 🎯 **Super Easy Usage - NEW!**
174
+
175
+ ### **🚀 One-Line Functions for Everyday Tasks**
176
+
177
+ ```python
178
+ from mc5_api_client import MC5Easy, check_my_daily_tasks, get_my_mc5_profile
179
+
180
+ # Method 1: Super simple one-liners (with environment variables)
181
+ tasks = check_my_daily_tasks() # Returns your daily tasks
182
+ profile = get_my_mc5_profile() # Returns your profile stats
183
+ player = find_mc5_player("f55f") # Find any player
184
+ send_mc5_message("f55f", "Hello!") # Send message
185
+
186
+ # Method 2: Easy context manager (auto-connect & cleanup)
187
+ with MC5Easy() as mc5:
188
+ tasks = mc5.check_daily_tasks()
189
+ profile = mc5.get_my_stats()
190
+ player = mc5.find_player("f55f")
191
+ mc5.send_message_to_friend("f55f", "Hello!")
192
+ mc5.broadcast_to_clan("Hello clan!")
193
+
194
+ # Method 3: Environment variables (recommended)
195
+ # Set these once:
196
+ export MC5_USERNAME="your_credential"
197
+ export MC5_PASSWORD="your_password"
198
+
199
+ # Then use any function without credentials:
200
+ with MC5Easy() as mc5: # Auto-uses environment variables
201
+ print(mc5.quick_status()) # Quick status overview
202
+ mc5.run_daily_routine() # Complete daily routine
203
+ ```
204
+
205
+ ### **🔧 Set Up Environment Variables (Recommended)**
135
206
 
136
207
  ```bash
137
- pip install mc5_api_client==1.0.17
208
+ # Windows (Command Prompt)
209
+ set MC5_USERNAME=anonymous:your_credential_here
210
+ set MC5_PASSWORD=your_password_here
211
+
212
+ # Windows (PowerShell)
213
+ $env:MC5_USERNAME="anonymous:your_credential_here"
214
+ $env:MC5_PASSWORD="your_password_here"
215
+
216
+ # Linux/Mac
217
+ export MC5_USERNAME="anonymous:your_credential_here"
218
+ export MC5_PASSWORD="your_password_here"
138
219
  ```
139
220
 
140
- ### **Major Enhancements Completed!**
221
+ ### **📱 Run Examples:**
222
+
223
+ ```bash
224
+ # Set your environment variables first, then:
225
+ python examples/everyday_mc5_easy.py
226
+
227
+ # Service location and game launch:
228
+ python examples/service_location_example.py
229
+
230
+ # Game launch and federation sessions:
231
+ python examples/game_launch_example.py
232
+
233
+ # Device ID management:
234
+ python examples/device_id_example.py
235
+
236
+ # Authentication examples:
237
+ python examples/authentication_example.py
238
+
239
+ # Basic usage:
240
+ python examples/basic_usage.py
241
+
242
+ # Or see one-liner demos:
243
+ python examples/everyday_mc5_easy.py --demo
244
+ ```
245
+
246
+ ### **🌐 Service Location & Game Launch (NEW!)**
247
+
248
+ ```python
249
+ from mc5_api_client import locate_service, get_all_services, create_federation_session
250
+
251
+ # Get all MC5 services dynamically
252
+ services = get_all_services()
253
+ print(f"Found {len(services)} services:")
254
+ for service, endpoint in services.items():
255
+ print(f" {service}: {endpoint}")
256
+
257
+ # Find specific service
258
+ auth_endpoint = locate_service("auth")
259
+ print(f"Auth service: {auth_endpoint}")
260
+
261
+ # Create federation session for game launch
262
+ session = create_federation_session(username, password)
263
+ if session.get("success"):
264
+ print(f"Room ID: {session['room_id']}")
265
+ print(f"Controller: {session['controller_host']}")
266
+ ```
267
+
268
+ ### **🌐 Global ID & Device Management (NEW!)**
269
+
270
+ ```python
271
+ from mc5_api_client import get_global_id, generate_device_id
272
+
273
+ # Get global device ID
274
+ global_id = get_global_id()
275
+ print(f"Global ID: {global_id}")
276
+
277
+ # Generate unique device ID
278
+ device_id = generate_device_id()
279
+ print(f"Device ID: {device_id}")
280
+
281
+ # With MC5Easy
282
+ with MC5Easy() as mc5:
283
+ device_info = mc5.get_device_info()
284
+ print(f"Device: {device_info}")
285
+ ```
141
286
 
142
287
  **� Android Squad Management (NEW in v1.0.17):**
143
288
  - ✅ **Squad Information Retrieval**: Get current squad info, rating, and settings
@@ -1153,10 +1298,10 @@ for event in events:
1153
1298
  For users who prefer additional security, the module now supports token encryption:
1154
1299
 
1155
1300
  ```python
1156
- from mc5_api_client import quick_generate_encrypted_token, quick_encrypt_token
1301
+ from mc5_api_client import generate_encrypted_token, encrypt_token
1157
1302
 
1158
1303
  # Generate and encrypt a token in one step
1159
- encrypted_data = quick_generate_encrypted_token(
1304
+ encrypted_data = generate_encrypted_token(
1160
1305
  username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
1161
1306
  password="sSJKzhQ5l4vrFgov",
1162
1307
  nonce="*" # Custom nonce value (optional)
@@ -1168,7 +1313,7 @@ print(f"Expires: {encrypted_data['expires_at']}")
1168
1313
 
1169
1314
  # Encrypt an existing token
1170
1315
  existing_token = "your_raw_access_token_here"
1171
- encrypted_token = quick_encrypt_token(existing_token, "*")
1316
+ encrypted_token = encrypt_token(existing_token, "*")
1172
1317
  print(f"Encrypted: {encrypted_token}")
1173
1318
  ```
1174
1319
 
@@ -3,23 +3,32 @@
3
3
  [![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://python.org)
4
4
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
5
5
  [![Author](https://img.shields.io/badge/author-Chizoba-orange.svg)](mailto:chizoba2026@hotmail.com)
6
- [![PyPI Version](https://img.shields.io/badge/pypi-1.0.17-blue.svg)](https://pypi.org/project/mc5-api-client/)
6
+ [![PyPI Version](https://img.shields.io/badge/pypi-1.0.18-blue.svg)](https://pypi.org/project/mc5-api-client/)
7
7
  [![Production Ready](https://img.shields.io/badge/production-ready-brightgreen.svg)](https://pypi.org/project/mc5-api-client/)
8
8
 
9
9
  Hey there! 👋 Welcome to the **Modern Combat 5 API Client** - Comprehensive Python library for interacting with Modern Combat 5 game servers
10
10
 
11
- ## ✨ **New in v1.0.17: Enhanced Android Support & Squad Management!**
12
-
13
- - 📱 **NEW: Android Friend Removal** - Remove friends and send notifications
14
- - 🏰 **NEW: Android Squad Editing** - Complete squad management with rating updates
15
- - 🗑️ **NEW: Friend Management** - Complete friend lifecycle (add, check, remove, notify)
16
- - 📊 **Enhanced Squad Features** - Update squad info, rating, member limits, and more
17
- - 🔄 **Platform Switching** - Switch between PC and Android at runtime
18
- - 📊 **Automatic Error Reporting** - Errors sent to Discord webhook for debugging
19
- - 🔍 **Enhanced Debug Mode** - One-command debugging with colored output
20
- - **Performance Monitoring** - Automatic timing and performance metrics
21
- - 🛠 **Better Error Analysis** - Intelligent suggestions based on error types
22
- - 🎯 **Production Ready** - Comprehensive logging and monitoring system
11
+ ## ✨ **New in v1.0.18: Super Easy Interface & Complete Game Management!**
12
+
13
+ - 🎯 **NEW: MC5Easy** - Super simple one-line functions for everyday tasks
14
+ - 🚀 **NEW: One-Liner Functions** - `check_my_daily_tasks()`, `get_my_mc5_profile()`, `find_mc5_player()`
15
+ - 📝 **NEW: Context Manager** - Auto-connect and auto-cleanup with `with MC5Easy()`
16
+ - 🔧 **NEW: Environment Variables** - Secure credential management with `MC5_USERNAME` and `MC5_PASSWORD`
17
+ - 🌐 **NEW: Service Location** - Dynamic MC5 service endpoint discovery
18
+ - 🎮 **NEW: Federation Sessions** - Complete game launch preparation
19
+ - 🌍 **NEW: Global ID Management** - Device tracking and identification
20
+ - 🔗 **NEW: Connection Monitoring** - Service health and status tracking
21
+ - 🏠 **NEW: Room Discovery** - Find available game rooms
22
+ - 🏰 **PC Storage Admin** - Complete squad management with storage scopes
23
+ - 🔧 **StorageAdminMixin** - Core storage functionality for advanced operations
24
+ - 👤 **System Account Access** - 5 working system accounts discovered
25
+ - 🎯 **Owner Identification** - Complete squad ownership analysis
26
+ - 📊 **Squad Management** - Full CRUD operations for squad data
27
+ - 🛡️ **Security Enhanced** - All credentials sanitized and production ready
28
+ - 📁 **Clean Structure** - Organized file structure for production deployment
29
+ - 🚀 **Performance Optimized** - Removed debug files and optimized for production
30
+ - 📚 **Better Documentation** - Reorganized docs in proper structure
31
+ - 🔒 **Credential Security** - Complete security cleanup implemented
23
32
 
24
33
  ## 🌟 What Can You Do With This?
25
34
 
@@ -53,13 +62,149 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
53
62
 
54
63
  ## 🚀 Installation
55
64
 
56
- ### 🎉 MC5 API Client v1.0.17 - Enhanced Android & Squad Management!
65
+ ### 🎉 MC5 API Client v1.0.18 - Super Easy Interface & Clean API!
66
+
67
+ ```bash
68
+ pip install mc5_api_client==1.0.18
69
+ ```
70
+
71
+ ### ✅ **Major Features Completed!**
72
+
73
+ **🎯 Super Easy Interface (NEW in v1.0.18):**
74
+ - ✅ **MC5Easy Module** - One-line functions for everyday tasks
75
+ - ✅ **Context Manager** - Auto-connect and auto-cleanup with `with MC5Easy()`
76
+ - ✅ **Environment Variables** - Secure credential management
77
+ - ✅ **One-Liner Functions** - `check_my_daily_tasks()`, `get_my_mc5_profile()`, `find_mc5_player()`
78
+ - ✅ **Clean Function Names** - Removed ugly "quick_" prefixes
79
+ - ✅ **Authentication Examples** - Complete authentication guide
80
+
81
+ **🏰 PC Storage Admin (NEW in v1.0.18):**
82
+ - ✅ **PC Storage Admin** - Complete squad management with storage scopes
83
+ - ✅ **StorageAdminMixin** - Core storage functionality for advanced operations
84
+ - ✅ **System Account Access** - 5 working system accounts discovered
85
+ - ✅ **Owner Identification** - Complete squad ownership analysis
86
+ - ✅ **Squad Management** - Full CRUD operations for squad data
87
+
88
+ **🛡️ Production Ready (NEW in v1.0.18):**
89
+ - ✅ **Security Enhanced** - All credentials sanitized and production ready
90
+ - ✅ **Clean Structure** - Organized file structure for production deployment
91
+ - ✅ **Performance Optimized** - Removed debug files and optimized for production
92
+ - ✅ **Better Documentation** - Reorganized docs in proper structure
93
+ - ✅ **Credential Security** - Complete security cleanup implemented
94
+
95
+ ## 🎯 **Super Easy Usage - NEW!**
96
+
97
+ ### **🚀 One-Line Functions for Everyday Tasks**
98
+
99
+ ```python
100
+ from mc5_api_client import MC5Easy, check_my_daily_tasks, get_my_mc5_profile
101
+
102
+ # Method 1: Super simple one-liners (with environment variables)
103
+ tasks = check_my_daily_tasks() # Returns your daily tasks
104
+ profile = get_my_mc5_profile() # Returns your profile stats
105
+ player = find_mc5_player("f55f") # Find any player
106
+ send_mc5_message("f55f", "Hello!") # Send message
107
+
108
+ # Method 2: Easy context manager (auto-connect & cleanup)
109
+ with MC5Easy() as mc5:
110
+ tasks = mc5.check_daily_tasks()
111
+ profile = mc5.get_my_stats()
112
+ player = mc5.find_player("f55f")
113
+ mc5.send_message_to_friend("f55f", "Hello!")
114
+ mc5.broadcast_to_clan("Hello clan!")
115
+
116
+ # Method 3: Environment variables (recommended)
117
+ # Set these once:
118
+ export MC5_USERNAME="your_credential"
119
+ export MC5_PASSWORD="your_password"
120
+
121
+ # Then use any function without credentials:
122
+ with MC5Easy() as mc5: # Auto-uses environment variables
123
+ print(mc5.quick_status()) # Quick status overview
124
+ mc5.run_daily_routine() # Complete daily routine
125
+ ```
126
+
127
+ ### **🔧 Set Up Environment Variables (Recommended)**
57
128
 
58
129
  ```bash
59
- pip install mc5_api_client==1.0.17
130
+ # Windows (Command Prompt)
131
+ set MC5_USERNAME=anonymous:your_credential_here
132
+ set MC5_PASSWORD=your_password_here
133
+
134
+ # Windows (PowerShell)
135
+ $env:MC5_USERNAME="anonymous:your_credential_here"
136
+ $env:MC5_PASSWORD="your_password_here"
137
+
138
+ # Linux/Mac
139
+ export MC5_USERNAME="anonymous:your_credential_here"
140
+ export MC5_PASSWORD="your_password_here"
60
141
  ```
61
142
 
62
- ### **Major Enhancements Completed!**
143
+ ### **📱 Run Examples:**
144
+
145
+ ```bash
146
+ # Set your environment variables first, then:
147
+ python examples/everyday_mc5_easy.py
148
+
149
+ # Service location and game launch:
150
+ python examples/service_location_example.py
151
+
152
+ # Game launch and federation sessions:
153
+ python examples/game_launch_example.py
154
+
155
+ # Device ID management:
156
+ python examples/device_id_example.py
157
+
158
+ # Authentication examples:
159
+ python examples/authentication_example.py
160
+
161
+ # Basic usage:
162
+ python examples/basic_usage.py
163
+
164
+ # Or see one-liner demos:
165
+ python examples/everyday_mc5_easy.py --demo
166
+ ```
167
+
168
+ ### **🌐 Service Location & Game Launch (NEW!)**
169
+
170
+ ```python
171
+ from mc5_api_client import locate_service, get_all_services, create_federation_session
172
+
173
+ # Get all MC5 services dynamically
174
+ services = get_all_services()
175
+ print(f"Found {len(services)} services:")
176
+ for service, endpoint in services.items():
177
+ print(f" {service}: {endpoint}")
178
+
179
+ # Find specific service
180
+ auth_endpoint = locate_service("auth")
181
+ print(f"Auth service: {auth_endpoint}")
182
+
183
+ # Create federation session for game launch
184
+ session = create_federation_session(username, password)
185
+ if session.get("success"):
186
+ print(f"Room ID: {session['room_id']}")
187
+ print(f"Controller: {session['controller_host']}")
188
+ ```
189
+
190
+ ### **🌐 Global ID & Device Management (NEW!)**
191
+
192
+ ```python
193
+ from mc5_api_client import get_global_id, generate_device_id
194
+
195
+ # Get global device ID
196
+ global_id = get_global_id()
197
+ print(f"Global ID: {global_id}")
198
+
199
+ # Generate unique device ID
200
+ device_id = generate_device_id()
201
+ print(f"Device ID: {device_id}")
202
+
203
+ # With MC5Easy
204
+ with MC5Easy() as mc5:
205
+ device_info = mc5.get_device_info()
206
+ print(f"Device: {device_info}")
207
+ ```
63
208
 
64
209
  **� Android Squad Management (NEW in v1.0.17):**
65
210
  - ✅ **Squad Information Retrieval**: Get current squad info, rating, and settings
@@ -1075,10 +1220,10 @@ for event in events:
1075
1220
  For users who prefer additional security, the module now supports token encryption:
1076
1221
 
1077
1222
  ```python
1078
- from mc5_api_client import quick_generate_encrypted_token, quick_encrypt_token
1223
+ from mc5_api_client import generate_encrypted_token, encrypt_token
1079
1224
 
1080
1225
  # Generate and encrypt a token in one step
1081
- encrypted_data = quick_generate_encrypted_token(
1226
+ encrypted_data = generate_encrypted_token(
1082
1227
  username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
1083
1228
  password="sSJKzhQ5l4vrFgov",
1084
1229
  nonce="*" # Custom nonce value (optional)
@@ -1090,7 +1235,7 @@ print(f"Expires: {encrypted_data['expires_at']}")
1090
1235
 
1091
1236
  # Encrypt an existing token
1092
1237
  existing_token = "your_raw_access_token_here"
1093
- encrypted_token = quick_encrypt_token(existing_token, "*")
1238
+ encrypted_token = encrypt_token(existing_token, "*")
1094
1239
  print(f"Encrypted: {encrypted_token}")
1095
1240
  ```
1096
1241
 
@@ -0,0 +1,195 @@
1
+ #!/usr/bin/env python3
2
+ # ────────────[ CHIZOBA ]────────────────────────────
3
+ # | Email : chizoba2026@hotmail.com
4
+ # | File : authentication_example.py
5
+ # | License | MIT License © 2026 Chizoba
6
+ # | Brief | Example of MC5 authentication with proper scopes
7
+ # ────────────────★─────────────────────────────────
8
+
9
+ """
10
+ MC5 Authentication Example
11
+ =======================
12
+
13
+ This example demonstrates how to authenticate with MC5 servers using different methods.
14
+ Shows proper token generation and usage with correct scopes.
15
+
16
+ Setup:
17
+ 1. Replace YOUR_CREDENTIAL and YOUR_PASSWORD with your actual MC5 credentials
18
+ 2. Or set environment variables:
19
+ export MC5_USERNAME="your_credential"
20
+ export MC5_PASSWORD="your_password"
21
+ """
22
+
23
+ import os
24
+ import sys
25
+ from mc5_api_client import MC5Client, TokenGenerator, generate_encrypted_token
26
+
27
+ def main():
28
+ """Demonstrate MC5 authentication methods."""
29
+ print("🔐 MC5 Authentication Examples")
30
+ print("=" * 40)
31
+
32
+ # Method 1: Use environment variables (recommended)
33
+ username = os.getenv('MC5_USERNAME') or "YOUR_MC5_CREDENTIAL"
34
+ password = os.getenv('MC5_PASSWORD') or "YOUR_MC5_PASSWORD"
35
+
36
+ if username == "YOUR_MC5_CREDENTIAL" or password == "YOUR_MC5_PASSWORD":
37
+ print("⚠️ Please set your MC5 credentials:")
38
+ print(" Option 1: Set environment variables MC5_USERNAME and MC5_PASSWORD")
39
+ print(" Option 2: Edit the username and password variables in this script")
40
+ print()
41
+ print(" Example:")
42
+ print(" export MC5_USERNAME='anonymous:your_credential_here'")
43
+ print(" export MC5_PASSWORD='your_password_here'")
44
+ return
45
+
46
+ print(f"🔑 Using credentials: {username[:30]}...")
47
+ print()
48
+
49
+ # === Method 1: Using MC5Client ===
50
+ print("🎮 Method 1: Using MC5Client")
51
+ print("-" * 30)
52
+
53
+ try:
54
+ client = MC5Client(username=username, password=password)
55
+ client.authenticate()
56
+
57
+ print("✅ MC5Client authentication successful!")
58
+ print(f" Token: {client._token_data['access_token'][:30]}...")
59
+ print(f" Scopes: {client._token_data.get('scopes', [])}")
60
+
61
+ # Test getting profile (requires storage scope)
62
+ try:
63
+ profile = client.get_profile()
64
+ print("✅ Profile retrieved successfully!")
65
+ print(f" Name: {profile.get('name', 'Unknown')}")
66
+ print(f" Level: {profile.get('level', 'Unknown')}")
67
+ except Exception as e:
68
+ print(f"⚠️ Profile access: {e}")
69
+ print(" 💡 This might need additional scopes like 'storage'")
70
+
71
+ client.close()
72
+
73
+ except Exception as e:
74
+ print(f"❌ MC5Client authentication failed: {e}")
75
+
76
+ print()
77
+
78
+ # === Method 2: Using TokenGenerator directly ===
79
+ print("🔧 Method 2: Using TokenGenerator")
80
+ print("-" * 35)
81
+
82
+ try:
83
+ token_gen = TokenGenerator(client_id="1875:55979:6.0.0a:windows:windows")
84
+
85
+ # Try with basic scopes
86
+ basic_scopes = "alert auth chat leaderboard_ro lobby message session social"
87
+ token_data = token_gen.generate_token(
88
+ username=username,
89
+ password=password,
90
+ scope=basic_scopes
91
+ )
92
+
93
+ print("✅ TokenGenerator authentication successful!")
94
+ print(f" Token: {token_data['access_token'][:30]}...")
95
+ print(f" Scopes: {token_data.get('scopes', [])}")
96
+
97
+ token_gen.close()
98
+
99
+ except Exception as e:
100
+ print(f"❌ TokenGenerator authentication failed: {e}")
101
+
102
+ print()
103
+
104
+ # === Method 3: Generate encrypted token ===
105
+ print("🔒 Method 3: Generate Encrypted Token")
106
+ print("-" * 40)
107
+
108
+ try:
109
+ encrypted_data = generate_encrypted_token(
110
+ username=username,
111
+ password=password,
112
+ scope="alert auth chat social storage"
113
+ )
114
+
115
+ print("✅ Encrypted token generated successfully!")
116
+ print(f" Encrypted: {encrypted_data.get('encrypted_token', '')[:50]}...")
117
+ print(f" Nonce: {encrypted_data.get('nonce', '')}")
118
+
119
+ except Exception as e:
120
+ print(f"❌ Encrypted token generation failed: {e}")
121
+
122
+ print()
123
+
124
+ # === Method 4: Using MC5Easy (if available) ===
125
+ print("🎯 Method 4: Using MC5Easy (Super Simple)")
126
+ print("-" * 42)
127
+
128
+ try:
129
+ from mc5_api_client import MC5Easy
130
+
131
+ with MC5Easy(username, password) as mc5:
132
+ print("✅ MC5Easy authentication successful!")
133
+
134
+ # Quick status
135
+ status = mc5.quick_status()
136
+ print("📊 Quick Status:")
137
+ print(status)
138
+
139
+ except Exception as e:
140
+ print(f"❌ MC5Easy authentication failed: {e}")
141
+
142
+ print()
143
+ print("🎉 Authentication examples completed!")
144
+ print("💡 Tips:")
145
+ print(" - Use MC5Easy for everyday tasks")
146
+ print(" - Use TokenGenerator for advanced control")
147
+ print(" - Use MC5Client for full API access")
148
+ print(" - Add 'storage' scope for profile access")
149
+
150
+ def demo_scopes():
151
+ """Demonstrate different scope combinations."""
152
+ print("\n🔍 Scope Examples")
153
+ print("=" * 20)
154
+
155
+ username = os.getenv('MC5_USERNAME')
156
+ password = os.getenv('MC5_PASSWORD')
157
+
158
+ if not username or not password:
159
+ print("⚠️ Set MC5_USERNAME and MC5_PASSWORD environment variables to test scopes")
160
+ return
161
+
162
+ scope_examples = [
163
+ ("Basic", "alert auth chat social"),
164
+ ("With Storage", "alert auth chat social storage"),
165
+ ("With Leaderboard", "alert auth chat social storage leaderboard_ro"),
166
+ ("Full Access", "alert auth chat social storage storage_restricted storage_admin leaderboard_ro lobby message session config tracking_bi feed storage leaderboard_admin social_eve social soc transaction schedule lottery voice matchmaker")
167
+ ]
168
+
169
+ token_gen = TokenGenerator(client_id="1875:55979:6.0.0a:windows:windows")
170
+
171
+ try:
172
+ for name, scope in scope_examples:
173
+ print(f"\n🎯 {name} Scopes:")
174
+ print(f" Scope: {scope}")
175
+
176
+ try:
177
+ token_data = token_gen.generate_token(
178
+ username=username,
179
+ password=password,
180
+ scope=scope
181
+ )
182
+
183
+ print(f" ✅ Success! Scopes: {token_data.get('scopes', [])}")
184
+
185
+ except Exception as e:
186
+ print(f" ❌ Failed: {e}")
187
+
188
+ finally:
189
+ token_gen.close()
190
+
191
+ if __name__ == "__main__":
192
+ main()
193
+
194
+ # Uncomment to test different scopes
195
+ # demo_scopes()