mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-27 03:02:26 +00:00
removed char buffer in 'UpdateWindowTitle"
This commit is contained in:
parent
d41331d948
commit
7b0de551e1
17
zone/net.cpp
17
zone/net.cpp
@ -20,7 +20,7 @@
|
|||||||
#include "../common/features.h"
|
#include "../common/features.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
#include <string.h>
|
#include <string>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -62,6 +62,7 @@ extern volatile bool ZoneLoaded;
|
|||||||
#include "../common/patches/patches.h"
|
#include "../common/patches/patches.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/MiscFunctions.h"
|
#include "../common/MiscFunctions.h"
|
||||||
|
#include "../common/StringUtil.h"
|
||||||
#include "../common/platform.h"
|
#include "../common/platform.h"
|
||||||
#include "../common/crash.h"
|
#include "../common/crash.h"
|
||||||
#include "../common/ipc_mutex.h"
|
#include "../common/ipc_mutex.h"
|
||||||
@ -608,27 +609,27 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) {
|
|||||||
|
|
||||||
void UpdateWindowTitle(char* iNewTitle) {
|
void UpdateWindowTitle(char* iNewTitle) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
char tmp[500];
|
std::string newTitle;
|
||||||
if (iNewTitle) {
|
if (iNewTitle) {
|
||||||
snprintf(tmp, sizeof(tmp), "%i: %s", ZoneConfig::get()->ZonePort, iNewTitle);
|
StringFormat(&newTitle, "%i: %s", ZoneConfig::get()->ZonePort, iNewTitle);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (zone) {
|
if (zone) {
|
||||||
#if defined(GOTFRAGS) || defined(_EQDEBUG)
|
#if defined(GOTFRAGS) || defined(_EQDEBUG)
|
||||||
snprintf(tmp, sizeof(tmp), "%i: %s, %i clients, %i", ZoneConfig::get()->ZonePort, zone->GetShortName(), numclients, getpid());
|
StringFormat(&newTitle, "%i: %s, %i clients, %i", ZoneConfig::get()->ZonePort, zone->GetShortName(), numclients, getpid());
|
||||||
#else
|
#else
|
||||||
snprintf(tmp, sizeof(tmp), "%i: %s, %i clients", ZoneConfig::get()->ZonePort, zone->GetShortName(), numclients);
|
StringFormat(&newTitle, "%i: %s, %i clients", ZoneConfig::get()->ZonePort, zone->GetShortName(), numclients);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if defined(GOTFRAGS) || defined(_EQDEBUG)
|
#if defined(GOTFRAGS) || defined(_EQDEBUG)
|
||||||
snprintf(tmp, sizeof(tmp), "%i: sleeping, %i", ZoneConfig::get()->ZonePort, getpid());
|
StringFormat(&newTitle, "%i: sleeping, %i", ZoneConfig::get()->ZonePort, getpid());
|
||||||
#else
|
#else
|
||||||
snprintf(tmp, sizeof(tmp), "%i: sleeping", ZoneConfig::get()->ZonePort);
|
StringFormat(&newTitle, "%i: sleeping", ZoneConfig::get()->ZonePort);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetConsoleTitle(tmp);
|
SetConsoleTitle(newTitle.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user