mcserver-cli 4.6.2__py3-none-any.whl → 4.7.0__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/cli.py +2 -2
- mcserver/commands/op_grant.py +6 -0
- mcserver/commands/op_list.py +5 -4
- mcserver/commands/op_revoke.py +5 -0
- mcserver/commands/print_help.py +1 -1
- mcserver/commands/whitelist_add.py +9 -4
- mcserver/commands/whitelist_list.py +5 -4
- mcserver/commands/whitelist_remove.py +7 -1
- {mcserver_cli-4.6.2.dist-info → mcserver_cli-4.7.0.dist-info}/METADATA +5 -3
- {mcserver_cli-4.6.2.dist-info → mcserver_cli-4.7.0.dist-info}/RECORD +14 -14
- {mcserver_cli-4.6.2.dist-info → mcserver_cli-4.7.0.dist-info}/WHEEL +0 -0
- {mcserver_cli-4.6.2.dist-info → mcserver_cli-4.7.0.dist-info}/entry_points.txt +0 -0
- {mcserver_cli-4.6.2.dist-info → mcserver_cli-4.7.0.dist-info}/licenses/LICENSE +0 -0
mcserver/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "4.
|
|
1
|
+
__version__ = "4.7.0"
|
mcserver/cli.py
CHANGED
|
@@ -249,7 +249,7 @@ def main() -> int:
|
|
|
249
249
|
type=str,
|
|
250
250
|
choices=["true", "false"],
|
|
251
251
|
metavar="Boolean",
|
|
252
|
-
help="The server's online mode (true/false)",
|
|
252
|
+
help="The server's online mode (true/false) [optional]",
|
|
253
253
|
)
|
|
254
254
|
|
|
255
255
|
op_grant_command.add_argument(
|
|
@@ -394,7 +394,7 @@ def main() -> int:
|
|
|
394
394
|
type=str,
|
|
395
395
|
choices=["true", "false"],
|
|
396
396
|
metavar="Boolean",
|
|
397
|
-
help="The server's online mode (true/false)",
|
|
397
|
+
help="The server's online mode (true/false) [optional]",
|
|
398
398
|
)
|
|
399
399
|
|
|
400
400
|
# 'whitelist list'
|
mcserver/commands/op_grant.py
CHANGED
|
@@ -3,12 +3,18 @@ from argparse import Namespace
|
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
|
|
5
5
|
from ..minecraft.player_identity import separate_uuids_and_names
|
|
6
|
+
from ..paths import current_dir
|
|
6
7
|
from ..server_files.ops import OperatorPlayer
|
|
8
|
+
from ..server_files.paths import ops_file_path
|
|
7
9
|
|
|
8
10
|
logger = logging.getLogger(__name__)
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
def run(args: Namespace) -> int:
|
|
14
|
+
if not ops_file_path.exists():
|
|
15
|
+
logger.info(f"Operator file '{ops_file_path.relative_to(current_dir)}' does not exist, creating new one")
|
|
16
|
+
ops_file_path.write_text("[]")
|
|
17
|
+
|
|
12
18
|
player_ids: list[str] = args.players
|
|
13
19
|
online_mode: str | None = args.online_mode
|
|
14
20
|
permission_level: int | None = args.permission_level
|
mcserver/commands/op_list.py
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from argparse import Namespace
|
|
3
3
|
|
|
4
|
+
from ..paths import current_dir
|
|
4
5
|
from ..server_files import ops
|
|
6
|
+
from ..server_files.paths import ops_file_path
|
|
5
7
|
from ..shared import pluralize
|
|
6
8
|
|
|
7
9
|
logger = logging.getLogger(__name__)
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
def run(args: Namespace) -> int:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
logger.error(f"Operator file '{ops.ops_file_path}' not found.")
|
|
13
|
+
if not ops_file_path.exists():
|
|
14
|
+
logger.error(f"Operator file '{ops_file_path.relative_to(current_dir)}' does not exist")
|
|
14
15
|
return 1
|
|
15
16
|
|
|
16
17
|
operator_players = ops.list_players()
|
|
@@ -18,7 +19,7 @@ def run(args: Namespace) -> int:
|
|
|
18
19
|
player_count = len(operator_players)
|
|
19
20
|
if player_count == 0:
|
|
20
21
|
logger.info("There's no operator player.")
|
|
21
|
-
return
|
|
22
|
+
return 1
|
|
22
23
|
|
|
23
24
|
player_list: list[str] = []
|
|
24
25
|
for player in operator_players:
|
mcserver/commands/op_revoke.py
CHANGED
|
@@ -2,13 +2,18 @@ import logging
|
|
|
2
2
|
from argparse import Namespace
|
|
3
3
|
|
|
4
4
|
from ..minecraft.player_identity import separate_uuids_and_names
|
|
5
|
+
from ..paths import current_dir
|
|
5
6
|
from ..server_files import ops
|
|
7
|
+
from ..server_files.paths import ops_file_path
|
|
6
8
|
from ..shared import pluralize
|
|
7
9
|
|
|
8
10
|
logger = logging.getLogger(__name__)
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
def run(args: Namespace) -> int:
|
|
14
|
+
if not ops_file_path.exists():
|
|
15
|
+
logger.error(f"Operator file '{ops_file_path.relative_to(current_dir)}' does not exist")
|
|
16
|
+
return 1
|
|
12
17
|
player_ids: list[str] = args.players
|
|
13
18
|
|
|
14
19
|
player_uuids, player_names = separate_uuids_and_names(player_ids)
|
mcserver/commands/print_help.py
CHANGED
|
@@ -3,12 +3,18 @@ from argparse import Namespace
|
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
|
|
5
5
|
from ..minecraft.player_identity import separate_uuids_and_names
|
|
6
|
+
from ..paths import current_dir
|
|
7
|
+
from ..server_files.paths import whitelist_file_path
|
|
6
8
|
from ..server_files.whitelist import WhitelistedPlayer
|
|
7
9
|
|
|
8
10
|
logger = logging.getLogger(__name__)
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
def run(args: Namespace) -> int:
|
|
14
|
+
if not whitelist_file_path.exists():
|
|
15
|
+
logger.info(f"Whitelist file '{whitelist_file_path.relative_to(current_dir)}' does not exist, creating new one")
|
|
16
|
+
whitelist_file_path.write_text("[]")
|
|
17
|
+
|
|
12
18
|
player_ids: list[str] = args.players
|
|
13
19
|
online_mode: str | None = args.online_mode
|
|
14
20
|
|
|
@@ -26,7 +32,7 @@ def run(args: Namespace) -> int:
|
|
|
26
32
|
|
|
27
33
|
is_online_mode = server_properties.get_online_mode()
|
|
28
34
|
else:
|
|
29
|
-
is_online_mode = online_mode != "false"
|
|
35
|
+
is_online_mode = online_mode.lower() != "false"
|
|
30
36
|
|
|
31
37
|
whitelisted_players: list[WhitelistedPlayer] = []
|
|
32
38
|
if is_online_mode:
|
|
@@ -71,8 +77,8 @@ def run(args: Namespace) -> int:
|
|
|
71
77
|
|
|
72
78
|
player_count: int = len(whitelisted_players)
|
|
73
79
|
if player_count == 0:
|
|
74
|
-
logger.info("There are no whitelisted
|
|
75
|
-
return
|
|
80
|
+
logger.info("There are no player to be whitelisted.")
|
|
81
|
+
return 1
|
|
76
82
|
|
|
77
83
|
player_list: list[str] = []
|
|
78
84
|
for player in whitelisted_players:
|
|
@@ -84,5 +90,4 @@ def run(args: Namespace) -> int:
|
|
|
84
90
|
|
|
85
91
|
player_list.sort()
|
|
86
92
|
print("\n".join(player_list))
|
|
87
|
-
|
|
88
93
|
return 0
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from argparse import Namespace
|
|
3
3
|
|
|
4
|
+
from ..paths import current_dir
|
|
4
5
|
from ..server_files import whitelist
|
|
6
|
+
from ..server_files.paths import whitelist_file_path
|
|
5
7
|
from ..shared import pluralize
|
|
6
8
|
|
|
7
9
|
logger = logging.getLogger(__name__)
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
def run(args: Namespace) -> int:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
logger.error(f"Whitelist file ({whitelist_file}) not found!")
|
|
13
|
+
if not whitelist_file_path.exists():
|
|
14
|
+
logger.error(f"Whitelist file '{whitelist_file_path.relative_to(current_dir)}' does not exist")
|
|
14
15
|
return 1
|
|
15
16
|
|
|
16
17
|
whitelisted_players = whitelist.list_players()
|
|
@@ -18,7 +19,7 @@ def run(args: Namespace) -> int:
|
|
|
18
19
|
player_count: int = len(whitelisted_players)
|
|
19
20
|
if player_count == 0:
|
|
20
21
|
logger.info("There are no whitelisted player.")
|
|
21
|
-
return
|
|
22
|
+
return 1
|
|
22
23
|
|
|
23
24
|
player_list: list[str] = []
|
|
24
25
|
for player in whitelisted_players:
|
|
@@ -2,13 +2,19 @@ import logging
|
|
|
2
2
|
from argparse import Namespace
|
|
3
3
|
|
|
4
4
|
from ..minecraft.player_identity import separate_uuids_and_names
|
|
5
|
+
from ..paths import current_dir
|
|
5
6
|
from ..server_files import whitelist
|
|
7
|
+
from ..server_files.paths import whitelist_file_path
|
|
6
8
|
from ..shared import pluralize
|
|
7
9
|
|
|
8
10
|
logger = logging.getLogger(__name__)
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
def run(args: Namespace) -> int:
|
|
14
|
+
if not whitelist_file_path.exists():
|
|
15
|
+
logger.error(f"Whitelist file '{whitelist_file_path.relative_to(current_dir)}' does not exist")
|
|
16
|
+
return 1
|
|
17
|
+
|
|
12
18
|
player_ids: list[str] = args.players
|
|
13
19
|
|
|
14
20
|
player_uuids, player_names = separate_uuids_and_names(player_ids)
|
|
@@ -17,7 +23,7 @@ def run(args: Namespace) -> int:
|
|
|
17
23
|
player_count: int = len(removed_players)
|
|
18
24
|
if player_count == 0:
|
|
19
25
|
logger.info("No matching player found.")
|
|
20
|
-
return
|
|
26
|
+
return 1
|
|
21
27
|
|
|
22
28
|
player_list: list[str] = []
|
|
23
29
|
for player in removed_players:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mcserver-cli
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.7.0
|
|
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
|
|
@@ -41,6 +41,7 @@ Supported platforms:
|
|
|
41
41
|
- Run `fish_add_path ~/bin` if you're using FISH
|
|
42
42
|
|
|
43
43
|
## Usage
|
|
44
|
+
- Add mods or plugins: `mcserver add <projects>`
|
|
44
45
|
- Initialize a server: `mcserver init [options]`
|
|
45
46
|
- Grant players operator: `mcserver op grant <player> [options]`
|
|
46
47
|
- List operator players: `mcserver op list`
|
|
@@ -54,13 +55,14 @@ Supported platforms:
|
|
|
54
55
|
- Remove whitelisted players: `mcserver whitelist remove <players>`
|
|
55
56
|
|
|
56
57
|
### Examples
|
|
57
|
-
- Create
|
|
58
|
+
- Create a Fabric 1.20.1 server, add Thdilos' Fox Origin, and start the server
|
|
58
59
|
```bash
|
|
59
60
|
mcserver init --game-version=1.20.1 --loader=fabric
|
|
61
|
+
mcserver add thdilos-fox-origin
|
|
60
62
|
mcserver start
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
- Search
|
|
65
|
+
- Search 50 Fabric mods for Minecraft 1.20.1 from Modrinth
|
|
64
66
|
```bash
|
|
65
67
|
mcserver search --loader=fabric --game-version=1.20.1 --limit=50
|
|
66
68
|
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
mcserver/__init__.py,sha256=
|
|
1
|
+
mcserver/__init__.py,sha256=pN4PhN2571ZXr8a7hIXzjMJ091qf3EfPK_Bv2IbLXck,22
|
|
2
2
|
mcserver/__main__.py,sha256=3-WYJCtLQ8TbzmLMYBiAsm9PC89DwjXc6s_J-izMEz8,30
|
|
3
3
|
mcserver/app.py,sha256=3JUqv2jbv8ZZnvx6GTqX8mkTN08es2RQjcpfajfPeY0,1025
|
|
4
4
|
mcserver/caching.py,sha256=oLIQuiBqlJLxSTCVyrtHoYEZvmtnb3duxhhE-P5bOR8,411
|
|
5
|
-
mcserver/cli.py,sha256=
|
|
5
|
+
mcserver/cli.py,sha256=Xq9k5qFQQmePzxs0w3ZyisdrNTZdNPiaATJtCGbr4rw,11898
|
|
6
6
|
mcserver/config.py,sha256=JlIATmTETwVTmXzrmONDBbYddj_aB4hcn8zYu5CQHTQ,2136
|
|
7
7
|
mcserver/constants.py,sha256=ME5f4dv1PbqyQ6G1lQkKtvHQ4b722De4xu5B5Vp1Hw8,480
|
|
8
8
|
mcserver/metadata.py,sha256=sPstt7jrtPh1_kthje-loQ6UYB2c5m496IOJFYeGxjI,977
|
|
@@ -17,10 +17,10 @@ mcserver/commands/add_projects.py,sha256=_tzqBMv26y4ltY2qrj_w_1TI8EwmybekME_GyCf
|
|
|
17
17
|
mcserver/commands/import_setup.py,sha256=NbByM4seH0dAYo2QEj37VsL_J_Mtvg0S7NTsTFbcneA,181
|
|
18
18
|
mcserver/commands/initialize_server.py,sha256=ZvpEHjpCsvfA2vRHJzt5uypuIq96UUvhCUANA53gUgg,5939
|
|
19
19
|
mcserver/commands/list_projects.py,sha256=XG7U6oMVxQrTuV_GFCsp5aYZJphjyYwFDZiiURnjzNw,155
|
|
20
|
-
mcserver/commands/op_grant.py,sha256=
|
|
21
|
-
mcserver/commands/op_list.py,sha256=
|
|
22
|
-
mcserver/commands/op_revoke.py,sha256=
|
|
23
|
-
mcserver/commands/print_help.py,sha256=
|
|
20
|
+
mcserver/commands/op_grant.py,sha256=1HGi1wtlhNDk3qmVnTMPUrNFFa_KDOjwdZErrUqHe7U,4124
|
|
21
|
+
mcserver/commands/op_list.py,sha256=L48aLxeTS4YbtT_rhpKuZsxa4E3_2MTBV8Fs-ERfF1Q,995
|
|
22
|
+
mcserver/commands/op_revoke.py,sha256=9iZbyvNjSkS0eMy94tUMyUsYHdBbf2HjejMu04FDiKU,1251
|
|
23
|
+
mcserver/commands/print_help.py,sha256=gd9zHFondozA41aT_ZuhVjby5k-zzZYrzocAQjpXSyc,147
|
|
24
24
|
mcserver/commands/remove_projects.py,sha256=XG7U6oMVxQrTuV_GFCsp5aYZJphjyYwFDZiiURnjzNw,155
|
|
25
25
|
mcserver/commands/search_projects.py,sha256=jfMqrWuan7rqeadG1I9E9coJJUJQnSJ4Oo--rQ1DWjE,6389
|
|
26
26
|
mcserver/commands/server_status.py,sha256=XG7U6oMVxQrTuV_GFCsp5aYZJphjyYwFDZiiURnjzNw,155
|
|
@@ -28,9 +28,9 @@ mcserver/commands/show_projects.py,sha256=2mnuV8z8Ws1GSX_iMGsI5lrdu32ZsvAHI11eq7
|
|
|
28
28
|
mcserver/commands/start_server.py,sha256=IzsSiS4PW6OdgwmJsDDlmTqdb9-tto-lTYLewuy493U,5826
|
|
29
29
|
mcserver/commands/stop_server.py,sha256=l3-OiInwPlj1ApWQ8ZTqBsMKmkAPCh1MAjoqYLnHnO4,555
|
|
30
30
|
mcserver/commands/update_projects.py,sha256=XG7U6oMVxQrTuV_GFCsp5aYZJphjyYwFDZiiURnjzNw,155
|
|
31
|
-
mcserver/commands/whitelist_add.py,sha256=
|
|
32
|
-
mcserver/commands/whitelist_list.py,sha256=
|
|
33
|
-
mcserver/commands/whitelist_remove.py,sha256
|
|
31
|
+
mcserver/commands/whitelist_add.py,sha256=YTUllcNoXVSWBAYgYtiSmoV9L1XYxTXySsVj3YHa1zY,3129
|
|
32
|
+
mcserver/commands/whitelist_list.py,sha256=3gPJ4V-tGaW6M_jsyvqB8m5voh4ZKHI7Wj389GaMFsk,997
|
|
33
|
+
mcserver/commands/whitelist_remove.py,sha256=-bNCm3NVwvx6oN0Rj5UTT5eOfKc3VGkaItaUGfDdC60,1216
|
|
34
34
|
mcserver/fabricmc/meta.py,sha256=aQl_qPKLic0wM-CdhJimLvkP277nunD_kcZQQN0p9So,1113
|
|
35
35
|
mcserver/legacy_fabric/meta.py,sha256=FRrPm4QZq3uuH7zscjyHPs-zoFW7uREIz3iWaX_Tqxs,911
|
|
36
36
|
mcserver/minecraft/api.py,sha256=spkpo43Ux2et9K8eXWTk-8t2xLfQhk_0XeYtXR_sE8o,3158
|
|
@@ -64,8 +64,8 @@ mcserver/server_files/server_properties.py,sha256=8b8gY6haiPi5fKuCgrEZBH6S4yYLst
|
|
|
64
64
|
mcserver/server_files/shared.py,sha256=7xrjv77KAsfREqEsgU2HyBNv9hI9bNWaWTDu5geOSqs,385
|
|
65
65
|
mcserver/server_files/usercaches.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
66
|
mcserver/server_files/whitelist.py,sha256=88Q_iKXgFuYOaz769MGWIn52QOlc-7LSXTPQTqsAk6Q,5711
|
|
67
|
-
mcserver_cli-4.
|
|
68
|
-
mcserver_cli-4.
|
|
69
|
-
mcserver_cli-4.
|
|
70
|
-
mcserver_cli-4.
|
|
71
|
-
mcserver_cli-4.
|
|
67
|
+
mcserver_cli-4.7.0.dist-info/METADATA,sha256=ZS-u1qkNupfpkoSfBIkaZo4017JWfzObRVDTqiyWbb8,2952
|
|
68
|
+
mcserver_cli-4.7.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
69
|
+
mcserver_cli-4.7.0.dist-info/entry_points.txt,sha256=p7uN6UdTzjea7nGIkhjiYDYd7wznkxz9amUPY_fpz24,47
|
|
70
|
+
mcserver_cli-4.7.0.dist-info/licenses/LICENSE,sha256=OzeasqJgwxVpwtMkEYOLoDPUnIDSbVcW62rk-voA3eI,1076
|
|
71
|
+
mcserver_cli-4.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|