Skip to content

Commit

Permalink
Server: Omit Updater in server build
Browse files Browse the repository at this point in the history
The server does not need to have the automatic updater.
  • Loading branch information
skyjake committed Dec 31, 2012
1 parent b6d46d6 commit 6f8392e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
2 changes: 2 additions & 0 deletions doomsday/engine/api/dd_share.h
Expand Up @@ -358,6 +358,8 @@ typedef struct gameinfo_s {
* @param notification One of the DD_NOTIFY_* enums.
* @param param Additional arguments about the notification, dependin
* on the notification type.
*
* @todo Move this to the generic plugin API (as Plug_Notify).
*/
void Game_Notify(int notification, void* param);

Expand Down
2 changes: 2 additions & 0 deletions doomsday/engine/src/con_main.c
Expand Up @@ -2216,11 +2216,13 @@ D_CMD(Version)

D_CMD(Quit)
{
#ifdef __CLIENT__
if(Updater_IsDownloadInProgress())
{
Con_Message("Cannot quit while downloading update.\n");
return false;
}
#endif

if(argv[0][4] == '!' || isDedicated || !DD_GameLoaded() ||
gx.TryShutdown == 0)
Expand Down
6 changes: 6 additions & 0 deletions doomsday/engine/src/dd_main.cpp
Expand Up @@ -156,6 +156,8 @@ extern GETGAMEAPI GetGameAPI;
// The Game collection.
static de::GameCollection* games;

#ifdef __CLIENT__

D_CMD(CheckForUpdates)
{
DENG_UNUSED(src); DENG_UNUSED(argc); DENG_UNUSED(argv);
Expand Down Expand Up @@ -191,6 +193,8 @@ D_CMD(ShowUpdateSettings)
return true;
}

#endif // __CLIENT__

void DD_CreateResourceClasses()
{
resourceClasses.push_back(new ResourceClass("RC_PACKAGE", "Packages"));
Expand Down Expand Up @@ -569,10 +573,12 @@ void DD_ClearSystemTextureSchemes()
*/
void DD_Register(void)
{
#ifdef __CLIENT__
C_CMD("update", "", CheckForUpdates);
C_CMD("updateandnotify", "", CheckForUpdatesAndNotify);
C_CMD("updatesettings", "", ShowUpdateSettings);
C_CMD("lastupdated", "", LastUpdated);
#endif

DD_RegisterLoop();
DD_RegisterInput();
Expand Down
2 changes: 2 additions & 0 deletions doomsday/engine/src/dd_pinit.c
Expand Up @@ -169,7 +169,9 @@ void DD_ShutdownAll(void)
{
int i;

#ifdef __CLIENT__
Updater_Shutdown();
#endif
FI_Shutdown();
UI_Shutdown();
Con_Shutdown();
Expand Down
5 changes: 4 additions & 1 deletion doomsday/engine/src/game.cpp
Expand Up @@ -409,11 +409,11 @@ void Game_Print(Game const* game, int flags)
de::Game::print(*reinterpret_cast<de::Game const*>(game), flags);
}

/// @todo Do this really belong here? Semantically, this appears misplaced. -ds
void Game_Notify(int notification, void* param)
{
DENG_UNUSED(param);

#ifdef __CLIENT__
switch(notification)
{
case DD_NOTIFY_GAME_SAVED:
Expand All @@ -424,4 +424,7 @@ void Game_Notify(int notification, void* param)
Updater_RaiseCompletedDownloadDialog();
break;
}
#else
DENG_UNUSED(notification);
#endif
}
8 changes: 5 additions & 3 deletions doomsday/engine/src/ui/window.cpp
Expand Up @@ -258,7 +258,7 @@ struct ddwindow_s
{
geometry.size.width = DisplayMode_Current()->width;
geometry.size.height = DisplayMode_Current()->height;
#ifdef MACOSX
#if defined MACOSX && defined __CLIENT__
// Pull the window again over the shield after the mode change.
DisplayMode_Native_Raise(Window_NativeHandle(this));
#endif
Expand Down Expand Up @@ -477,6 +477,7 @@ struct ddwindow_s

bool applyAttributes(int* attribs)
{
#ifdef __CLIENT__
LOG_AS("applyAttributes");

bool changed = false;
Expand Down Expand Up @@ -576,6 +577,7 @@ struct ddwindow_s

// Seems ok, apply them.
applyWindowGeometry();
#endif // __CLIENT__
return true;
}

Expand Down Expand Up @@ -653,7 +655,7 @@ static void updateMainWindowLayout(void)

if(win->flags & DDWF_FULLSCREEN)
{
#ifdef MACOSX
#if defined MACOSX && defined __CLIENT__
// For some interesting reason, we have to scale the window twice in fullscreen mode
// or the resulting layout won't be correct.
win->widget->setGeometry(QRect(0, 0, 320, 240));
Expand Down Expand Up @@ -1066,7 +1068,7 @@ static void finishMainWindowInit(Canvas& canvas)
Window* win = canvasToWindow(canvas);
assert(win == &mainWindow);

#ifdef MACOSX
#if defined MACOSX && defined __CLIENT__
if(Window_IsFullscreen(win))
{
// The window must be manually raised above the shielding window put up by
Expand Down
17 changes: 1 addition & 16 deletions doomsday/server/server.pro
Expand Up @@ -273,15 +273,7 @@ DENG_HEADERS += \
$$SRC/include/ui/sys_input.h \
$$SRC/include/ui/ui2_main.h \
$$SRC/include/ui/window.h \
$$SRC/include/updater.h \
$$SRC/include/uri.hh \
$$SRC/src/updater/downloaddialog.h \
$$SRC/src/updater/processcheckdialog.h \
$$SRC/src/updater/updateavailabledialog.h \
$$SRC/src/updater/updaterdialog.h \
$$SRC/src/updater/updatersettings.h \
$$SRC/src/updater/updatersettingsdialog.h \
$$SRC/src/updater/versioninfo.h
$$SRC/include/uri.hh

INCLUDEPATH += \
include \
Expand Down Expand Up @@ -477,13 +469,6 @@ SOURCES += \
$$SRC/src/ui/sys_input.c \
$$SRC/src/ui/ui2_main.cpp \
$$SRC/src/ui/window.cpp \
$$SRC/src/updater/downloaddialog.cpp \
$$SRC/src/updater/processcheckdialog.cpp \
$$SRC/src/updater/updateavailabledialog.cpp \
$$SRC/src/updater/updater.cpp \
$$SRC/src/updater/updaterdialog.cpp \
$$SRC/src/updater/updatersettings.cpp \
$$SRC/src/updater/updatersettingsdialog.cpp \
$$SRC/src/uri.cpp \
$$SRC/src/uri_wrapper.cpp

Expand Down

0 comments on commit 6f8392e

Please sign in to comment.