code = str(map_code).strip()
if code.startswith("#"):
code = code[1:]
return code.encode("utf-8")
def build_craftland_join(account_id: int, map_code: str, region: str = "BD",
game_version: str = "1.132.13") -> dict:
"""
Returns a proto field dict for Craftland room join.
Caller wraps it via create_proto() + create_packet().
"""
code_bytes = _encode_map_code(map_code)
fields = {
1: 20, # sendOption / action = join custom room
2: {
1: int(account_id),
7: {1: "IDC3", 2: 410, 3: str(region).upper()},
# custom room / craftland block
16: {
1: code_bytes, # map_code
2: 1, # room_type = craftland
3: game_version,
},
20: 1,
},
}
return fields
def build_craftland_start(account_id: int, map_code: str, region: str = "BD",
game_version: str = "1.132.13") -> dict:
"""StartMatch packet for Craftland — sent after join ack."""
code_bytes = _encode_map_code(map_code)
fields = {
1: 9,
2: {
1: int(account_id),
7: {1: "IDC3", 2: 410, 3: str(region).upper()},
16: {
1: code_bytes,
2: 1,
3: game_version,
},
},
}
return fields
👾Craftland room creator by map code
👑CREDIT : AGS