-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
122 lines (114 loc) · 2.79 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import asyncio
from src.handler import (
papermc_runner,
arclight_powered_runner,
catserver_runner,
leavesmc_runner,
sponge_powered_runner,
bungeecord_runner,
pufferfish_runner,
mohistmc_runner,
getbukkit_runner,
purpurmc_runner,
fabric_runner,
forge_runner,
nukkitx_runner,
akarin_runner,
thermos_runner,
contigo_runner,
luminol_runner,
geysermc_runner,
)
from src.utils import SyncLogger, init_settings, read_settings, argument_parser
from src import __version__
from src.api import start_production_server
import sys
available_core = """
ArclightPowered
├─Arclight
├─Lightfall
└─Lightfall Client
MohistMC
├─Banner
└─Mohist
SpigotMC
├─Spigot
└─BungeeCord
LeavesMC
└─Leaves
Pufferfish
├─Pufferfish
├─Pufferfish+
└─Pufferfish+ (Purpur)
SpongePowered
├─SpongeForge
└─SpongeVanilla
PaperMC
├─Paper
├─Folia
├─Travertine
├─Velocity
└─Waterfall
PurpurMC
├─Purpur
└─Purformance
LuminolMC
├─Luminol
└─LightingLuminol
GeyserMC
├─Geyser
└─Floodgate
NukkitX
Thermos
Contigo
Akarin
CatServer
Craftbukkit
Vanilla
Fabric
Forge"""
async def update_default():
tasks = [
asyncio.create_task(bungeecord_runner()),
asyncio.create_task(forge_runner()),
asyncio.create_task(fabric_runner()),
asyncio.create_task(nukkitx_runner()),
asyncio.create_task(thermos_runner()),
asyncio.create_task(arclight_powered_runner()),
asyncio.create_task(akarin_runner()),
asyncio.create_task(catserver_runner()),
asyncio.create_task(sponge_powered_runner()),
asyncio.create_task(papermc_runner()),
asyncio.create_task(pufferfish_runner()),
asyncio.create_task(getbukkit_runner()),
asyncio.create_task(leavesmc_runner()),
asyncio.create_task(purpurmc_runner()),
asyncio.create_task(mohistmc_runner()),
asyncio.create_task(contigo_runner()),
asyncio.create_task(luminol_runner()),
asyncio.create_task(geysermc_runner()),
]
for task in tasks:
await task
if __name__ == "__main__":
args = argument_parser.parse_args()
if not any(value for _, value in args.__dict__.items()):
argument_parser.error("No argument was specified.")
if args.init:
init_settings()
if args.server:
read_settings()
start_production_server()
if args.version:
print(__version__)
if args.core_list:
SyncLogger.success(available_core)
if args.update:
asyncio.run(update_default())
if args.optimize:
from src.utils import optimize_core_data
asyncio.run(optimize_core_data())
if args.add_node:
from src.utils import add_node
add_node(args.add_node)
sys.exit(0)