Skip to content

Instantly share code, notes, and snippets.

View johan-boule's full-sized avatar
💭
For freedom, let's just stick to IRC/Matrix https://app.element.io

Johan Boule johan-boule

💭
For freedom, let's just stick to IRC/Matrix https://app.element.io
View GitHub Profile
@johan-boule
johan-boule / lobby_server.py
Last active January 21, 2026 00:30
Warzone 2100 Lobby server
#! /usr/bin/env python3
import sys, threading, socketserver, struct, copy
motd = sys.argv[1].encode() if len(sys.argv) > 1 else b'Welcome to Warzone 2100 lobby server'
game_size_host = struct.calcsize('!I64si4B')
game_size = game_size_host + struct.calcsize('40s2iI2H2I40s40s157sH40s40s64s255s9I')
lock = threading.Lock()
@johan-boule
johan-boule / lobby_client.py
Last active January 21, 2026 00:59
Warzone 2100 Lobby client - list command
#! /usr/bin/env python3
import sys, socket, struct, dataclasses
host = sys.argv[1] if len(sys.argv) > 1 else 'lobby.wz2100.net'
port = int(sys.argv[2]) if len(sys.argv) > 2 else 9990
@dataclasses.dataclass
class Game:
binary_format = '!I64si4B40s2iI2H2I40s40s157sH40s40s64s255s9I'
@johan-boule
johan-boule / gist:ef1b000fa11c95007628
Last active August 29, 2015 14:26 — forked from schacon/gist:1
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
How long will this gist last ?