|
From: <iea...@us...> - 2009-05-26 02:22:20
|
Revision: 729
http://seq.svn.sourceforge.net/seq/?rev=729&view=rev
Author: ieatacid
Date: 2009-05-26 01:32:18 +0000 (Tue, 26 May 2009)
Log Message:
-----------
Fixed guild name bug
Modified Paths:
--------------
showeq/trunk/ChangeLog
showeq/trunk/configure.in
showeq/trunk/src/guild.cpp
showeq/trunk/src/guild.h
Modified: showeq/trunk/ChangeLog
===================================================================
--- showeq/trunk/ChangeLog 2009-05-20 22:06:24 UTC (rev 728)
+++ showeq/trunk/ChangeLog 2009-05-26 01:32:18 UTC (rev 729)
@@ -1,3 +1,7 @@
+ieatacid (5/25/09)
+-----------------
+- Fixed guild name bug
+
ieatacid (5/20/09)
-----------------
- Updated version to 5.13.4
Modified: showeq/trunk/configure.in
===================================================================
--- showeq/trunk/configure.in 2009-05-20 22:06:24 UTC (rev 728)
+++ showeq/trunk/configure.in 2009-05-26 01:32:18 UTC (rev 729)
@@ -2,7 +2,7 @@
dnl $Id$ $Name$
AC_PREREQ(2.59)
-AC_INIT(showeq, 5.13.4.0)
+AC_INIT(showeq, 5.13.4.1)
AC_CONFIG_SRCDIR(src/main.cpp)
AC_CANONICAL_SYSTEM
Modified: showeq/trunk/src/guild.cpp
===================================================================
--- showeq/trunk/src/guild.cpp 2009-05-20 22:06:24 UTC (rev 728)
+++ showeq/trunk/src/guild.cpp 2009-05-26 01:32:18 UTC (rev 729)
@@ -69,6 +69,7 @@
NetStream netStream(data,len);
QString guildName;
uint32_t size = 0; // to keep track of how much we're reading from the packet
+ uint32_t guildId = 0;
/*
0x48 in the packet starts the serialized list. See guildListStruct
@@ -81,29 +82,33 @@
while(!netStream.end())
{
- char szGuildName[64] = {0};
-
- // skip guild ID
- netStream.skipBytes(4);
+ guildId = netStream.readUInt32NC();
guildName = netStream.readText();
size += 4; // four bytes for the guild ID
if(guildName.length())
{
- strcpy(szGuildName, guildName.latin1());
+ m_guildList[guildId] = guildName;
-// seqDebug("GuildMgr::writeGuildList - add guild '%s'", szGuildName);
- guildDataStream.writeRawBytes(szGuildName, sizeof(szGuildName));
-
// add guild name length, plus one for the null character
size += guildName.length() + 1;
}
- // there's an extra zero at the end of the packet
if(size + 1 == len)
break; // the end
}
+ std::map<uint32_t, QString>::iterator it;
+
+ for(it = m_guildList.begin(); it != m_guildList.end(); it++)
+ {
+ char szGuildName[64] = {0};
+
+ strcpy(szGuildName, it->second.latin1());
+ //seqDebug("GuildMgr::writeGuildList - add guild '%s' (%d)", szGuildName, it->first);
+ guildDataStream.writeRawBytes(szGuildName, sizeof(szGuildName));
+ }
+
guildsfile.close();
seqInfo("GuildMgr: New guildsfile written");
}
@@ -120,7 +125,7 @@
char szGuildName[64] = {0};
guildsfile.readBlock(szGuildName, sizeof(szGuildName));
-// seqDebug("GuildMgr::readGuildList - read guild '%s'", szGuildName);
+ //seqDebug("GuildMgr::readGuildList - read guild '%s'", szGuildName);
m_guildMap.push_back(QString::fromUtf8(szGuildName));
}
Modified: showeq/trunk/src/guild.h
===================================================================
--- showeq/trunk/src/guild.h 2009-05-20 22:06:24 UTC (rev 728)
+++ showeq/trunk/src/guild.h 2009-05-26 01:32:18 UTC (rev 729)
@@ -43,6 +43,7 @@
private:
std::vector<QString> m_guildMap;
+ std::map<uint32_t, QString> m_guildList;
void writeGuildList(const uint8_t*, size_t);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|