lots of stuff had been added
This commit is contained in:
parent
28420e86dd
commit
814900b72e
16 changed files with 257 additions and 0 deletions
22
broadcast/broadcast.py
Normal file
22
broadcast/broadcast.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import socket
|
||||
import time
|
||||
|
||||
servers = [
|
||||
["WalkerCraft", 25565],
|
||||
["Modded WalkerCraft", 25566],
|
||||
# ["All the Walkers 9", 25509],
|
||||
]
|
||||
|
||||
BROADCAST_IP = "255.255.255.255"
|
||||
BROADCAST_PORT = 4445
|
||||
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
||||
|
||||
print("Broadcasting Minecraft servers to LAN")
|
||||
|
||||
while 1:
|
||||
for server in servers:
|
||||
msg = f"[MOTD]{server[0]}[/MOTD][AD]{server[1]}[/AD]"
|
||||
sock.sendto(msg.encode(), (BROADCAST_IP, BROADCAST_PORT))
|
||||
time.sleep(1.5)
|
||||
Loading…
Add table
Add a link
Reference in a new issue