mcserver-cli 4.9.0__py3-none-any.whl → 4.9.2__py3-none-any.whl
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.
- mcserver/__init__.py +1 -1
- mcserver/commands/add_projects.py +13 -5
- mcserver/commands/initialize_server.py +4 -1
- mcserver/commands/remove_projects.py +1 -0
- mcserver/commands/server_status.py +2 -1
- mcserver/commands/show_projects.py +1 -0
- mcserver/commands/start_server.py +2 -1
- mcserver/commands/stop_server.py +1 -0
- mcserver/commands/update_projects.py +1 -0
- mcserver/config.py +6 -2
- mcserver/modrinth/modpack.py +2 -1
- mcserver/mysterious.py +23 -0
- mcserver/networking.py +4 -1
- mcserver/paths.py +1 -0
- mcserver/resolver.py +3 -1
- mcserver/shared.py +1 -0
- mcserver/state.py +1 -0
- mcserver/urls.py +1 -1
- {mcserver_cli-4.9.0.dist-info → mcserver_cli-4.9.2.dist-info}/METADATA +1 -1
- {mcserver_cli-4.9.0.dist-info → mcserver_cli-4.9.2.dist-info}/RECORD +23 -23
- {mcserver_cli-4.9.0.dist-info → mcserver_cli-4.9.2.dist-info}/WHEEL +0 -0
- {mcserver_cli-4.9.0.dist-info → mcserver_cli-4.9.2.dist-info}/entry_points.txt +0 -0
- {mcserver_cli-4.9.0.dist-info → mcserver_cli-4.9.2.dist-info}/licenses/LICENSE +0 -0
mcserver/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "4.9.
|
|
1
|
+
__version__ = "4.9.2"
|
|
@@ -137,7 +137,9 @@ def add_projects(args: Namespace) -> int:
|
|
|
137
137
|
project_record: ProjectRecordData = project_records.read_record(project_id)
|
|
138
138
|
record_cache[project_id] = project_record
|
|
139
139
|
|
|
140
|
-
project_dependencies: list[modrinth.Dependency] = project_record[
|
|
140
|
+
project_dependencies: list[modrinth.Dependency] = project_record[
|
|
141
|
+
"dependencies"
|
|
142
|
+
]
|
|
141
143
|
return project_dependencies
|
|
142
144
|
|
|
143
145
|
versions: list[modrinth.ProjectVersion] = modrinth.get_project_versions(
|
|
@@ -166,8 +168,10 @@ def add_projects(args: Namespace) -> int:
|
|
|
166
168
|
if project_id in version_cache:
|
|
167
169
|
project_version: ProjectVersion = version_cache[project_id]
|
|
168
170
|
if "dependencies" in project_version:
|
|
169
|
-
dependencies: list[Dependency] | None =
|
|
170
|
-
|
|
171
|
+
dependencies: list[Dependency] | None = (
|
|
172
|
+
version_dependencies_to_dependencies(
|
|
173
|
+
project_version["dependencies"]
|
|
174
|
+
)
|
|
171
175
|
)
|
|
172
176
|
else:
|
|
173
177
|
dependencies: list[Dependency] | None = get_project_dependencies(project_id)
|
|
@@ -322,7 +326,9 @@ def add_projects(args: Namespace) -> int:
|
|
|
322
326
|
sha512_hash: str | None = primary_file["file_hashes"].get("sha512")
|
|
323
327
|
if sha512_hash is not None:
|
|
324
328
|
networking.download(
|
|
325
|
-
primary_file["download_url"],
|
|
329
|
+
primary_file["download_url"],
|
|
330
|
+
file_path,
|
|
331
|
+
hashes={"sha512": sha512_hash},
|
|
326
332
|
)
|
|
327
333
|
else:
|
|
328
334
|
networking.download(primary_file["download_url"], file_path)
|
|
@@ -350,7 +356,9 @@ def add_projects(args: Namespace) -> int:
|
|
|
350
356
|
sha512_hash: str | None = primary_file["file_hashes"].get("sha512")
|
|
351
357
|
if sha512_hash is not None:
|
|
352
358
|
networking.download(
|
|
353
|
-
primary_file["download_url"],
|
|
359
|
+
primary_file["download_url"],
|
|
360
|
+
file_path,
|
|
361
|
+
hashes={"sha512": sha512_hash},
|
|
354
362
|
)
|
|
355
363
|
else:
|
|
356
364
|
networking.download(primary_file["download_url"], file_path)
|
|
@@ -146,7 +146,10 @@ def initialize_server(args: Namespace) -> int:
|
|
|
146
146
|
config_override: dict = {}
|
|
147
147
|
match config_name:
|
|
148
148
|
case "launcher":
|
|
149
|
-
config_override = {
|
|
149
|
+
config_override = {
|
|
150
|
+
"java_path": str(java_executable),
|
|
151
|
+
"ram": {"min": min_ram, "max": max_ram},
|
|
152
|
+
}
|
|
150
153
|
|
|
151
154
|
case "modrinth":
|
|
152
155
|
config_override = {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from argparse import Namespace
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
from .. import paths
|
|
5
|
+
|
|
6
6
|
logger: logging.Logger = logging.getLogger(__name__)
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
def server_status(args: Namespace) -> int:
|
|
9
10
|
paths.update_working_dir(args.directory)
|
|
10
11
|
logger.error("Command is not implemented yet.")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
3
|
import os
|
|
4
|
-
import shutil
|
|
5
4
|
from argparse import Namespace
|
|
6
5
|
from pathlib import Path
|
|
7
6
|
|
|
@@ -170,6 +169,8 @@ def start_server(args: Namespace) -> int:
|
|
|
170
169
|
if launcher_config["is_nogui"]:
|
|
171
170
|
java_command_argv.append("nogui")
|
|
172
171
|
|
|
172
|
+
os.chdir(paths.working_dir)
|
|
173
|
+
|
|
173
174
|
# Execute java
|
|
174
175
|
logger.debug(f"Executing command: {' '.join(java_command_argv)}")
|
|
175
176
|
os.execv(java_command_argv[0], java_command_argv)
|
mcserver/commands/stop_server.py
CHANGED
mcserver/config.py
CHANGED
|
@@ -43,7 +43,9 @@ def write_config(
|
|
|
43
43
|
configuration_data.update(copy.deepcopy(config_data))
|
|
44
44
|
config_json: str = json.dumps(configuration_data, indent=2)
|
|
45
45
|
|
|
46
|
-
logger.debug(
|
|
46
|
+
logger.debug(
|
|
47
|
+
f"Writing configuration for '{config_name}' at '{config_path.relative_to(paths.current_dir, walk_up=True)}'"
|
|
48
|
+
)
|
|
47
49
|
shared.update_file(config_path, config_json.encode())
|
|
48
50
|
|
|
49
51
|
|
|
@@ -66,7 +68,9 @@ def read_config(config_name: str, current_format_version: int) -> dict[str, Any]
|
|
|
66
68
|
f"Configuration file for '{config_name}' does not exist"
|
|
67
69
|
)
|
|
68
70
|
|
|
69
|
-
logger.debug(
|
|
71
|
+
logger.debug(
|
|
72
|
+
f"Reading configuration for '{config_name}' at '{config_path.relative_to(paths.current_dir, walk_up=True)}'"
|
|
73
|
+
)
|
|
70
74
|
config_json: str = config_path.read_text()
|
|
71
75
|
config_data: dict = json.loads(config_json)
|
|
72
76
|
|
mcserver/modrinth/modpack.py
CHANGED
mcserver/mysterious.py
CHANGED
|
@@ -26,6 +26,29 @@ def nothing_to_see_here_move_along() -> NoReturn:
|
|
|
26
26
|
"Hold F3+C for 10 seconds for a surprise!",
|
|
27
27
|
"Segmentation fault (core dumped)",
|
|
28
28
|
"about:mozilla in Firefox?",
|
|
29
|
+
"Do not press Ctrl+Alt+F3 if you are not prepared!",
|
|
30
|
+
"Othecat35 was here!",
|
|
31
|
+
"sudo make me a sandwich",
|
|
32
|
+
"Notch left the game",
|
|
33
|
+
"Do a barrel roll!",
|
|
34
|
+
"Have you tried stopping the server and starting it again?",
|
|
35
|
+
"One must continuously pet the watchdog.",
|
|
36
|
+
"One does not simply enter the source code.",
|
|
37
|
+
"Keyboard not found. Press F1 to continue.",
|
|
38
|
+
"Press F to pay respect.",
|
|
39
|
+
"FIX MOJANG BEDROCK!",
|
|
40
|
+
"FIX BEDROCK MOJANG!",
|
|
41
|
+
"This server is powered by hopes and prayers.",
|
|
42
|
+
"Chrome ate all of your RAM before the Minecraft server does.",
|
|
43
|
+
"You're communicating like it was in 1960s",
|
|
44
|
+
"Somewhere, a duck is judging your code.",
|
|
45
|
+
"No features were harmed while I'm refactoring.",
|
|
46
|
+
"Hi Othecat35! You've successfully authenticated, but Modrinth does not provide shell access.",
|
|
47
|
+
"Hi {username}! You've successfully authenticated, but Modrinth does not provide shell access.",
|
|
48
|
+
"{username} is not in the sudoers file. This incident has been reported to the administrator.",
|
|
49
|
+
"There's no easter egg here.",
|
|
50
|
+
"... init && mcserver start",
|
|
51
|
+
"This MCServer does not have Super Cow Powers.",
|
|
29
52
|
]
|
|
30
53
|
|
|
31
54
|
message: str = random.choice(messages)
|
mcserver/networking.py
CHANGED
|
@@ -42,6 +42,7 @@ user_agent: str = (
|
|
|
42
42
|
)
|
|
43
43
|
read_chunk_size: int = 1024 * 64 # 64KiB
|
|
44
44
|
|
|
45
|
+
|
|
45
46
|
# Functions
|
|
46
47
|
def request(
|
|
47
48
|
url: str,
|
|
@@ -123,7 +124,9 @@ def download(
|
|
|
123
124
|
basename: str = filename.name
|
|
124
125
|
tempfile: Path = paths.tempfiles_dir / basename
|
|
125
126
|
|
|
126
|
-
request_url: urllib.request.Request = urllib.request.Request(
|
|
127
|
+
request_url: urllib.request.Request = urllib.request.Request(
|
|
128
|
+
url, headers=headers, method="GET"
|
|
129
|
+
)
|
|
127
130
|
|
|
128
131
|
logger.debug(f"Downloading URL: {request_url.full_url}")
|
|
129
132
|
logger.debug(f"Temporary file: {tempfile}")
|
mcserver/paths.py
CHANGED
mcserver/resolver.py
CHANGED
|
@@ -152,7 +152,9 @@ def resolve_dependencies(
|
|
|
152
152
|
dependency_graph[project_id]["dependencies"] = dependencies
|
|
153
153
|
|
|
154
154
|
for dependency_id, dependency_type in dependencies.items():
|
|
155
|
-
logger.debug(
|
|
155
|
+
logger.debug(
|
|
156
|
+
f"Processing dependency '{dependency_id}' for project '{project_id}'"
|
|
157
|
+
)
|
|
156
158
|
if dependency_id in dependency_graph:
|
|
157
159
|
dependency_project = dependency_graph[dependency_id]
|
|
158
160
|
|
mcserver/shared.py
CHANGED
mcserver/state.py
CHANGED
mcserver/urls.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mcserver-cli
|
|
3
|
-
Version: 4.9.
|
|
3
|
+
Version: 4.9.2
|
|
4
4
|
Summary: A CLI tool to manage Minecraft: Java Edition servers.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Othecat35/MCServer
|
|
6
6
|
Project-URL: Repository, https://github.com/Othecat35/MCServer.git
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
mcserver/__init__.py,sha256=
|
|
1
|
+
mcserver/__init__.py,sha256=9IzaVQP787fNLdw2IGD5hgGMK5Qp0cYcqMPlh3LI8Jk,22
|
|
2
2
|
mcserver/__main__.py,sha256=3-WYJCtLQ8TbzmLMYBiAsm9PC89DwjXc6s_J-izMEz8,30
|
|
3
3
|
mcserver/app.py,sha256=CtF81mFMH09k-E6iRhlIfWIYQPOCTa3MB7tY_o6l3qE,1298
|
|
4
4
|
mcserver/caching.py,sha256=7mK4OIB6e12rqbaeUjsYRKYsXnrdREkz7_pqPt9OCsc,211
|
|
5
5
|
mcserver/cli.py,sha256=cVbog2P-Nbcx2CPfIF5ppI6_14bhXZfZuID2ox0Cpa0,11809
|
|
6
|
-
mcserver/config.py,sha256=
|
|
6
|
+
mcserver/config.py,sha256=cb3959FNCibqOMbjOs7f3lLnCghykf-akV-sQPu0r88,2603
|
|
7
7
|
mcserver/constants.py,sha256=iu6wbhkgtPDdcK5Ny3QsFJ2w9Myff6DxW_QAMOvfNnw,433
|
|
8
8
|
mcserver/metadata.py,sha256=F3GtQZtR9YkTqmGb-SLAlpmDMqr1G3vjbgkoxl3xfBg,982
|
|
9
|
-
mcserver/mysterious.py,sha256=
|
|
10
|
-
mcserver/networking.py,sha256=
|
|
11
|
-
mcserver/paths.py,sha256=
|
|
9
|
+
mcserver/mysterious.py,sha256=Q9ApMf63rBmcIjq2tdQlKwMHbtpPp6827SXVNq4aFP0,2347
|
|
10
|
+
mcserver/networking.py,sha256=QRW0lrw5KOh4FDps8NRixhX6e1QTiLRTkO5P5t_FnCI,7132
|
|
11
|
+
mcserver/paths.py,sha256=pT0giUhYFWTuxEzD8dYG349gDwzi2DJosBrWU_bmDe4,2298
|
|
12
12
|
mcserver/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
mcserver/resolver.py,sha256=
|
|
14
|
-
mcserver/shared.py,sha256=
|
|
15
|
-
mcserver/state.py,sha256=
|
|
16
|
-
mcserver/urls.py,sha256=
|
|
13
|
+
mcserver/resolver.py,sha256=yKNFQ9ukxqONqtv4IcqgTVoM4OZ3x6Jk_jhSjwmKonE,7904
|
|
14
|
+
mcserver/shared.py,sha256=L1P9xSZtosYIU4iVnLT5C8jVF3-ZPKDV2YxLrMtEw1g,7688
|
|
15
|
+
mcserver/state.py,sha256=FWmWv0EP3PLNRfNB0KUxTmYKGUJOhKgjfWvuKFBY_WU,2382
|
|
16
|
+
mcserver/urls.py,sha256=n0KhNyfh360DifsUwtI3WoivfpZjbyeSeV1pxM66X7c,320
|
|
17
17
|
mcserver/commands/__init__.py,sha256=davCl5wAUQiZQAmLPu3-0rmQpXsCRp2Ryg8w5gitU5s,1115
|
|
18
|
-
mcserver/commands/add_projects.py,sha256=
|
|
18
|
+
mcserver/commands/add_projects.py,sha256=aeop1wh8T2MOQHNJWB3dl1aCMjSj1GW1gaPh7JddJ0o,15925
|
|
19
19
|
mcserver/commands/import_setup.py,sha256=Dhe048Grf5w3ceCUTAoy95CIIG-Ok5lsjVZuNxN9ip0,303
|
|
20
|
-
mcserver/commands/initialize_server.py,sha256=
|
|
20
|
+
mcserver/commands/initialize_server.py,sha256=EF80xdYjK-EZ5pdfAzG1kXYA45QIqFEVWnMuIJSdXg8,6634
|
|
21
21
|
mcserver/commands/list_projects.py,sha256=IL5umyKMEn-l-e1sSI9prOKidi7Rcg69Cn_l2yEUI-Q,1121
|
|
22
22
|
mcserver/commands/op_grant.py,sha256=vJLgQ0EyUTZUmB3Sd1fKocfwTpDBmJkAyBt3D5B4hoQ,4161
|
|
23
23
|
mcserver/commands/op_list.py,sha256=bDPi7U25d4dgLZ4pr2A8nE6rV0l7O75JNnYQXuOGEo8,1030
|
|
24
24
|
mcserver/commands/op_revoke.py,sha256=gpT9mGsQHneeREPoDB189Zjd-FJfP1TKkcyGX0nxcHw,1288
|
|
25
25
|
mcserver/commands/print_help.py,sha256=7s1-MQUaFE2AuzPsYI09y_r4Y11j1uvNeF0QciST7_w,154
|
|
26
|
-
mcserver/commands/remove_projects.py,sha256=
|
|
26
|
+
mcserver/commands/remove_projects.py,sha256=CApE8Z75jJbCvRIlEQgDgE6-X7kfPVokMJ2M1EhdpVA,279
|
|
27
27
|
mcserver/commands/search_projects.py,sha256=MrVKjcT8t33Y7KVbN0j3TqXvgW2llRyyvgogwtoR6Eo,6426
|
|
28
|
-
mcserver/commands/server_status.py,sha256=
|
|
29
|
-
mcserver/commands/show_projects.py,sha256=
|
|
30
|
-
mcserver/commands/start_server.py,sha256=
|
|
31
|
-
mcserver/commands/stop_server.py,sha256=
|
|
32
|
-
mcserver/commands/update_projects.py,sha256=
|
|
28
|
+
mcserver/commands/server_status.py,sha256=ZPJGQUor5_Vfy0PWLs4Ja7GE9V93mH-OsVPuia48_4E,277
|
|
29
|
+
mcserver/commands/show_projects.py,sha256=3TiaCC6canak1sDt5zx6hKD8z9M044gMgp799q_Reb8,4070
|
|
30
|
+
mcserver/commands/start_server.py,sha256=3DmTMsZ_j0v9IVKMgMRNqls8Z3diuggja0RzvjZbcQY,5972
|
|
31
|
+
mcserver/commands/stop_server.py,sha256=WPtroNPboierzgKg_5YLNvRMaWjGZsjrYGNu2VWmxBs,654
|
|
32
|
+
mcserver/commands/update_projects.py,sha256=x8yoeJ_FoSYqUsh_kqJnNK4iwn3x4vIKNJroYE3lXiI,280
|
|
33
33
|
mcserver/commands/whitelist_add.py,sha256=P854hks0HrNt4So0qaKAQS1E4NXIdPECTXPSICz3nZM,3165
|
|
34
34
|
mcserver/commands/whitelist_list.py,sha256=2Zsd7rxZ1GvVNhL0Y20LmbMLCwbE_gbvONYjyR77a6M,1033
|
|
35
35
|
mcserver/commands/whitelist_remove.py,sha256=-ScjTBuTaVOp1oCcmV6oBvEmumz1MiclV2kMZmxb8Js,1254
|
|
@@ -60,7 +60,7 @@ mcserver/minecraft/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
60
60
|
mcserver/minecraft/api.py,sha256=spkpo43Ux2et9K8eXWTk-8t2xLfQhk_0XeYtXR_sE8o,3158
|
|
61
61
|
mcserver/minecraft/player_identity.py,sha256=6jrliadwU2Lm2XF-iRQkKIjzxCiwgQSwyOo6RvFtQ68,1196
|
|
62
62
|
mcserver/modrinth/__init__.py,sha256=l0phC6sVpBBND7hUZBPcQpj9-uRHzAWH_F3iN3HrTAI,1387
|
|
63
|
-
mcserver/modrinth/modpack.py,sha256=
|
|
63
|
+
mcserver/modrinth/modpack.py,sha256=PcIvvZqZNIsbvMI6iTxZp9Ge05nPVUkO99Z_Ubm01QM,2993
|
|
64
64
|
mcserver/modrinth/project_records.py,sha256=Gxg0I_ckNPotp1hvr4PsyzahVTOyeB-acBCrxjs2GYQ,3489
|
|
65
65
|
mcserver/modrinth/shared.py,sha256=-bVTwhYxif2jufZ_jcH5Gifa4d7uUtq_SGVgHfVXsyQ,3013
|
|
66
66
|
mcserver/modrinth/slug_index.py,sha256=BpFoirLPfxmpaOJz0PKT9vWwldigVWn0kiavP4bTXws,5629
|
|
@@ -106,8 +106,8 @@ mcserver/server_files/properties.py,sha256=5WPigqET70Xh61NIIP0KRaTyir9qwjpjC-Hmk
|
|
|
106
106
|
mcserver/server_files/server_properties.py,sha256=3jnx0Y12I31yEsxDBtGyYD4Nv2dRSA1s24YTvtloUDo,1974
|
|
107
107
|
mcserver/server_files/usercache.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
108
|
mcserver/server_files/whitelist.py,sha256=4xE0otTb8QyGJqcrF5LwOghpxwIfQA0Efy1Mwko9CZA,5705
|
|
109
|
-
mcserver_cli-4.9.
|
|
110
|
-
mcserver_cli-4.9.
|
|
111
|
-
mcserver_cli-4.9.
|
|
112
|
-
mcserver_cli-4.9.
|
|
113
|
-
mcserver_cli-4.9.
|
|
109
|
+
mcserver_cli-4.9.2.dist-info/METADATA,sha256=ZIbojKRuKV_dwzeB7-84waGVqe9u3BvA3w6-rBO-iGE,3474
|
|
110
|
+
mcserver_cli-4.9.2.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
111
|
+
mcserver_cli-4.9.2.dist-info/entry_points.txt,sha256=p7uN6UdTzjea7nGIkhjiYDYd7wznkxz9amUPY_fpz24,47
|
|
112
|
+
mcserver_cli-4.9.2.dist-info/licenses/LICENSE,sha256=OzeasqJgwxVpwtMkEYOLoDPUnIDSbVcW62rk-voA3eI,1076
|
|
113
|
+
mcserver_cli-4.9.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|