Skip to content

Commit

Permalink
Print ip and port server is listening on
Browse files Browse the repository at this point in the history
  • Loading branch information
Solirs committed Jun 27, 2023
1 parent 014521c commit 7747006
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion freefang/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import time
import struct

ip = "0.0.0.0"
port = 9999

def parse_ruleset(ruleset):
ret = {}
for key, value in ruleset.__dict__.items():
Expand All @@ -27,8 +30,9 @@ def game_creation_loop():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) #For devs only
s.setblocking(0)
s.bind(("0.0.0.0", 9999))
s.bind((ip, port))
s.listen()
print(f"Listening on {ip}:{port}")

inputs = [s]
outputs = []
Expand Down

0 comments on commit 7747006

Please sign in to comment.