multiplayer 2.0.0__tar.gz → 2.0.2__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 (24) hide show
  1. multiplayer-2.0.2/LICENSE.md +23 -0
  2. {multiplayer-2.0.0 → multiplayer-2.0.2}/PKG-INFO +16 -3
  3. {multiplayer-2.0.0 → multiplayer-2.0.2}/pyproject.toml +17 -2
  4. multiplayer-2.0.2/pyproject.toml.orig +44 -0
  5. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/server.py +28 -0
  6. multiplayer-2.0.0/pyproject.toml.orig +0 -29
  7. {multiplayer-2.0.0 → multiplayer-2.0.2}/README.md +0 -0
  8. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/__init__.py +0 -0
  9. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/client.py +0 -0
  10. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/cities.csv +0 -0
  11. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/countries.csv +0 -0
  12. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/egyptian_gods.csv +0 -0
  13. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/european_kings.csv +0 -0
  14. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/european_queens.csv +0 -0
  15. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/greek_gods.csv +0 -0
  16. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/planets_moons.csv +0 -0
  17. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/rivers.csv +0 -0
  18. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/roman_gods.csv +0 -0
  19. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/data/seas_oceans.csv +0 -0
  20. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/exceptions.py +0 -0
  21. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/game.py +0 -0
  22. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/py.typed +0 -0
  23. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/save.py +0 -0
  24. {multiplayer-2.0.0 → multiplayer-2.0.2}/src/multiplayer/utils.py +0 -0
@@ -0,0 +1,23 @@
1
+ **English** | [Español](translation/LICENSE.es.md) | [Français](translation/LICENSE.fr.md)
2
+
3
+ # MIT License
4
+
5
+ Copyright (c) 2026 devfred78
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify,merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT of OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
@@ -1,12 +1,25 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: multiplayer
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Library that allows you to manage multiple players, locally, on a network, or on the Internet.
5
5
  Author: devfred78
6
6
  Author-email: devfred78 <devfred78@gmail.com>
7
+ License-Expression: MIT
8
+ License-File: LICENSE.md
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Games/Entertainment
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
7
20
  Requires-Dist: bcrypt>=5.0.0
8
21
  Requires-Dist: msgpack>=1.2.1
9
- Requires-Python: >=3.14
22
+ Requires-Python: >=3.10
10
23
  Description-Content-Type: text/markdown
11
24
 
12
25
  # Multiplayer Library V2
@@ -1,9 +1,24 @@
1
1
  [project]
2
2
  name = "multiplayer"
3
- version = "2.0.0"
3
+ version = "2.0.2"
4
4
  description = "Library that allows you to manage multiple players, locally, on a network, or on the Internet."
5
5
  readme = "README.md"
6
- requires-python = ">=3.14"
6
+ license = "MIT"
7
+ license-files = ["LICEN[CS]E*"]
8
+ requires-python = ">=3.10"
9
+ classifiers = [
10
+ "Development Status :: 5 - Production/Stable",
11
+ "License :: OSI Approved :: MIT License",
12
+ "Operating System :: OS Independent",
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3.10",
15
+ "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Programming Language :: Python :: 3.13",
18
+ "Programming Language :: Python :: 3.14",
19
+ "Topic :: Games/Entertainment",
20
+ "Topic :: Software Development :: Libraries :: Python Modules",
21
+ ]
7
22
  dependencies = [
8
23
  "bcrypt>=5.0.0",
9
24
  "msgpack>=1.2.1",
@@ -0,0 +1,44 @@
1
+ [project]
2
+ name = "multiplayer"
3
+ version = "2.0.2"
4
+ description = "Library that allows you to manage multiple players, locally, on a network, or on the Internet."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICEN[CS]E*"]
8
+ authors = [
9
+ { name = "devfred78", email = "devfred78@gmail.com" }
10
+ ]
11
+ requires-python = ">=3.10"
12
+ classifiers = [
13
+ "Development Status :: 5 - Production/Stable",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Operating System :: OS Independent",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Topic :: Games/Entertainment",
23
+ "Topic :: Software Development :: Libraries :: Python Modules",
24
+ ]
25
+ dependencies = [
26
+ "bcrypt>=5.0.0",
27
+ "msgpack>=1.2.1",
28
+ ]
29
+
30
+ [build-system]
31
+ requires = ["uv_build>=0.11.7,<0.12.0"]
32
+ build-backend = "uv_build"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "mypy>=2.1.0",
37
+ "pytest>=9.0.3",
38
+ "ruff>=0.15.16",
39
+ ]
40
+
41
+ [tool.mypy]
42
+ exclude = '^private-doc/'
43
+ ignore_missing_imports = true
44
+ disable_error_code = ["arg-type", "assignment", "misc", "operator", "union-attr"]
@@ -493,6 +493,7 @@ class GameServer:
493
493
  return
494
494
 
495
495
  self._load_persistence()
496
+ self._ensure_server_admin()
496
497
 
497
498
  tls_context = self._build_tls_context() if self.use_tls else None
498
499
  self._tcp_server = await asyncio.start_server(
@@ -659,6 +660,33 @@ class GameServer:
659
660
  # ------------------------------------------------------------------ #
660
661
  # Persistence
661
662
  # ------------------------------------------------------------------ #
663
+ def _ensure_server_admin(self) -> None:
664
+ """Creates the default server administrator when none exists.
665
+
666
+ The persistence layer must be loaded before this method is called so
667
+ that a restored administrator prevents the bootstrap account from
668
+ being created.
669
+ """
670
+ if any(user.role == PlayerRole.SERVER_ADMIN for user in self._users.values()):
671
+ return
672
+
673
+ admin = self._users.get("admin")
674
+ if admin is None:
675
+ try:
676
+ admin = User(username="admin", password="admin")
677
+ except UserAlreadyExistsError:
678
+ # ``User`` keeps a process-wide username registry. A username
679
+ # left by another server instance must not prevent this
680
+ # server from bootstrapping its own account.
681
+ User._existing_usernames.discard("admin")
682
+ admin = User(username="admin", password="admin")
683
+ else:
684
+ admin.change_password("admin")
685
+
686
+ admin.role = PlayerRole.SERVER_ADMIN
687
+ self._users[admin.username] = admin
688
+ self._players[admin.player.ID] = admin.player
689
+
662
690
  def _load_persistence(self) -> None:
663
691
  """Loads persistent data into memory when persistence is enabled."""
664
692
  if self.persistence_mode is None or self.persistence_path is None:
@@ -1,29 +0,0 @@
1
- [project]
2
- name = "multiplayer"
3
- version = "2.0.0"
4
- description = "Library that allows you to manage multiple players, locally, on a network, or on the Internet."
5
- readme = "README.md"
6
- authors = [
7
- { name = "devfred78", email = "devfred78@gmail.com" }
8
- ]
9
- requires-python = ">=3.14"
10
- dependencies = [
11
- "bcrypt>=5.0.0",
12
- "msgpack>=1.2.1",
13
- ]
14
-
15
- [build-system]
16
- requires = ["uv_build>=0.11.7,<0.12.0"]
17
- build-backend = "uv_build"
18
-
19
- [dependency-groups]
20
- dev = [
21
- "mypy>=2.1.0",
22
- "pytest>=9.0.3",
23
- "ruff>=0.15.16",
24
- ]
25
-
26
- [tool.mypy]
27
- exclude = '^private-doc/'
28
- ignore_missing_imports = true
29
- disable_error_code = ["arg-type", "assignment", "misc", "operator", "union-attr"]
File without changes