Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .scripts/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def check_metadata(args: argparse.Namespace) -> defaultdict[str, list[str]]:
messages[server_id] = [f"{server_id} is being edited but is in the inactive file!"]

# Looping over each server folder
seen_domains = defaultdict(set)
for root, _, _ in os.walk(args.servers_dir):
server_id = root.split(os.path.sep)[-1]
if (
Expand All @@ -241,6 +242,8 @@ def check_metadata(args: argparse.Namespace) -> defaultdict[str, list[str]]:
primary_domain = get_tld(server.get("primaryAddress", ""), as_object=True, fail_silently=True, fix_protocol=True)
if primary_domain is not None and primary_domain.fld not in server["addresses"]:
messages[server_id].append(f"The primary address' domain ({primary_domain.fld}) is not in the addresses list. Or the primary address is not a valid domain.")
elif primary_domain is None:
messages[server_id].append(f"The primary address `{server.get('primaryAddress', '')}` is not a valid domain. Please review the [documentation](https://lunarclient.dev/server-mappings/adding-servers/metadata).")


all_versions = get_all_versions(server["minecraftVersions"])
Expand All @@ -256,6 +259,13 @@ def check_metadata(args: argparse.Namespace) -> defaultdict[str, list[str]]:
domain = get_tld(address, as_object=True, fail_silently=True, fix_protocol=True)
if domain is not None and domain.subdomain:
messages[server_id].append(f"{address} does not follow the [documentation](https://lunarclient.dev/server-mappings/adding-servers/metadata). Please make sure the address is a valid domain, and does not have a subdomain.")

if domain is not None and domain.fld in seen_domains:
messages[server_id].append(f"The domain {domain.fld} is also present in {', '.join(map(lambda s: f"`{s}`", seen_domains[domain.fld]))}. Please ensure each server has a unique domain(s).")
elif domain is not None:
seen_domains[domain.fld].add(server_id)
else:
messages[server_id].append(f"`{address}` is not a valid domain. Please review the [documentation](https://lunarclient.dev/server-mappings/adding-servers/metadata).")

if primary_region := server.get("primaryRegion"):
if not (regions := server.get("regions")) or primary_region not in regions:
Expand Down
3 changes: 3 additions & 0 deletions inactive.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"cometmc",
"corepvp",
"craftoriya",
"crimsonsmp",
"crystal",
"crobarus",
"crove",
Expand Down Expand Up @@ -201,6 +202,7 @@
"mysticlands",
"mythicnetwork",
"nasgar",
"naturemc",
"navybridge",
"neptunemc",
"nexopvp",
Expand Down Expand Up @@ -259,6 +261,7 @@
"plasma",
"evamc",
"voidmc",
"voidpixel",
"mushroomnet",
"zeromc",
"asrbw",
Expand Down
1 change: 0 additions & 1 deletion servers/akyto/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"addresses": [
"akyto.club",
"akyto.net",
"potted.gg",
"groupezk.fr",
"pvptemple.it"
],
Expand Down
3 changes: 1 addition & 2 deletions servers/beemc/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"website": "https://beemc.pl/",
"store": "https://sklep.beemc.pl/",
"addresses": [
"beemc.pl",
"193.41.226.236"
"beemc.pl"
],
"primaryAddress": "mc.beemc.pl",
"primaryColor": "#FFD700",
Expand Down
2 changes: 0 additions & 2 deletions servers/bte/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
"bteuk.net",
"btefrance.fr",
"bteoce.com",
"139.99.91.188",
"btehkmu.net",
"142.202.222.202",
"btemexca.net",
"bteconosur.com",
"bteromania.ro",
Expand Down
3 changes: 1 addition & 2 deletions servers/ember/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"emberpvp.es",
"emberpvp.club",
"pvpsurge.com",
"varant.es",
"exempvp.es"
"varant.es"
],
"primaryAddress": "emberpvp.es",
"primaryColor": "#f62c22",
Expand Down
3 changes: 1 addition & 2 deletions servers/eternitymcnet/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"website": "https://eternitymc.net/",
"store": "https://store.eternitymc.net/",
"addresses": [
"eternitymc.net",
"pvpmania.eu"
"eternitymc.net"
],
"primaryAddress": "mc.eternitymc.net",
"primaryColor": "#00aaaa",
Expand Down
1 change: 0 additions & 1 deletion servers/exodiamc/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"store": "https://tienda.exodiamc.net",
"description": "A Spanish-speaking server that offers fair gameplay for everyone.",
"addresses": [
"gamesmadeinpola.com",
"exodiamc.net"
],
"primaryAddress": "exodiamc.net",
Expand Down
2 changes: 0 additions & 2 deletions servers/gapplemc/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"store": "https://store.gapplemc.net",
"description": "GappleMC is THE Hispanic server you're looking for.",
"addresses": [
"gegmc.net",
"gegcraft.org",
"gapplemc.com"
],
"primaryAddress": "gapplemc.com",
Expand Down
1 change: 0 additions & 1 deletion servers/kaiya/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"website": "https://kaiya.rip/",
"addresses": [
"kaiya.rip",
"rengo.us",
"kuda.rip"
],
"primaryAddress": "kaiya.rip",
Expand Down
1 change: 0 additions & 1 deletion servers/liroyo/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"name": "Liroyo Network",
"store": "https://store.liroyo.online/",
"addresses": [
"topstrix.net",
"topstrix.com",
"liroyo.online"
],
Expand Down
1 change: 0 additions & 1 deletion servers/mazemc/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"store": "https://mazemc.es/store",
"description": "PvP Network for players, by players.",
"addresses": [
"imanity.club",
"mazemc.es"
],
"primaryAddress": "mazemc.es",
Expand Down
1 change: 0 additions & 1 deletion servers/minerel/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"name": "Minerel",
"store": "https://store.minerel.net/",
"addresses": [
"acepvp.fun",
"minerel.net",
"allayrival.net"
],
Expand Down
3 changes: 1 addition & 2 deletions servers/pixelhaven/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"website": "https://pixelhaven.pro/",
"store": "https://sklep.pixelhaven.pro/",
"addresses": [
"pixelhaven.pro",
"193.41.226.236"
"pixelhaven.pro"
],
"primaryAddress": "mc.pixelhaven.pro",
"primaryColor": "#00FF26",
Expand Down
3 changes: 1 addition & 2 deletions servers/potted/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"name": "Potted",
"description": "A ranked server integrating Practice and HCFW",
"addresses": [
"potted.gg",
"pvptemple.it"
"potted.gg"
],
"primaryAddress": "potted.gg",
"primaryColor": "#ad0099",
Expand Down
3 changes: 1 addition & 2 deletions servers/rage/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"name": "Rage",
"store": "https://store.rage.rip/",
"addresses": [
"rage.rip",
"ranked.rip"
"rage.rip"
],
"primaryAddress": "rage.rip",
"primaryColor": "#db213a",
Expand Down
4 changes: 1 addition & 3 deletions servers/ranked/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"name": "Ranked Games",
"store": "https://store.ranked.rip/",
"addresses": [
"ranked.rip",
"horu.us",
"galanthusmc.net"
"ranked.rip"
],
"primaryAddress": "ranked.rip",
"primaryColor": "#f62c22",
Expand Down
1 change: 0 additions & 1 deletion servers/scala/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"store": "https://store.scala.gg/",
"addresses": [
"scala.gg",
"esta.land",
"solara.gg",
"pvptemple.com",
"potpvp.com"
Expand Down