From 388a04d957a0fd9af9287cbe6f1ee905371886c7 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 8 Nov 2008 12:50:46 +0000 Subject: better voting support --- src/game/client/components/maplist.cpp | 45 ---------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/game/client/components/maplist.cpp (limited to 'src/game/client/components/maplist.cpp') diff --git a/src/game/client/components/maplist.cpp b/src/game/client/components/maplist.cpp deleted file mode 100644 index 027ec449..00000000 --- a/src/game/client/components/maplist.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include - -#include "maplist.hpp" - -MAPLIST::MAPLIST() -{ - on_reset(); -} - -void MAPLIST::on_reset() -{ - buffer[0] = 0; - num_maps = 0; -} - -static bool is_separator(char c) { return c == ';' || c == ' ' || c == ',' || c == '\t'; } - -void MAPLIST::on_message(int msgtype, void *rawmsg) -{ - if(msgtype == NETMSGTYPE_SV_MAPLIST) - { - NETMSG_SV_MAPLIST *msg = (NETMSG_SV_MAPLIST*)rawmsg; - str_copy(buffer, msg->names, sizeof(buffer)); - - // parse list - num_maps = 0; - char *ptr = buffer; - while(*ptr) - { - while(*ptr && is_separator(*ptr)) - { - *ptr = 0; - ptr++; - } - - if(*ptr) - { - maps[num_maps++] = ptr; - while(*ptr && !is_separator(*ptr)) - ptr++; - } - } - } -} -- cgit 1.4.1