diff options
Diffstat (limited to 'protocols/Xfire/src/xfireclanpacket.cpp')
-rw-r--r-- | protocols/Xfire/src/xfireclanpacket.cpp | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/protocols/Xfire/src/xfireclanpacket.cpp b/protocols/Xfire/src/xfireclanpacket.cpp index c26577fae1..2bc6796572 100644 --- a/protocols/Xfire/src/xfireclanpacket.cpp +++ b/protocols/Xfire/src/xfireclanpacket.cpp @@ -26,54 +26,50 @@ #include "xfireclanpacket.h" #include "variablevalue.h" -#include <string> -namespace xfirelib { - using namespace std; +using namespace std; - void XFireClanPacket::parseContent(char *buf, int nlength, int numberOfAtts) { - VariableValue val; - int index = 0; - int length = 0; - string stringvalue; - - index += 3; // ersten 5 bytes skippen +namespace xfirelib +{ + void XFireClanPacket::parseContent(char *buf, int, int) + { + VariableValue val; + int index = 0; + int length = 0; + string stringvalue; - this->count=(char)buf[index]; + index += 3; // ersten 5 bytes skippen - index += 2; + this->count = (char)buf[index]; - for(int i=0;i<this->count;i++) - { - index += val.readValue(buf,index,2); //clanid lesen - this->clanid[i] = val.getValueAsLong(); index += 2; - } - - index += 5; // 7 bytes skippen - for(int i=0;i<this->count;i++) - { - length = (unsigned char)buf[index++]; //clannamen lesen - index++; - index += val.readValue(buf,index,length); - stringvalue = string(val.getValue(),length); + for (int i = 0; i < this->count; i++) { + index += val.readValue(buf, index, 2); //clanid lesen + this->clanid[i] = val.getValueAsLong(); + index += 2; + } - this->name[i] = stringvalue; - } + index += 5; // 7 bytes skippen - index += 5; // 5 skippen + for (int i = 0; i < this->count; i++) { + length = (unsigned char)buf[index++]; //clannamen lesen + index++; + index += val.readValue(buf, index, length); + stringvalue = string(val.getValue(), length); - for(int i=0;i<this->count;i++) - { - length = (unsigned char)buf[index++]; //url anhängsel auslesen - index++; - index += val.readValue(buf,index,length); - stringvalue = string(val.getValue(),length); + this->name[i] = stringvalue; + } - this->url[i] = stringvalue; - } + index += 5; // 5 skippen - } + for (int i = 0; i < this->count; i++) { + length = (unsigned char)buf[index++]; //url anhängsel auslesen + index++; + index += val.readValue(buf, index, length); + stringvalue = string(val.getValue(), length); -}; + this->url[i] = stringvalue; + } + } +} |