|
From: <cn...@us...> - 2023-03-15 18:26:11
|
Revision: 1353
http://sourceforge.net/p/seq/svn/1353
Author: cn187
Date: 2023-03-15 18:26:08 +0000 (Wed, 15 Mar 2023)
Log Message:
-----------
Fix Qt deprecation warnings about QString::sprintf
Modified Paths:
--------------
showeq/trunk/src/bazaarlog.cpp
showeq/trunk/src/category.cpp
showeq/trunk/src/combatlog.cpp
showeq/trunk/src/editor.cpp
showeq/trunk/src/eqstr.cpp
showeq/trunk/src/interface.cpp
showeq/trunk/src/map.cpp
showeq/trunk/src/mapicon.cpp
showeq/trunk/src/messageshell.cpp
showeq/trunk/src/netdiag.cpp
showeq/trunk/src/packet.cpp
showeq/trunk/src/packetinfo.cpp
showeq/trunk/src/packetlog.cpp
showeq/trunk/src/packetstream.cpp
showeq/trunk/src/seqlistview.cpp
showeq/trunk/src/skilllist.cpp
showeq/trunk/src/spawn.cpp
showeq/trunk/src/spawnlist.cpp
showeq/trunk/src/spawnlist2.cpp
showeq/trunk/src/spawnlistcommon.cpp
showeq/trunk/src/spawnmonitor.cpp
showeq/trunk/src/spawnpointlist.cpp
showeq/trunk/src/spellshell.cpp
showeq/trunk/src/statlist.cpp
showeq/trunk/src/util.cpp
showeq/trunk/src/xmlpreferences.cpp
showeq/trunk/src/zonemgr.cpp
Modified: showeq/trunk/src/bazaarlog.cpp
===================================================================
--- showeq/trunk/src/bazaarlog.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/bazaarlog.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -76,10 +76,17 @@
if (merchant)
merchant_name = merchant->name().toLatin1().data();
QString csv;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ csv.asprintf("1^%d^%d^%d^%s^%s",
+ int(time(NULL)),resp.price,resp.count,
+ merchant_name, name);
+ m_out << csv << ENDL;
+#else
csv.sprintf("1^%d^%d^%d^%s^%s",
int(time(NULL)),resp.price,resp.count,
merchant_name, name);
m_out << csv << ENDL;
+#endif
}
flush();
Modified: showeq/trunk/src/category.cpp
===================================================================
--- showeq/trunk/src/category.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/category.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -337,7 +337,11 @@
QString tempStr;
for(i = 1; i <= tMaxNumCategories; i++)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ prefBaseName.asprintf("Category%d_", i);
+#else
prefBaseName.sprintf("Category%d_", i);
+#endif
// attempt to pull a button title from the preferences
tempStr = prefBaseName + "Name";
@@ -386,7 +390,11 @@
if (!curCategory)
break;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ prefBaseName.asprintf("Category%d_", count++);
+#else
prefBaseName.sprintf("Category%d_", count++);
+#endif
pSEQPrefs->setPrefString(prefBaseName + "Name", section,
curCategory->name());
pSEQPrefs->setPrefString(prefBaseName + "Filter", section,
@@ -400,7 +408,11 @@
QColor black("black");
while (count <= tMaxNumCategories)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ prefBaseName.asprintf("Category%d_", count++);
+#else
prefBaseName.sprintf("Category%d_", count++);
+#endif
pSEQPrefs->setPrefString(prefBaseName + "Name", section, "");
pSEQPrefs->setPrefString(prefBaseName + "Filter", section, "");
pSEQPrefs->setPrefString(prefBaseName + "FilterOut", section, "");
Modified: showeq/trunk/src/combatlog.cpp
===================================================================
--- showeq/trunk/src/combatlog.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/combatlog.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -631,12 +631,20 @@
case 52: // Tiger Claw
{
// this is a normal skill
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ s_type.asprintf("%s(%d)", skill_name(iType).toLatin1().data(), iType);
+#else
s_type.sprintf("%s(%d)", skill_name(iType).toLatin1().data(), iType);
+#endif
break;
}
case 231: // Non Melee Damage
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ s_type.asprintf("Spell: %s(%d)", spell_name(iSpell).toLatin1().data(), iSpell);
+#else
s_type.sprintf("Spell: %s(%d)", spell_name(iSpell).toLatin1().data(), iSpell);
+#endif
break;
}
default: // Damage Shield?
@@ -645,7 +653,11 @@
// 248 Flameshield of Ro? (45pt) (mage)
// -11 Killing Blow with MoR
// -8 Killing Blow with Ro? (45pt) (mage)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ s_type.asprintf("Damage Shield: (%d)", iType);
+#else
s_type.sprintf("Damage Shield: (%d)", iType);
+#endif
break;
}
}
Modified: showeq/trunk/src/editor.cpp
===================================================================
--- showeq/trunk/src/editor.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/editor.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -160,7 +160,11 @@
e->document()->setModified( false );
setWindowTitle( fileName );
QString s;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ s.asprintf( "Opened %s", fileName );
+#else
s.sprintf( "Opened %s", fileName );
+#endif
statusBar()->showMessage( s, 2000 );
}
Modified: showeq/trunk/src/eqstr.cpp
===================================================================
--- showeq/trunk/src/eqstr.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/eqstr.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -143,7 +143,11 @@
{
uint32_t arg_len;
unsigned char *cp;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf( "Unknown: %04x:", formatid);
+#else
tempStr.sprintf( "Unknown: %04x:", formatid);
+#endif
cp = (unsigned char *) arguments;
while (cp < ((unsigned char *) &arguments[argsLen] - sizeof(uint32_t)*sizeof(unsigned char))) {
arg_len = (cp[0] << 0) | (cp[1] << 8) | (cp[2] << 16) | (cp[3] << 24);
Modified: showeq/trunk/src/interface.cpp
===================================================================
--- showeq/trunk/src/interface.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/interface.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -3126,7 +3126,11 @@
{
int i = winnum - mapCaptionBase;
if (i)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ title.asprintf("Map %d", i);
+#else
title.sprintf("Map %d", i);
+#endif
else
title = "Map";
@@ -3722,17 +3726,31 @@
if (spell)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ txt.asprintf("%.3d %.2d %.2d %#4.04x %02d\t%s",
+ i, ((i / 8) + 1), ((i % 8) + 1),
+ spellid, spell->level(playerClass),
+ spell->name().toLatin1().data());
+#else
txt.sprintf("%.3d %.2d %.2d %#4.04x %02d\t%s",
i, ((i / 8) + 1), ((i % 8) + 1),
spellid, spell->level(playerClass),
spell->name().toLatin1().data());
+#endif
}
else
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ txt.asprintf("%.3d %.2d %.2d %#4.04x \t%s",
+ i, ((i / 8) + 1), ((i % 8) + 1),
+ spellid,
+ spell_name(spellid).toLatin1().data());
+#else
txt.sprintf("%.3d %.2d %.2d %#4.04x \t%s",
i, ((i / 8) + 1), ((i % 8) + 1),
spellid,
spell_name(spellid).toLatin1().data());
+#endif
}
out << txt << ENDL;
@@ -4679,7 +4697,11 @@
void EQInterface::levelChanged(uint8_t level)
{
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("New Level: %u", level);
+#else
tempStr.sprintf("New Level: %u", level);
+#endif
if (m_stsbarStatus)
m_stsbarStatus->setText(tempStr);
}
@@ -4704,7 +4726,11 @@
lastupdate = mTime();
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Mobs: %d", num);
+#else
tempStr.sprintf("Mobs: %d", num);
+#endif
m_stsbarSpawns->setText(tempStr);
}
@@ -4718,7 +4744,11 @@
lastupdate = mTime();
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Run Speed: %3.6f", speed);
+#else
tempStr.sprintf("Run Speed: %3.6f", speed);
+#endif
m_stsbarSpeed->setText(tempStr);
}
@@ -4752,9 +4782,17 @@
int delta = mTime() - m_packetStartTime;
num -= m_initialcount;
if (num && delta)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Pkt: %d (%2.1f)", num, (float) (num<<10) / (float) delta);
+#else
tempStr.sprintf("Pkt: %d (%2.1f)", num, (float) (num<<10) / (float) delta);
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Pkt: %d", num);
+#else
tempStr.sprintf("Pkt: %d", num);
+#endif
m_stsbarPkt->setText(tempStr);
}
@@ -4809,7 +4847,11 @@
emit newZoneName(shortZoneName);
float percentZEM = ((float)(m_zoneMgr->zoneExpMultiplier()-0.75)/0.75)*100;
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("ZEM: %3.2f%%", percentZEM);
+#else
tempStr.sprintf("ZEM: %3.2f%%", percentZEM);
+#endif
if (m_stsbarZEM)
m_stsbarZEM->setText(tempStr);
}
@@ -4821,7 +4863,11 @@
stsMessage("");
float percentZEM = ((float)(m_zoneMgr->zoneExpMultiplier()-0.75)/0.75)*100;
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("ZEM: %3.2f%%", percentZEM);
+#else
tempStr.sprintf("ZEM: %3.2f%%", percentZEM);
+#endif
if (m_stsbarZEM)
m_stsbarZEM->setText(tempStr);
}
@@ -4832,7 +4878,11 @@
stsMessage("- Busy Zoning -");
emit newZoneName(shortZoneName);
float percentZEM = ((float)(m_zoneMgr->zoneExpMultiplier()-0.75)/0.75)*100;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("ZEM: %3.2f%%", percentZEM);
+#else
tempStr.sprintf("ZEM: %3.2f%%", percentZEM);
+#endif
if (m_stsbarZEM)
m_stsbarZEM->setText(tempStr);
}
@@ -4958,15 +5008,29 @@
// construct a message for the status message display
QString string("");
if (spawn != 0)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ string.asprintf("%d: %s:%d (%d/%d) Pos:", // "%d/%d/%d (%d) %s %s Item:%s",
+ item->id(),
+ item->name().toUtf8().data(),
+ spawn->level(), spawn->HP(),
+ spawn->maxHP());
+#else
string.sprintf("%d: %s:%d (%d/%d) Pos:", // "%d/%d/%d (%d) %s %s Item:%s",
item->id(),
item->name().toUtf8().data(),
spawn->level(), spawn->HP(),
spawn->maxHP());
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ string.asprintf("%d: %s: Pos:", // "%d/%d/%d (%d) %s %s Item:%s",
+ item->id(),
+ item->name().toUtf8().data());
+#else
string.sprintf("%d: %s: Pos:", // "%d/%d/%d (%d) %s %s Item:%s",
item->id(),
item->name().toUtf8().data());
+#endif
if (showeq_params->retarded_coords)
string += QString::number(item->y()) + "/"
@@ -5023,7 +5087,11 @@
void EQInterface::saveSelectedSpawnPath(void)
{
QString fileName;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ fileName.asprintf("%s_mobpath.map", m_zoneMgr->shortZoneName().toLatin1().data());
+#else
fileName.sprintf("%s_mobpath.map", m_zoneMgr->shortZoneName().toLatin1().data());
+#endif
QFileInfo fileInfo = m_dataLocationMgr->findWriteFile("maps", fileName, false);
@@ -5041,7 +5109,11 @@
void EQInterface::saveSpawnPaths(void)
{
QString fileName;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ fileName.asprintf("%s_mobpath.map", m_zoneMgr->shortZoneName().toLatin1().data());
+#else
fileName.sprintf("%s_mobpath.map", m_zoneMgr->shortZoneName().toLatin1().data());
+#endif
QFileInfo fileInfo = m_dataLocationMgr->findWriteFile("maps", fileName, false);
Modified: showeq/trunk/src/map.cpp
===================================================================
--- showeq/trunk/src/map.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/map.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -4217,19 +4217,37 @@
// show coords of upper left corner and lower right corner
p.setPen( Qt::yellow );
QString ts;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ ts.asprintf( "(%d, %d)",
+ (int)(param.screenCenterX() * param.ratioX()),
+ (int)(param.screenCenterY() * param.ratioY()));
+#else
ts.sprintf( "(%d, %d)",
(int)(param.screenCenterX() * param.ratioX()),
(int)(param.screenCenterY() * param.ratioY()));
+#endif
p.drawText( 10, 8, ts );
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ ts.asprintf( "(%d, %d)",
+ (int)((param.screenCenterX() - param.screenLength().width()) *
+ param.ratioX()),
+ (int)((param.screenCenterY() - param.screenLength().height()) *
+ param.ratioY()));
+#else
ts.sprintf( "(%d, %d)",
(int)((param.screenCenterX() - param.screenLength().width()) *
param.ratioX()),
(int)((param.screenCenterY() - param.screenLength().height()) *
param.ratioY()));
+#endif
p.drawText( width() - 90, height() - 14, ts );
// show frame times
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ ts.asprintf( "%2.0ffps/%dms", fps, drawTime);
+#else
ts.sprintf( "%2.0ffps/%dms", fps, drawTime);
+#endif
p.drawText( this->width() - 60, 8, ts );
}
@@ -4308,7 +4326,11 @@
long secs = sp->secsLeft();
if ( secs > 0 )
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ remaining.asprintf( "%2ld:%02ld", secs / 60, secs % 60 );
+#else
remaining.sprintf( "%2ld:%02ld", secs / 60, secs % 60 );
+#endif
else
remaining = "now";
}
@@ -4326,6 +4348,21 @@
spawned += dateTime.time().toString();
QString string;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ string.asprintf("SpawnPoint: %s\n"
+ "%.3s/Z: %5d/%5d/%5d\n"
+ "Last: %s\n"
+ "Spawned: %s\t Remaining: %s\t Count: %d",
+ sp->name().toLatin1().data(),
+ showeq_params->retarded_coords ? "Y/X" : "X/Y",
+ showeq_params->retarded_coords ? sp->y() : sp->x(),
+ showeq_params->retarded_coords ? sp->x() : sp->y(),
+ sp->z(),
+ sp->last().toLatin1().data(),
+ spawned.toLatin1().data(),
+ remaining.toLatin1().data(),
+ sp->count());
+#else
string.sprintf("SpawnPoint: %s\n"
"%.3s/Z: %5d/%5d/%5d\n"
"Last: %s\n"
@@ -4339,7 +4376,9 @@
spawned.toLatin1().data(),
remaining.toLatin1().data(),
sp->count());
+#endif
+
m_mapTip->setText( string );
QPoint popPoint = mapToGlobal(event->pos());
m_mapTip->popup(QPoint(popPoint.x() + 15, popPoint.y() + 15));
@@ -4359,7 +4398,11 @@
{
QString guild;
if (!spawn->guildTag().isEmpty())
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ guild.asprintf("<%s>", spawn->guildTag().toLatin1().data());
+#else
guild.sprintf("<%s>", spawn->guildTag().toLatin1().data());
+#endif
else if (spawn->guildID())
guild = QString::number(spawn->guildID());
else
@@ -4387,6 +4430,21 @@
else
lastName = "";
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ string.asprintf("%s %s%s\n"
+ "Level: %2d\tHP: %s\t %.3s/Z: %5d/%5d/%5d\n"
+ "Race: %s\t Class: %s",
+ spawn->transformedName().toUtf8().data(),
+ lastName.toUtf8().data(),
+ guild.toLatin1().data(),
+ spawn->level(), hp.toLatin1().data(),
+ showeq_params->retarded_coords ? "Y/X" : "X/Y",
+ showeq_params->retarded_coords ? spawn->y() : spawn->x(),
+ showeq_params->retarded_coords ? spawn->x() : spawn->y(),
+ item->z(),
+ spawn->raceString().toLatin1().data(),
+ spawn->classString().toLatin1().data());
+#else
string.sprintf("%s %s%s\n"
"Level: %2d\tHP: %s\t %.3s/Z: %5d/%5d/%5d\n"
"Race: %s\t Class: %s",
@@ -4400,6 +4458,7 @@
item->z(),
spawn->raceString().toLatin1().data(),
spawn->classString().toLatin1().data());
+#endif
if (m_deityPvP)
string += " Deity: " + spawn->deityName();
@@ -4412,6 +4471,18 @@
}
else
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ string.asprintf("%s\n"
+ "%.3s/Z: %5d/%5d/%5d\n"
+ "Race: %s\t Class: %s",
+ item->transformedName().toUtf8().data(),
+ showeq_params->retarded_coords ? "Y/X" : "X/Y",
+ showeq_params->retarded_coords ? item->y() : item->x(),
+ showeq_params->retarded_coords ? item->x() : item->y(),
+ item->z(),
+ item->raceString().toLatin1().data(),
+ item->classString().toLatin1().data());
+#else
string.sprintf("%s\n"
"%.3s/Z: %5d/%5d/%5d\n"
"Race: %s\t Class: %s",
@@ -4422,7 +4493,9 @@
item->z(),
item->raceString().toLatin1().data(),
item->classString().toLatin1().data());
+#endif
+
if ((door) && (door->zonePoint() != 0xFFFFFFFF))
{
const zonePointStruct* zp = m_zoneMgr->zonePoint(door->zonePoint());
@@ -5177,7 +5250,11 @@
void MapFrame::mouseLocation(int16_t x, int16_t y)
{
QString cursorPos;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ cursorPos.asprintf(" %+5hd, %+5hd", y, x);
+#else
cursorPos.sprintf(" %+5hd, %+5hd", y, x);
+#endif
m_mouseLocation->setText(cursorPos);
}
@@ -5185,7 +5262,11 @@
int16_t Dx, int16_t Dy, int16_t Dz, int32_t degrees)
{
QString playerPos;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ playerPos.asprintf(" %+5hd, %+5hd, %+5hd", y, x, z);
+#else
playerPos.sprintf(" %+5hd, %+5hd, %+5hd", y, x, z);
+#endif
m_playerLocation->setText(playerPos);
}
Modified: showeq/trunk/src/mapicon.cpp
===================================================================
--- showeq/trunk/src/mapicon.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/mapicon.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -1112,9 +1112,15 @@
{
QString spawnNameText;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ spawnNameText.asprintf("%2d: %s",
+ spawn->level(),
+ spawn->name().toLatin1().data());
+#else
spawnNameText.sprintf("%2d: %s",
spawn->level(),
spawn->name().toLatin1().data());
+#endif
QFontMetrics fm(param.font());
int width = fm.width(spawnNameText);
@@ -1226,10 +1232,17 @@
{
QString spawnNameText;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ spawnNameText.asprintf("sp:%s %s (%d)",
+ sp->name().toLatin1().data(),
+ sp->last().toLatin1().data(),
+ sp->count());
+#else
spawnNameText.sprintf("sp:%s %s (%d)",
sp->name().toLatin1().data(),
sp->last().toLatin1().data(),
sp->count());
+#endif
QFontMetrics fm(param.font());
int width = fm.width(spawnNameText);
Modified: showeq/trunk/src/messageshell.cpp
===================================================================
--- showeq/trunk/src/messageshell.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/messageshell.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -106,6 +106,14 @@
{
if ((cmsg->target[0] != 0) && target)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf( "'%s' -> '%s' - %s {%s}",
+ cmsg->sender,
+ cmsg->target,
+ cmsg->message,
+ language_name(cmsg->language).toLatin1().data()
+ );
+#else
tempStr.sprintf( "'%s' -> '%s' - %s {%s}",
cmsg->sender,
cmsg->target,
@@ -112,14 +120,23 @@
cmsg->message,
language_name(cmsg->language).toLatin1().data()
);
+#endif
}
else
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf( "'%s' - %s {%s}",
+ cmsg->sender,
+ cmsg->message,
+ language_name(cmsg->language).toLatin1().data()
+ );
+#else
tempStr.sprintf( "'%s' - %s {%s}",
cmsg->sender,
cmsg->message,
language_name(cmsg->language).toLatin1().data()
);
+#endif
}
}
else // Don't show common, its obvious
@@ -126,18 +143,33 @@
{
if ((cmsg->target[0] != 0) && target)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf( "'%s' -> '%s' - %s",
+ cmsg->sender,
+ cmsg->target,
+ cmsg->message
+ );
+#else
tempStr.sprintf( "'%s' -> '%s' - %s",
cmsg->sender,
cmsg->target,
cmsg->message
);
+#endif
}
else
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf( "'%s' - %s",
+ cmsg->sender,
+ cmsg->message
+ );
+#else
tempStr.sprintf( "'%s' - %s",
cmsg->sender,
cmsg->message
);
+#endif
}
}
@@ -352,9 +384,15 @@
const randomReqStruct* randr = (const randomReqStruct*)data;
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Request random number between %d and %d",
+ randr->bottom,
+ randr->top);
+#else
tempStr.sprintf("Request random number between %d and %d",
randr->bottom,
randr->top);
+ #endif
m_messages->addMessage(MT_Random, tempStr);
}
@@ -364,11 +402,19 @@
const randomStruct* randr = (const randomStruct*)data;
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Random number %d rolled between %d and %d by %s",
+ randr->result,
+ randr->bottom,
+ randr->top,
+ randr->name);
+#else
tempStr.sprintf("Random number %d rolled between %d and %d by %s",
randr->result,
randr->bottom,
randr->top,
randr->name);
+#endif
m_messages->addMessage(MT_Random, tempStr);
}
@@ -390,7 +436,11 @@
{
if (strnlen(inspt->itemNames[inp], 64) > 0)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("He has %s (icn:%i)", inspt->itemNames[inp], inspt->icons[inp]);
+#else
tempStr.sprintf("He has %s (icn:%i)", inspt->itemNames[inp], inspt->icons[inp]);
+#endif
m_messages->addMessage(MT_Inspect, tempStr);
}
}
@@ -397,7 +447,11 @@
if (strnlen(inspt->mytext, 200) > 0)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("His info: %s", inspt->mytext);
+#else
tempStr.sprintf("His info: %s", inspt->mytext);
+#endif
m_messages->addMessage(MT_Inspect, tempStr);
}
}
@@ -528,11 +582,19 @@
default:
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf( "Unknown Spell Event ( %s ) - '",
+ client ?
+ "Client --> Server" :
+ "Server --> Client"
+ );
+#else
tempStr.sprintf( "Unknown Spell Event ( %s ) - '",
client ?
"Client --> Server" :
"Server --> Client"
);
+#endif
break;
}
}
@@ -549,10 +611,17 @@
spellName = spell_name(mem->spellId);
if (mem->param1 != 4)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("%s%s', slot %d.",
+ tempStr.toLatin1().data(),
+ spellName.toLatin1().data(),
+ mem->slotId);
+#else
tempStr.sprintf("%s%s', slot %d.",
tempStr.toLatin1().data(),
spellName.toLatin1().data(),
mem->slotId);
+#endif
else
{
@@ -584,7 +653,11 @@
tempStr = item->name();
if (tempStr == "" || tempStr.isEmpty())
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("UNKNOWN (ID: %d)", bcast->spawnId);
+#else
tempStr.sprintf("UNKNOWN (ID: %d)", bcast->spawnId);
+#endif
tempStr += " has begun casting '";
}
@@ -598,10 +671,17 @@
else
spellName = spell_name(bcast->spellId);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf( "%s%s' - Casting time is %g Second%s",
+ tempStr.toLatin1().data(),
+ spellName.toLatin1().data(), casttime,
+ casttime == 1 ? "" : "s");
+#else
tempStr.sprintf( "%s%s' - Casting time is %g Second%s",
tempStr.toLatin1().data(),
spellName.toLatin1().data(), casttime,
casttime == 1 ? "" : "s");
+#endif
m_messages->addMessage(MT_Spell, tempStr);
}
@@ -613,7 +693,11 @@
if (strlen(sf->message) > 0)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf( "Faded: %s", sf->message);
+#else
tempStr.sprintf( "Faded: %s", sf->message);
+#endif
m_messages->addMessage(MT_Spell, tempStr);
}
@@ -626,11 +710,21 @@
QString tempStr;
if (item != NULL)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("%s(%d): %s",
+ item->name().toLatin1().data(), icast->spawnId, icast->message);
+#else
tempStr.sprintf("%s(%d): %s",
item->name().toLatin1().data(), icast->spawnId, icast->message);
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("spawn(%d): %s",
+ icast->spawnId, icast->message);
+#else
tempStr.sprintf("spawn(%d): %s",
icast->spawnId, icast->message);
+#endif
m_messages->addMessage(MT_Spell, tempStr);
}
@@ -657,9 +751,15 @@
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("You begin casting %s. Current Target is %s(%d)",
+ spellName.toLatin1().data(), targetName.toLatin1().data(),
+ cast->targetId);
+#else
tempStr.sprintf("You begin casting %s. Current Target is %s(%d)",
spellName.toLatin1().data(), targetName.toLatin1().data(),
cast->targetId);
+#endif
m_messages->addMessage(MT_Spell, tempStr);
}
@@ -679,25 +779,52 @@
switch (gmem->action)
{
case GUA_Joined :
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf ("Update: %s has joined the group.", gmem->membername);
+#else
tempStr.sprintf ("Update: %s has joined the group.", gmem->membername);
+#endif
break;
case GUA_Left :
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf ("Update: %s has left the group.", gmem->membername);
+#else
tempStr.sprintf ("Update: %s has left the group.", gmem->membername);
+#endif
break;
case GUA_LastLeft :
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf ("Update: The group has been disbanded when %s left.",
+ gmem->membername);
+#else
tempStr.sprintf ("Update: The group has been disbanded when %s left.",
gmem->membername);
+#endif
break;
case GUA_MakeLeader :
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf ("Update: %s is now the leader of the group.",
+ gmem->membername);
+#else
tempStr.sprintf ("Update: %s is now the leader of the group.",
gmem->membername);
+#endif
break;
case GUA_Started :
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf ("Update: %s has formed the group.", gmem->membername);
+#else
tempStr.sprintf ("Update: %s has formed the group.", gmem->membername);
+#endif
break;
default :
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf ("Update: Unknown Update action:%d - %s - %s)",
+ gmem->action, gmem->yourname, gmem->membername);
+#else
tempStr.sprintf ("Update: Unknown Update action:%d - %s - %s)",
gmem->action, gmem->yourname, gmem->membername);
+#endif
}
m_messages->addMessage(MT_Group, tempStr);
@@ -709,9 +836,17 @@
QString tempStr;
if(dir == DIR_Client)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Invite: You invite %s to join the group", gmem->invitee);
+#else
tempStr.sprintf("Invite: You invite %s to join the group", gmem->invitee);
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Invite: %s invites %s to join the group", gmem->inviter, gmem->invitee);
+#else
tempStr.sprintf("Invite: %s invites %s to join the group", gmem->inviter, gmem->invitee);
+#endif
m_messages->addMessage(MT_Group, tempStr);
}
@@ -723,16 +858,31 @@
switch(gmem->reason)
{
case 1:
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Invite: %s declines invite from %s (player is grouped)",
+ gmem->membername, gmem->yourname);
+#else
tempStr.sprintf("Invite: %s declines invite from %s (player is grouped)",
gmem->membername, gmem->yourname);
+#endif
break;
case 3:
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Invite: %s declines invite from %s",
+ gmem->membername, gmem->yourname);
+#else
tempStr.sprintf("Invite: %s declines invite from %s",
gmem->membername, gmem->yourname);
+#endif
break;
default:
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Invite: %s declines invite from %s (unknown reason: %i)",
+ gmem->membername, gmem->yourname, gmem->reason);
+#else
tempStr.sprintf("Invite: %s declines invite from %s (unknown reason: %i)",
gmem->membername, gmem->yourname, gmem->reason);
+#endif
break;
}
m_messages->addMessage(MT_Group, tempStr);
@@ -746,7 +896,11 @@
if(!strcmp(gFollow->invitee, m_player->name().toLatin1().data()))
tempStr = "Follow: You have joined the group";
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Follow: %s has joined the group", gFollow->invitee);
+#else
tempStr.sprintf("Follow: %s has joined the group", gFollow->invitee);
+#endif
m_messages->addMessage(MT_Group, tempStr);
}
@@ -755,7 +909,11 @@
const groupDisbandStruct* gmem = (const groupDisbandStruct*)data;
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf ("Disband: %s disbands from the group", gmem->membername);
+#else
tempStr.sprintf ("Disband: %s disbands from the group", gmem->membername);
+#endif
m_messages->addMessage(MT_Group, tempStr);
}
@@ -763,8 +921,13 @@
{
const groupLeaderChangeStruct *gmem = (const groupLeaderChangeStruct*)data;
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Update: %s is now the leader of the group",
+ gmem->membername);
+#else
tempStr.sprintf("Update: %s is now the leader of the group",
gmem->membername);
+#endif
m_messages->addMessage(MT_Group, tempStr);
}
@@ -772,34 +935,71 @@
{
QString message;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("Name: '%s' Last: '%s'",
+ player->name, player->lastName);
+#else
message.sprintf("Name: '%s' Last: '%s'",
player->name, player->lastName);
+#endif
m_messages->addMessage(MT_Player, message);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("Level: %d", player->profile.level);
+#else
message.sprintf("Level: %d", player->profile.level);
+#endif
m_messages->addMessage(MT_Player, message);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("PlayerMoney: P=%d G=%d S=%d C=%d",
+ player->profile.platinum, player->profile.gold,
+ player->profile.silver, player->profile.copper);
+#else
message.sprintf("PlayerMoney: P=%d G=%d S=%d C=%d",
player->profile.platinum, player->profile.gold,
player->profile.silver, player->profile.copper);
+#endif
m_messages->addMessage(MT_Player, message);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("BankMoney: P=%d G=%d S=%d C=%d",
+ player->platinum_bank, player->gold_bank,
+ player->silver_bank, player->copper_bank);
+#else
message.sprintf("BankMoney: P=%d G=%d S=%d C=%d",
player->platinum_bank, player->gold_bank,
player->silver_bank, player->copper_bank);
+#endif
m_messages->addMessage(MT_Player, message);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("CursorMoney: P=%d G=%d S=%d C=%d",
+ player->profile.platinum_cursor, player->profile.gold_cursor,
+ player->profile.silver_cursor, player->profile.copper_cursor);
+#else
message.sprintf("CursorMoney: P=%d G=%d S=%d C=%d",
player->profile.platinum_cursor, player->profile.gold_cursor,
player->profile.silver_cursor, player->profile.copper_cursor);
+#endif
m_messages->addMessage(MT_Player, message);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("SharedMoney: P=%d",
+ player->platinum_shared);
+#else
message.sprintf("SharedMoney: P=%d",
player->platinum_shared);
+#endif
m_messages->addMessage(MT_Player, message);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("DoN Crystals: Radiant=%d Ebon=%d",
+ player->currentRadCrystals, player->currentEbonCrystals);
+#else
message.sprintf("DoN Crystals: Radiant=%d Ebon=%d",
player->currentRadCrystals, player->currentEbonCrystals);
+#endif
m_messages->addMessage(MT_Player, message);
// charProfileStruct.exp hasn't been found
@@ -845,9 +1045,17 @@
spellName = spell_name(player->profile.buffs[buffnumber].spellid);
if(player->profile.buffs[buffnumber].duration == -1)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("You have buff %s (permanent).", spellName.toLatin1().data());
+#else
message.sprintf("You have buff %s (permanent).", spellName.toLatin1().data());
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ message.asprintf("You have buff %s duration left is %d in ticks.",
+#else
message.sprintf("You have buff %s duration left is %d in ticks.",
+#endif
spellName.toLatin1().data(), player->profile.buffs[buffnumber].duration);
m_messages->addMessage(MT_Player, message);
@@ -872,9 +1080,15 @@
{
const skillIncStruct* skilli = (const skillIncStruct*)data;
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Skill: %s has increased (%d)",
+ skill_name(skilli->skillId).toLatin1().data(),
+ skilli->value);
+#else
tempStr.sprintf("Skill: %s has increased (%d)",
skill_name(skilli->skillId).toLatin1().data(),
skilli->value);
+#endif
m_messages->addMessage(MT_Player, tempStr);
}
@@ -882,7 +1096,11 @@
{
const levelUpUpdateStruct *levelup = (const levelUpUpdateStruct *)data;
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("NewLevel: %d", levelup->level);
+#else
tempStr.sprintf("NewLevel: %d", levelup->level);
+#endif
m_messages->addMessage(MT_Player, tempStr);
}
@@ -979,9 +1197,15 @@
uint32_t tickExpLevel)
{
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Exp: Set: %u total, with %u (%u/330) into level with %u left, where 1/330 = %u",
+ totalExp, (totalExp - minExpLevel), totalTick,
+ (maxExpLevel - totalExp), tickExpLevel);
+#else
tempStr.sprintf("Exp: Set: %u total, with %u (%u/330) into level with %u left, where 1/330 = %u",
totalExp, (totalExp - minExpLevel), totalTick,
(maxExpLevel - totalExp), tickExpLevel);
+#endif
m_messages->addMessage(MT_Player, tempStr);
}
@@ -1000,14 +1224,26 @@
// calculate the number of this type of kill needed to level.
uint32_t needKills = leftExp / newExp;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Exp: New: %u, %u (%u/330) into level with %u left [~%u kills]",
+ newExp, (totalExp - minExpLevel), totalTick,
+ leftExp, needKills);
+#else
tempStr.sprintf("Exp: New: %u, %u (%u/330) into level with %u left [~%u kills]",
newExp, (totalExp - minExpLevel), totalTick,
leftExp, needKills);
+#endif
}
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("Exp: New: < %u, %u (%u/330) into level with %u left",
+ tickExpLevel, (totalExp - minExpLevel), totalTick,
+ leftExp);
+#else
tempStr.sprintf("Exp: New: < %u, %u (%u/330) into level with %u left",
tickExpLevel, (totalExp - minExpLevel), totalTick,
leftExp);
+#endif
m_messages->addMessage(MT_Player, tempStr);
}
@@ -1017,8 +1253,13 @@
uint32_t aaPoints)
{
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("ExpAA: Set: %u total, with %u aapoints",
+ totalExp, aaPoints);
+#else
tempStr.sprintf("ExpAA: Set: %u total, with %u aapoints",
totalExp, aaPoints);
+#endif
m_messages->addMessage(MT_Player, tempStr);
}
@@ -1033,11 +1274,21 @@
// only can display certain things if new experience is greater then 0,
// ie. a > 1/330'th experience increment.
if (newExp)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("ExpAA: %u, %u (%u/330) with %u left",
+ newExp, totalExp, totalTick, maxExp - totalExp);
+#else
tempStr.sprintf("ExpAA: %u, %u (%u/330) with %u left",
newExp, totalExp, totalTick, maxExp - totalExp);
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("ExpAA: < %u, %u (%u/330) with %u left",
+ tickExp, totalExp, totalTick, maxExp - totalExp);
+#else
tempStr.sprintf("ExpAA: < %u, %u (%u/330) with %u left",
tickExp, totalExp, totalTick, maxExp - totalExp);
+#endif
m_messages->addMessage(MT_Player, tempStr);
}
@@ -1109,8 +1360,13 @@
// extra info if it is a spawn
if (spawn)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ spawnInfo.asprintf(" LVL %d, HP %d/%d",
+ spawn->level(), spawn->HP(), spawn->maxHP());
+#else
spawnInfo.sprintf(" LVL %d, HP %d/%d",
spawn->level(), spawn->HP(), spawn->maxHP());
+#endif
// use appropriate format depending on coordinate ordering
if (!showeq_params->retarded_coords)
Modified: showeq/trunk/src/netdiag.cpp
===================================================================
--- showeq/trunk/src/netdiag.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/netdiag.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -219,7 +219,11 @@
void NetDiag::seqReceive(int seq, int stream)
{
QString disp;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ disp.asprintf("%4.4x", seq);
+#else
disp.sprintf("%4.4x", seq);
+#endif
m_seqCur[stream]->setText(disp);
}
@@ -226,7 +230,11 @@
void NetDiag::seqExpect(int seq, int stream)
{
QString disp;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ disp.asprintf("%4.4x", seq);
+#else
disp.sprintf("%4.4x", seq);
+#endif
m_seqExp[stream]->setText(disp);
}
@@ -241,8 +249,13 @@
switch (sessionState)
{
case 2:
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tmp.asprintf(":%d",
+ m_packet->clientPort());
+#else
tmp.sprintf(":%d",
m_packet->clientPort());
+#endif
disp += tmp;
break;
case 1:
@@ -260,7 +273,11 @@
uint32_t addr = m_packet->clientAddr();
disp = print_addr(addr);
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tmp.asprintf(":%d", clientPort);
+#else
tmp.sprintf(":%d", clientPort);
+#endif
disp += tmp;
@@ -327,10 +344,19 @@
m_packetRecent[stream]->setText(QString::number(num));
int delta = mTime() - m_packetStartTime[stream];
if (numdelta && delta)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("%2.1f",
+ (float) (numdelta<<10) / (float) delta);
+#else
tempStr.sprintf("%2.1f",
(float) (numdelta<<10) / (float) delta);
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("0.0");
+#else
tempStr.sprintf("0.0");
+#endif
m_packetAvg[stream]->setText(tempStr);
}
@@ -352,6 +378,14 @@
#endif /* DEBUG_PACKET */
QString paddr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ paddr.asprintf ( "%d.%d.%d.%d",
+ addr & 0x000000ff,
+ (addr & 0x0000ff00) >> 8,
+ (addr & 0x00ff0000) >> 16,
+ (addr & 0xff000000) >> 24
+ );
+#else
paddr.sprintf ( "%d.%d.%d.%d",
addr & 0x000000ff,
(addr & 0x0000ff00) >> 8,
@@ -358,6 +392,7 @@
(addr & 0x00ff0000) >> 16,
(addr & 0xff000000) >> 24
);
+#endif
return paddr;
}
Modified: showeq/trunk/src/packet.cpp
===================================================================
--- showeq/trunk/src/packet.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/packet.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -817,11 +817,23 @@
QString string("");
if (speed == 0)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ string.asprintf("Playback speed set Fast as possible");
+#else
string.sprintf("Playback speed set Fast as possible");
+#endif
else if (speed < 0)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ string.asprintf("Playback paused (']' to resume)");
+#else
string.sprintf("Playback paused (']' to resume)");
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ string.asprintf("Playback speed set to %d", speed);
+#else
string.sprintf("Playback speed set to %d", speed);
+#endif
emit stsMessage(string, 5000);
Modified: showeq/trunk/src/packetinfo.cpp
===================================================================
--- showeq/trunk/src/packetinfo.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/packetinfo.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -374,7 +374,11 @@
currentOPCode = oit->second;
// output the current opcode
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ opcodeString.asprintf("%04x", currentOPCode->opcode());
+#else
opcodeString.sprintf("%04x", currentOPCode->opcode());
+#endif
out << indent << "<opcode id=\"" << opcodeString << "\" name=\""
<< currentOPCode->name() << "\"";
if (currentOPCode->implicitLen())
Modified: showeq/trunk/src/packetlog.cpp
===================================================================
--- showeq/trunk/src/packetlog.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/packetlog.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -54,7 +54,11 @@
inline QString opCodeToString(uint16_t opCode)
{
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("[OPCode: %#.04x]", opCode);
+#else
tempStr.sprintf("[OPCode: %#.04x]", opCode);
+#endif
// Flags are gone? Combined and implicit don't make sense anymore and
// nothing is compressed or encrypted at this point...
@@ -87,11 +91,19 @@
if (addr == m_packet.clientAddr())
paddr = "client";
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ paddr.asprintf( "%d.%d.%d.%d",
+ addr & 0x000000ff,
+ (addr & 0x0000ff00) >> 8,
+ (addr & 0x00ff0000) >> 16,
+ (addr & 0xff000000) >> 24);
+#else
paddr.sprintf( "%d.%d.%d.%d",
addr & 0x000000ff,
(addr & 0x0000ff00) >> 8,
(addr & 0x00ff0000) >> 16,
(addr & 0xff000000) >> 24);
+#endif
return paddr;
}
Modified: showeq/trunk/src/packetstream.cpp
===================================================================
--- showeq/trunk/src/packetstream.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/packetstream.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -163,11 +163,19 @@
{
// construct a name for the dispatch
QString dispatchName(256, '\0');
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ dispatchName.asprintf("PacketDispatch:%s:%s:%d:%s:%d",
+ objectName().toLatin1().data(), opcodeName.toLatin1().data(),
+ payload->dir(), payload->typeName().toLatin1().data(),
+ payload->sizeCheckType());
+#else
dispatchName.sprintf("PacketDispatch:%s:%s:%d:%s:%d",
objectName().toLatin1().data(), opcodeName.toLatin1().data(),
payload->dir(), payload->typeName().toLatin1().data(),
payload->sizeCheckType());
+#endif
+
// create new dispatch object
dispatch = new EQPacketDispatch(this, dispatchName.toLatin1().data());
@@ -463,9 +471,15 @@
if (!found && !opcodeEntry->isEmpty())
{
QString tempStr;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("%s (%#04x) (dataLen: %lu) doesn't match:",
+ opcodeEntry->name().toLatin1().data(),
+ opcodeEntry->opcode(), len);
+#else
tempStr.sprintf("%s (%#04x) (dataLen: %lu) doesn't match:",
opcodeEntry->name().toLatin1().data(),
opcodeEntry->opcode(), len);
+#endif
pit.toFront();
while (pit.hasNext())
Modified: showeq/trunk/src/seqlistview.cpp
===================================================================
--- showeq/trunk/src/seqlistview.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/seqlistview.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -146,10 +146,18 @@
// save the column order
QString tempStr, tempStr2;
if (header()->count() > 0)
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr.asprintf("%d", header()->logicalIndex(0));
+#else
tempStr.sprintf("%d", header()->logicalIndex(0));
+#endif
for(i=1; i < header()->count(); i++)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tempStr2.asprintf(":%d", header()->logicalIndex(i));
+#else
tempStr2.sprintf(":%d", header()->logicalIndex(i));
+#endif
tempStr += tempStr2;
}
pSEQPrefs->setPrefString("ColumnOrder", preferenceName(), tempStr);
Modified: showeq/trunk/src/skilllist.cpp
===================================================================
--- showeq/trunk/src/skilllist.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/skilllist.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -109,7 +109,11 @@
#endif
QString str;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ str.asprintf("%3d", value);
+#else
str.sprintf("%3d", value);
+#endif
/* If the skill is not added yet, look up the correct skill namd and add it
* to the list
@@ -137,7 +141,11 @@
QString str;
/* Update skill value with new value */
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ str.asprintf ("%3d", value);
+#else
str.sprintf ("%3d", value);
+#endif
// create skill entry if needed or set the value of the existing item
if (!m_skillList[skillId])
@@ -186,7 +194,11 @@
if (value == 00)
str = " NA";
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ str.asprintf ("%3d", value);
+#else
str.sprintf ("%3d", value);
+#endif
// If the language is not added yet, look up the correct skill namd and
// add it to the list
@@ -218,7 +230,11 @@
QString str;
/* Update skill value with new value */
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ str.asprintf ("%3d", value);
+#else
str.sprintf ("%3d", value);
+#endif
// create language entry if needed or set the value of the existing item
if (!m_languageList[langId])
Modified: showeq/trunk/src/spawn.cpp
===================================================================
--- showeq/trunk/src/spawn.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/spawn.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -187,7 +187,11 @@
else
{
QString item_str;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ item_str.asprintf("U%04x", item);
+#else
item_str.sprintf("U%04x", item);
+#endif
return item_str;
}
}
@@ -248,11 +252,19 @@
QString Item::filterString() const
{
QString buff;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("Name:%s:Race:%s:Class:%s:NPC:%d:X:%d:Y:%d:Z:%d",
+ transformedName().toUtf8().data(),
+ raceString().toUtf8().data(),
+ classString().toUtf8().data(),
+ NPC(), x(), y(), z());
+#else
buff.sprintf("Name:%s:Race:%s:Class:%s:NPC:%d:X:%d:Y:%d:Z:%d",
transformedName().toUtf8().data(),
raceString().toUtf8().data(),
classString().toUtf8().data(),
NPC(), x(), y(), z());
+#endif
return buff;
}
@@ -898,6 +910,25 @@
QString name = transformedName();
QString buff;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("Name:%s:Level:%d:Race:%s:Class:%s:NPC:%d:X:%d:Y:%d:Z:%d:"
+ "Light:%s:Deity:%s:RTeam:%d:DTeam:%d:Type:%s:LastName:%s:Guild:%s:Spawn:%s:",
+ name.toUtf8().data(),
+ level(),
+ raceString().toUtf8().data(),
+ classString().toUtf8().data(),
+ ((NPC() == 10) ? 0 : NPC()),
+ x(), y(), z(),
+ lightName().toUtf8().data(),
+ deityName().toUtf8().data(),
+ raceTeam(),
+ deityTeam(),
+ typeString().toUtf8().data(),
+ lastName().toUtf8().data(),
+ guildTag().toUtf8().data(),
+ spawnTimeStr ().replace (":", ".").toUtf8 ().data ()
+ );
+#else
buff.sprintf("Name:%s:Level:%d:Race:%s:Class:%s:NPC:%d:X:%d:Y:%d:Z:%d:"
"Light:%s:Deity:%s:RTeam:%d:DTeam:%d:Type:%s:LastName:%s:Guild:%s:Spawn:%s:",
name.toUtf8().data(),
@@ -915,6 +946,7 @@
guildTag().toUtf8().data(),
spawnTimeStr ().replace (":", ".").toUtf8 ().data ()
);
+#endif
if (gm())
buff += QString("GM:") + QString::number(gm()) + ":";
@@ -1072,7 +1104,11 @@
(int16_t)(d->y),
(int16_t)(d->z * 10.0));
setHeading((int8_t)lrintf(d->heading));
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ m_name.asprintf("Door: %s (%d) ", d->name, d->doorId);
+#else
m_name.sprintf("Door: %s (%d) ", d->name, d->doorId);
+#endif
setZonePoint(d->zonePoint);
updateLast();
}
Modified: showeq/trunk/src/spawnlist.cpp
===================================================================
--- showeq/trunk/src/spawnlist.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/spawnlist.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -160,7 +160,11 @@
if (litem->type() != tUnknown)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", litem->item()->calcDist2DInt(x, y));
+#else
buff.sprintf("%5d", litem->item()->calcDist2DInt(x, y));
+#endif
litem->setText(tSpawnColDist, buff);
}
++it;
@@ -174,7 +178,11 @@
litem = (SpawnListItem*)*it;
if (litem->type() != tUnknown)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5.1f", litem->item()->calcDist(x, y, z));
+#else
buff.sprintf("%5.1f", litem->item()->calcDist(x, y, z));
+#endif
litem->setText(tSpawnColDist, buff);
}
++it;
Modified: showeq/trunk/src/spawnlist2.cpp
===================================================================
--- showeq/trunk/src/spawnlist2.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/spawnlist2.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -565,7 +565,11 @@
if (litem->type() != tUnknown)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", litem->item()->calcDist2DInt(x, y));
+#else
buff.sprintf("%5d", litem->item()->calcDist2DInt(x, y));
+#endif
litem->setText(tSpawnColDist, buff);
}
@@ -583,7 +587,11 @@
if (litem->type() != tUnknown)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5.1f", litem->item()->calcDist(x, y, z));
+#else
buff.sprintf("%5.1f", litem->item()->calcDist(x, y, z));
+#endif
litem->setText(tSpawnColDist, buff);
}
Modified: showeq/trunk/src/spawnlistcommon.cpp
===================================================================
--- showeq/trunk/src/spawnlistcommon.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/spawnlistcommon.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -190,7 +190,11 @@
if (changeType & tSpawnChangedLevel)
{
// Level
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%2d", spawn->level());
+#else
buff.sprintf("%2d", spawn->level());
+#endif
setText(tSpawnColLevel, buff);
}
@@ -197,11 +201,19 @@
if (changeType & tSpawnChangedHP)
{
// Hitpoints
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", spawn->HP());
+#else
buff.sprintf("%5d", spawn->HP());
+#endif
setText(tSpawnColHP, buff);
// Maximum Hitpoints
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", spawn->maxHP());
+#else
buff.sprintf("%5d", spawn->maxHP());
+#endif
setText(tSpawnColMaxHP, buff);
}
@@ -228,17 +240,31 @@
if (changeType & tSpawnChangedPosition)
{
// X position
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", showeq_params->retarded_coords ?
+ (int)item()->y() : (int)item()->x());
+#else
buff.sprintf("%5d", showeq_params->retarded_coords ?
(int)item()->y() : (int)item()->x());
+#endif
setText(tSpawnColXPos, buff);
// Y position
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", showeq_params->retarded_coords ?
+ (int)item()->x() : (int)item()->y());
+#else
buff.sprintf("%5d", showeq_params->retarded_coords ?
(int)item()->x() : (int)item()->y());
+#endif
setText(tSpawnColYPos, buff);
// Z position
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", item()->z());
+#else
buff.sprintf("%5d", item()->z());
+#endif
setText(tSpawnColZPos, buff);
// Distance
@@ -245,12 +271,20 @@
if (!showeq_params->fast_machine)
{
//buff.sprintf("%5d", player->calcDist2DInt(*item()));
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", item()->getIDistanceToPlayer());
+#else
buff.sprintf("%5d", item()->getIDistanceToPlayer());
+#endif
}
else
{
//buff.sprintf("%5.1f", player->calcDist(*item()));
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5.1f", item()->getFDistanceToPlayer());
+#else
buff.sprintf("%5.1f", item()->getFDistanceToPlayer());
+#endif
}
setText(tSpawnColDist, buff);
}
@@ -258,7 +292,11 @@
if (changeType == tSpawnChangedALL)
{
// Id
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buff.asprintf("%5d", item()->id());
+#else
buff.sprintf("%5d", item()->id());
+#endif
setText(tSpawnColID, buff);
// Race
@@ -286,8 +324,14 @@
{
// update childcount in header
QString temp;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ temp.asprintf("%s (%d)",
+ name.toLatin1().data(), childCount());
+#else
temp.sprintf("%s (%d)",
name.toLatin1().data(), childCount());
+#endif
+
setText(tSpawnColName, temp);
} // end if spawn should be in this category
Modified: showeq/trunk/src/spawnmonitor.cpp
===================================================================
--- showeq/trunk/src/spawnmonitor.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/spawnmonitor.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -56,7 +56,11 @@
QString SpawnPoint::key( int x, int y, int z)
{
QString t;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ t.asprintf( "%d%d%d", x, y, z );
+#else
t.sprintf( "%d%d%d", x, y, z );
+#endif
return t;
}
Modified: showeq/trunk/src/spawnpointlist.cpp
===================================================================
--- showeq/trunk/src/spawnpointlist.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/spawnpointlist.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -76,7 +76,11 @@
long secs = m_spawnPoint->secsLeft();
if ( secs > 0 )
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tmpStr.asprintf( "%2ld:%02ld", secs / 60, secs % 60 );
+#else
tmpStr.sprintf( "%2ld:%02ld", secs / 60, secs % 60 );
+#endif
else
tmpStr = " now"; // spaces followed by now
}
@@ -343,8 +347,13 @@
if (def.isEmpty())
def = sp->last();
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ def.asprintf("%d/%d/%d '%s'",
+ sp->x(), sp->y(), sp->z(), def.toLatin1().data());
+#else
def.sprintf("%d/%d/%d '%s'",
sp->x(), sp->y(), sp->z(), def.toLatin1().data());
+#endif
// confirm that the user wants to delete the category
QMessageBox mb("Are you sure?",
Modified: showeq/trunk/src/spellshell.cpp
===================================================================
--- showeq/trunk/src/spellshell.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/spellshell.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -76,7 +76,11 @@
int h = d / 3600;
d %= 3600;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ text.asprintf("%02d:%02d:%02d", h, d / 60, d % 60);
+#else
text.sprintf("%02d:%02d:%02d", h, d / 60, d % 60);
+#endif
return text;
}
Modified: showeq/trunk/src/statlist.cpp
===================================================================
--- showeq/trunk/src/statlist.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/statlist.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -57,7 +57,11 @@
QString statPrefName;
for (int nloop = 0; nloop < LIST_MAXLIST; nloop++)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ statPrefName.asprintf("show%s", statNames[nloop]);
+#else
statPrefName.sprintf("show%s", statNames[nloop]);
+#endif
m_showStat[nloop] = pSEQPrefs->getPrefBool(statPrefName,
preferenceName(), false);
updateStat(nloop);
@@ -243,7 +247,11 @@
m_showStat[stat] = enabled;
QString statPrefName;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ statPrefName.asprintf("show%s", statNames[stat]);
+#else
statPrefName.sprintf("show%s", statNames[stat]);
+#endif
pSEQPrefs->setPrefBool(statPrefName, "StatList", m_showStat[stat]);
Modified: showeq/trunk/src/util.cpp
===================================================================
--- showeq/trunk/src/util.cpp 2023-03-15 18:25:55 UTC (rev 1352)
+++ showeq/trunk/src/util.cpp 2023-03-15 18:26:08 UTC (rev 1353)
@@ -83,9 +83,17 @@
threeDigits = number % 1000L;
if (oldstring.isEmpty())
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buffer.asprintf("%u", threeDigits);
+#else
buffer.sprintf("%u", threeDigits);
+#endif
else
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ buffer.asprintf("%03u", threeDigits);
+#else
buffer.sprintf("%03u", threeDigits);
+#endif
if (oldstring.isEmpty())
newstring = buffer;
@@ -339,7 +347,11 @@
else
{
QString mat_str;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ mat_str.asprintf("U%02x", material);
+#else
mat_str.sprintf("U%02x", material);
+#endif
return mat_str;
}
}
@@ -420,7 +432,11 @@
}
QString skill_name;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ skill_name.asprintf("U0x%2.2x", skill);
+#else
skill_name.sprintf("U0x%2.2x", skill);
+#endif
return skill_name;
}
@@ -480,7 +496,11 @@
{
QString tmp;
// generate a string containing only the unknown flags
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tmp.asprintf("U0x%8.8x", (equipableSlots & (~ 0x003fffff)));
+#else
tmp.sprintf("U0x%8.8x", (equipableSlots & (~ 0x003fffff)));
+#endif
slot_str += tmp;
}
@@ -511,7 +531,11 @@
else
{
QString tmp;
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ tmp.asprintf("Unknown faction: %d", faction);
+#else
tmp.sprintf("Unknown faction: %d", faction);
+#endif
return tmp;
}
}
@@ -729,7 +753,11 @@
if (uiDivisor == 1000 && (uiCopper / uiDivisor) > 0)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ qsMoney.asprintf("%d Platinum", uiCopper / uiDivisor);
+#else
qsMoney.sprintf("%d Platinum", uiCopper / uiDivisor);
+#endif
bNeedComma = true;
uiCopper -= ((uiCopper / uiDivisor) * uiDivisor);
}
@@ -738,7 +766,11 @@
if (uiDivisor == 100 && (uiCopper / uiDivisor) > 0)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ qsMoney.asprintf("%s%s%d Gold", qsMoney.toLatin1().data(), bNeedComma ? ", " : "", uiCopper / uiDivisor);
+#else
qsMoney.sprintf("%s%s%d Gold", qsMoney.toLatin1().data(), bNeedComma ? ", " : "", uiCopper / uiDivisor);
+#endif
bNeedComma = true;
uiCopper -= ((uiCopper / uiDivisor) * uiDivisor);
}
@@ -747,7 +779,11 @@
if (uiDivisor == 10 && (uiCopper / uiDivisor) > 0)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5,5,0))
+ qsMoney.asprintf("%s%s%d Silver", qsMoney.toLatin1().data(), bNeedComma ? ", " : "", uiCopper / uiDivisor);
+#else
qsMoney.sprintf("%s%s%d Silver", qsMoney.toLatin1().data(), bNeedComma ? ", " : "", uiCopper / uiDivisor);
+#endif
...
[truncated message content] |