mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 23:01:30 +00:00
[Windows] World process window title now updates with server name and amount of clients connected
This commit is contained in:
parent
240f04eda7
commit
b71f3031bc
@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
|
#include "../common/string_util.h"
|
||||||
#include "../common/eqemu_logsys.h"
|
#include "../common/eqemu_logsys.h"
|
||||||
#include "../common/queue.h"
|
#include "../common/queue.h"
|
||||||
#include "../common/timer.h"
|
#include "../common/timer.h"
|
||||||
@ -104,6 +105,12 @@ WebInterfaceList web_interface;
|
|||||||
|
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
|
|
||||||
|
inline void UpdateWindowTitle(std::string new_title) {
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
SetConsoleTitle(new_title.c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
RegisterExecutablePlatform(ExePlatformWorld);
|
RegisterExecutablePlatform(ExePlatformWorld);
|
||||||
LogSys.LoadLogSettingsDefaults();
|
LogSys.LoadLogSettingsDefaults();
|
||||||
@ -527,8 +534,7 @@ int main(int argc, char** argv) {
|
|||||||
database.PurgeExpiredInstances();
|
database.PurgeExpiredInstances();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EQTimeTimer.Check())
|
if (EQTimeTimer.Check()) {
|
||||||
{
|
|
||||||
TimeOfDay_Struct tod;
|
TimeOfDay_Struct tod;
|
||||||
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(0), &tod);
|
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(0), &tod);
|
||||||
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year))
|
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year))
|
||||||
@ -545,6 +551,9 @@ int main(int argc, char** argv) {
|
|||||||
if (InterserverTimer.Check()) {
|
if (InterserverTimer.Check()) {
|
||||||
InterserverTimer.Start();
|
InterserverTimer.Start();
|
||||||
database.ping();
|
database.ping();
|
||||||
|
|
||||||
|
std::string window_title = StringFormat("World: %s Clients: %i", Config->LongName.c_str(), client_list.GetClientCount());
|
||||||
|
UpdateWindowTitle(window_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
EQ::EventLoop::Get().Process();
|
EQ::EventLoop::Get().Process();
|
||||||
@ -564,16 +573,3 @@ void CatchSignal(int sig_num) {
|
|||||||
Log(Logs::General, Logs::World_Server, "Caught signal %d", sig_num);
|
Log(Logs::General, Logs::World_Server, "Caught signal %d", sig_num);
|
||||||
RunLoops = false;
|
RunLoops = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateWindowTitle(char* iNewTitle) {
|
|
||||||
#ifdef _WINDOWS
|
|
||||||
char tmp[500];
|
|
||||||
if (iNewTitle) {
|
|
||||||
snprintf(tmp, sizeof(tmp), "World: %s", iNewTitle);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
snprintf(tmp, sizeof(tmp), "World");
|
|
||||||
}
|
|
||||||
SetConsoleTitle(tmp);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|||||||
@ -31,7 +31,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
void UpdateWindowTitle(char* iNewTitle);
|
|
||||||
|
|
||||||
#define EQ_WORLD_PORT 9000 //mandated by the client
|
#define EQ_WORLD_PORT 9000 //mandated by the client
|
||||||
#define LOGIN_PORT 5997
|
#define LOGIN_PORT 5997
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user