diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-11 13:33:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-11 13:33:42 +0000 |
commit | 85bd008c039eb1d93894e94fba9d158a42a71a12 (patch) | |
tree | 2d72d10759f6928e9e4b960175d2de01b5cf7e12 /protocols/Xfire/src/sendgamestatuspacket.cpp | |
parent | 222802c2986dcaf029fdfb828b7679bdabfa7bb2 (diff) |
massive code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@14910 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Xfire/src/sendgamestatuspacket.cpp')
-rw-r--r-- | protocols/Xfire/src/sendgamestatuspacket.cpp | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/protocols/Xfire/src/sendgamestatuspacket.cpp b/protocols/Xfire/src/sendgamestatuspacket.cpp index fe3ae43e5a..597bfb7e8a 100644 --- a/protocols/Xfire/src/sendgamestatuspacket.cpp +++ b/protocols/Xfire/src/sendgamestatuspacket.cpp @@ -27,43 +27,42 @@ #include <windows.h> -namespace xfirelib { +namespace xfirelib +{ + SendGameStatusPacket::SendGameStatusPacket() + { + ip[0] = ip[1] = ip[2] = ip[3] = 0; + port = 0; + } - SendGameStatusPacket::SendGameStatusPacket() { - ip[0] = ip[1] = ip[2] = ip[3] = 0; - port = 0; - } + int SendGameStatusPacket::getPacketContent(char *buf) + { + VariableValue val; - int SendGameStatusPacket::getPacketContent(char *buf) { - - VariableValue val; + val.setName(getGameAttributeName()); - val.setName( getGameAttributeName() ); + val.setValueFromLong(gameid, 4); - val.setValueFromLong(gameid,4); - - int index = 0; - index += val.writeName(buf, index); - buf[index++] = 02; - index += val.writeValue(buf, index); + int index = 0; + index += val.writeName(buf, index); + buf[index++] = 02; + index += val.writeValue(buf, index); - val.setName( getIPAttributeName() ); + val.setName(getIPAttributeName()); - //BUG: hab ,4 hinzugefügt, führte und vista zum crash - dufte - val.setValue(ip,4); - val.setValueLength(4); - - index += val.writeName(buf, index); - buf[index++] = 02; - index += val.writeValue(buf, index); - val.setName( getPortAttributeName() ); - val.setValueFromLong(port,4); - index += val.writeName(buf, index); - buf[index++] = 02; - index += val.writeValue(buf, index); - - return index; - } + //BUG: hab ,4 hinzugefügt, führte und vista zum crash - dufte + val.setValue(ip, 4); + val.setValueLength(4); + index += val.writeName(buf, index); + buf[index++] = 02; + index += val.writeValue(buf, index); + val.setName(getPortAttributeName()); + val.setValueFromLong(port, 4); + index += val.writeName(buf, index); + buf[index++] = 02; + index += val.writeValue(buf, index); + return index; + } }; |