Skip to content

Commit

Permalink
Fixed|Server: ServerSystem init and shutdown
Browse files Browse the repository at this point in the history
Presently ServerSystem is dependent on LegacyNetwork, so it must be
deleted before LegacyCore is deleted.
  • Loading branch information
skyjake committed Feb 18, 2013
1 parent f26b3e2 commit ba850da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
7 changes: 3 additions & 4 deletions doomsday/client/src/network/net_main.cpp
Expand Up @@ -1353,25 +1353,24 @@ D_CMD(Net)
{
success = N_LookForHosts(argv[2], 0, 0);
}
/*
else if(!stricmp(argv[1], "connect"))
{
int idx;
int idx;

if(netGame)
{
Con_Printf("Already connected.\n");
return false;
}

idx = strtol(argv[2], NULL, 10);
idx = strtol(argv[2], NULL, 10); // ignored!
CmdReturnValue = success = N_Connect();

if(success)
{
Con_Message("Connected.\n");
}
}*/
}
else if(!stricmp(argv[1], "mconnect"))
{
serverinfo_t info;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libgui/src/guiapp.cpp
Expand Up @@ -31,7 +31,7 @@ DENG2_PIMPL(GuiApp)
bool loopRunning;

Instance(Public *i)
: Base(*i),
: Base(i),
refreshInterval(0),
loopRunning(false)
{}
Expand Down
34 changes: 19 additions & 15 deletions doomsday/server/src/main_server.cpp
Expand Up @@ -61,22 +61,27 @@ int main(int argc, char** argv)
de::App *dengApp = &textApp;
novideo = true;

dengApp->setTerminateFunc(handleLegacyCoreTerminate);
// Override the system locale (affects number/time formatting).
QLocale::setDefault(QLocale("en_US.UTF-8"));

try
{
// Override the system locale (affects number/time formatting).
QLocale::setDefault(QLocale("en_US.UTF-8"));
// Use the host system's proxy configuration.
QNetworkProxyFactory::setUseSystemConfiguration(true);

// Metadata.
QCoreApplication::setOrganizationDomain ("dengine.net");
QCoreApplication::setOrganizationName ("Deng Team");
QCoreApplication::setApplicationName ("Doomsday Server");
QCoreApplication::setApplicationVersion (DOOMSDAY_VERSION_BASE);

// Use the host system's proxy configuration.
QNetworkProxyFactory::setUseSystemConfiguration(true);
dengApp->setTerminateFunc(handleLegacyCoreTerminate);

// Metadata.
QCoreApplication::setOrganizationDomain ("dengine.net");
QCoreApplication::setOrganizationName ("Deng Team");
QCoreApplication::setApplicationName ("Doomsday Server");
QCoreApplication::setApplicationVersion (DOOMSDAY_VERSION_BASE);
/// @todo After LegacyNetwork is gone, ServerSystem can be a regular variable.
QScopedPointer<ServerSystem> sv(new ServerSystem);
dengApp->addSystem(*sv);

// Initialization.
try
{
// C interface to the app.
de2LegacyCore = LegacyCore_New();

Expand All @@ -88,9 +93,6 @@ int main(int argc, char** argv)

dengApp->initSubsystems();

ServerSystem sv;
dengApp->addSystem(sv);

Libdeng_Init();

// Initialize.
Expand All @@ -113,6 +115,8 @@ int main(int argc, char** argv)
// Cleanup.
Sys_Shutdown();
DD_Shutdown();
dengApp->removeSystem(*sv);
delete sv.take();
LegacyCore_Delete(de2LegacyCore);

return result;
Expand Down

0 comments on commit ba850da

Please sign in to comment.