From b86dcbac7448021650ce29d8db4696224a924a8a Mon Sep 17 00:00:00 2001 From: Sepalani Date: Tue, 16 Feb 2016 15:47:39 +0100 Subject: [PATCH] [WIP] NATNEG: Added backup command --- gamespy_natneg_server.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gamespy_natneg_server.py b/gamespy_natneg_server.py index 707680a..da4ebe5 100644 --- a/gamespy_natneg_server.py +++ b/gamespy_natneg_server.py @@ -381,12 +381,15 @@ def handle_natneg_backup_test(nn, recv_data, addr, socket): TODO Description: - TODO + Untested """ - logger.log(logging.WARNING, - "Received unimplemented command NN_BACKUP_TEST (0x08)" - " from %s:%d...", *addr) - logger.log(logging.DEBUG, "%s", utils.pretty_print_hex(output)) + logger.log(logging.DEBUG, "Received backup command from %s:%d...", *addr) + logger.log(logging.DEBUG, "%s", utils.pretty_print_hex(recv_data)) + + # Backup response + output = bytearray(recv_data) + output[7] = 0x09 # NN_BACKUP_ACK + nn.write_queue.put((output, addr, socket)) def handle_natneg_backup_ack(nn, recv_data, addr, socket):