make debug builds of the swgclient work - note this will forever prvent

the ingame web browser from functioning
This commit is contained in:
DarthArgus
2017-10-29 14:36:39 -07:00
parent 298947364d
commit 68e4f185bf
6 changed files with 125 additions and 59 deletions

26
.gitignore vendored
View File

@@ -3,6 +3,10 @@ src/external/3rd/library/dpvs/implementation/msvc8/release/
*.sdf
*.suo
*.aps
*.idb
*.pdb
./src/external/3rd/library/platform/utils/Base/debug/*
./src/external/3rd/library/platform/utils/Base/release/*
*/*.obj
*.log
*.vcxproj.user
@@ -60,3 +64,25 @@ libs/
*~
external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/debug/
external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/release/
src/external/3rd/library/platform/utils/Base/debug/Archive.obj
src/external/3rd/library/platform/utils/Base/debug/AutoLog.obj
src/external/3rd/library/platform/utils/Base/debug/Base.obj
src/external/3rd/library/platform/utils/Base/debug/Base.tlog/Base.lastbuildstate
src/external/3rd/library/platform/utils/Base/debug/Base.tlog/CL.read.1.tlog
src/external/3rd/library/platform/utils/Base/debug/Base.tlog/CL.write.1.tlog
src/external/3rd/library/platform/utils/Base/debug/Base.tlog/Lib-link.read.1.tlog
src/external/3rd/library/platform/utils/Base/debug/Base.tlog/Lib-link.write.1.tlog
src/external/3rd/library/platform/utils/Base/debug/Base.tlog/cl.command.1.tlog
src/external/3rd/library/platform/utils/Base/debug/Base.tlog/lib.command.1.tlog
src/external/3rd/library/platform/utils/Base/debug/BlockAllocator.obj
src/external/3rd/library/platform/utils/Base/debug/Config.obj
src/external/3rd/library/platform/utils/Base/debug/Event.obj
src/external/3rd/library/platform/utils/Base/debug/Logger.obj
src/external/3rd/library/platform/utils/Base/debug/MD5.obj
src/external/3rd/library/platform/utils/Base/debug/Mutex.obj
src/external/3rd/library/platform/utils/Base/debug/Platform.obj
src/external/3rd/library/platform/utils/Base/debug/ScopeLock.obj
src/external/3rd/library/platform/utils/Base/debug/Statistics.obj
src/external/3rd/library/platform/utils/Base/debug/Thread.obj
src/external/3rd/library/platform/utils/Base/debug/vc120.idb
src/external/3rd/library/platform/utils/Base/debug/vc120.pdb

View File

@@ -143,7 +143,9 @@
#include "sharedUtility/LocalMachineOptionManager.h"
#include "swgSharedNetworkMessages/MessageQueueCombatAction.h"
#include "swgSharedUtility/Postures.def"
#if DEBUG=0
#include "libMozilla/libMozilla.h"
#endif
#include "LocalizationManager.h"
#include "LocalizedStringTable.h"

View File

@@ -79,7 +79,10 @@
#include "swgClientUserInterface/SwgCuiG15Lcd.h"
#include "swgClientUserInterface/SwgCuiManager.h"
#include "swgSharedNetworkMessages/SetupSwgSharedNetworkMessages.h"
#if DEBUG=0
#include "libMozilla/libMozilla.h"
#endif
#include "Resource.h"
@@ -127,7 +130,7 @@ int ClientMain(
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // pointer to command line
int nCmdShow // show state of window
)
)
{
UNREF(hPrevInstance);
UNREF(nCmdShow);
@@ -144,24 +147,24 @@ int ClientMain(
char clientWindowName[128] = "Star Wars Galaxies";
#if PRODUCTION != 1
snprintf(clientWindowName, sizeof(clientWindowName), "SwgClient (%s.%s)", Branch().getBranchName().c_str(), ApplicationVersion::getPublicVersion() );
snprintf(clientWindowName, sizeof(clientWindowName), "SwgClient (%s.%s)", Branch().getBranchName().c_str(), ApplicationVersion::getPublicVersion());
clientWindowName[sizeof(clientWindowName) - 1] = '\0';
#endif
//-- foundation
SetupSharedFoundation::Data data(SetupSharedFoundation::Data::D_game);
data.windowName = clientWindowName;
data.windowNormalIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
data.windowSmallIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON2));
data.hInstance = hInstance;
data.commandLine = lpCmdLine;
data.configFile = "client.cfg";
data.clockUsesSleep = true;
data.minFrameRate = 1.f;
data.frameRateLimit = 144.f;
data.windowName = clientWindowName;
data.windowNormalIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
data.windowSmallIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON2));
data.hInstance = hInstance;
data.commandLine = lpCmdLine;
data.configFile = "client.cfg";
data.clockUsesSleep = true;
data.minFrameRate = 1.f;
data.frameRateLimit = 144.f;
#if PRODUCTION
data.demoMode = true;
data.demoMode = true;
#endif
if (ApplicationVersion::isPublishBuild() || ApplicationVersion::isBootlegBuild())
{
@@ -171,11 +174,11 @@ int ClientMain(
SetupSharedFoundation::install(data);
REPORT_LOG(true, ("ClientMain: Command Line = \"%s\"\n", lpCmdLine));
REPORT_LOG (true, ("ClientMain: Memory size = %i MB\n", MemoryManager::getLimit()));
REPORT_LOG(true, ("ClientMain: Memory size = %i MB\n", MemoryManager::getLimit()));
// check for any config file entries
if (ConfigFile::isEmpty())
FATAL(true, ("Config file not specified"));
FATAL(true, ("Config file not specified"));
InstallTimer::checkConfigFile();
@@ -188,9 +191,9 @@ int ClientMain(
else
{
{
uint32 gameFeatures = ConfigFile::getKeyInt("Station", "gameFeatures", 0) & ~ConfigFile::getKeyInt("ClientGame", "gameBitsToClear", 0);
uint32 gameFeatures = ConfigFile::getKeyInt("Station", "gameFeatures", 0) & ~ConfigFile::getKeyInt("ClientGame", "gameBitsToClear", 0);
// hack to set retail if beta or preorder
if (ConfigFile::getKeyBool("ClientGame", "setJtlRetailIfBetaIsSet", 0))
if (ConfigFile::getKeyBool("ClientGame", "setJtlRetailIfBetaIsSet", 0))
{
if (gameFeatures & (ClientGameFeature::SpaceExpansionBeta | ClientGameFeature::SpaceExpansionPreOrder))
gameFeatures |= ClientGameFeature::SpaceExpansionRetail;
@@ -204,7 +207,7 @@ int ClientMain(
if (gameFeatures & ClientGameFeature::TrialsOfObiwanPreorder)
gameFeatures |= ClientGameFeature::TrialsOfObiwanRetail;
Game::setGameFeatureBits(gameFeatures);
Game::setSubscriptionFeatureBits(ConfigFile::getKeyInt("Station", "subscriptionFeatures", 0));
Game::setSubscriptionFeatureBits(ConfigFile::getKeyInt("Station", "subscriptionFeatures", 0));
Game::setExternalCommandHandler(externalCommandHandler);
}
@@ -240,9 +243,9 @@ int ClientMain(
//-- utility
SetupSharedUtility::Data setupUtilityData;
SetupSharedUtility::setupGameData (setupUtilityData);
SetupSharedUtility::setupGameData(setupUtilityData);
setupUtilityData.m_allowFileCaching = true;
SetupSharedUtility::install (setupUtilityData);
SetupSharedUtility::install(setupUtilityData);
//-- random
SetupSharedRandom::install(static_cast<uint32>(time(NULL)));
@@ -251,8 +254,8 @@ int ClientMain(
//-- image
SetupSharedImage::Data setupImageData;
SetupSharedImage::setupDefaultData (setupImageData);
SetupSharedImage::install (setupImageData);
SetupSharedImage::setupDefaultData(setupImageData);
SetupSharedImage::install(setupImageData);
//-- network
SetupSharedNetwork::SetupData networkSetupData;
@@ -264,30 +267,30 @@ int ClientMain(
//-- object
SetupSharedObject::Data setupObjectData;
SetupSharedObject::setupDefaultGameData (setupObjectData);
SetupSharedObject::setupDefaultGameData(setupObjectData);
setupObjectData.useTimedAppearanceTemplates = true;
// we want the SlotIdManager initialized, and we need the associated hardpoint names loaded.
SetupSharedObject::addSlotIdManagerData(setupObjectData, true);
// we want CustomizationData support on the client.
SetupSharedObject::addCustomizationSupportData(setupObjectData);
SetupSharedObject::addMovementTableData(setupObjectData);
SetupSharedObject::install (setupObjectData);
SetupSharedObject::install(setupObjectData);
//-- game
SetupSharedGame::Data setupSharedGameData;
setupSharedGameData.setUseGameScheduler (true);
setupSharedGameData.setUseMountValidScaleRangeTable (true);
setupSharedGameData.setUseGameScheduler(true);
setupSharedGameData.setUseMountValidScaleRangeTable(true);
setupSharedGameData.m_debugBadStringsFunc = CuiManager::debugBadStringIdsFunc;
SetupSharedGame::install (setupSharedGameData);
SetupSharedGame::install(setupSharedGameData);
CommoditiesAdvancedSearchAttribute::install();
SwgCuiAuctionFilter::buildAttributeFilterDisplayString(); // must be called after CommoditiesAdvancedSearchAttribute::install()
//-- terrain
SetupSharedTerrain::Data setupSharedTerrainData;
SetupSharedTerrain::setupGameData (setupSharedTerrainData);
SetupSharedTerrain::install (setupSharedTerrainData);
SetupSharedTerrain::setupGameData(setupSharedTerrainData);
SetupSharedTerrain::install(setupSharedTerrainData);
//-- SharedXml
SetupSharedXml::install();
@@ -298,28 +301,29 @@ int ClientMain(
//-- setup client
//-- audio
SetupClientAudio::install ();
SetupClientAudio::install();
//-- graphics
SetupClientGraphics::Data setupGraphicsData;
setupGraphicsData.screenWidth = 1024;
setupGraphicsData.screenWidth = 1024;
setupGraphicsData.screenHeight = 768;
setupGraphicsData.alphaBufferBitDepth = 0;
SetupClientGraphics::setupDefaultGameData (setupGraphicsData);
SetupClientGraphics::setupDefaultGameData(setupGraphicsData);
#if DEBUG=0
// Mozilla
// We want to use the Mozilla that's shipped with the game, not whatever's on the system
char szCWD[ _MAX_PATH + 1 ];
GetCurrentDirectory( _MAX_PATH, szCWD );
std::string sPath( szCWD );
char szCWD[_MAX_PATH + 1];
GetCurrentDirectory(_MAX_PATH, szCWD);
std::string sPath(szCWD);
sPath += "\\mozilla";
if(!libMozilla::init(Os::getWindow(), sPath.c_str()))
if (!libMozilla::init(Os::getWindow(), sPath.c_str()))
{
DEBUG_FATAL(true, ("Mozilla init failed.\n"));
}
if (SetupClientGraphics::install (setupGraphicsData))
if (SetupClientGraphics::install(setupGraphicsData))
{
VideoList::install(Audio::getMilesDigitalDriver());
@@ -332,32 +336,32 @@ int ClientMain(
//-- object
SetupClientObject::Data setupClientObjectData;
SetupClientObject::setupGameData (setupClientObjectData);
SetupClientObject::install (setupClientObjectData);
SetupClientObject::setupGameData(setupClientObjectData);
SetupClientObject::install(setupClientObjectData);
//-- animation and skeletal animation
SetupClientAnimation::install ();
SetupClientAnimation::install();
SetupClientSkeletalAnimation::Data saData;
SetupClientSkeletalAnimation::setupGameData(saData);
SetupClientSkeletalAnimation::install (saData);
SetupClientSkeletalAnimation::install(saData);
//-- texture renderer
SetupClientTextureRenderer::install ();
SetupClientTextureRenderer::install();
//-- terrain
SetupClientTerrain::install ();
SetupClientTerrain::install();
//-- particle system
SetupClientParticle::install ();
SetupClientParticle::install();
//-- game
SetupClientGame::Data data;
SetupClientGame::setupGameData (data);
SetupClientGame::install (data);
SetupClientGame::setupGameData(data);
SetupClientGame::install(data);
CuiManager::setImplementationInstallFunctions (SwgCuiManager::install, SwgCuiManager::remove, SwgCuiManager::update);
CuiManager::setImplementationTestFunction (SwgCuiManager::test);
CuiManager::setImplementationInstallFunctions(SwgCuiManager::install, SwgCuiManager::remove, SwgCuiManager::update);
CuiManager::setImplementationTestFunction(SwgCuiManager::test);
SetupClientBugReporting::install();
@@ -386,20 +390,20 @@ int ClientMain(
}
CuiSettings::save();
CuiChatHistory::save();
CurrentUserOptionManager::save ();
LocalMachineOptionManager::save ();
CurrentUserOptionManager::save();
LocalMachineOptionManager::save();
}
}
SetupSharedFoundation::remove ();
SetupSharedThread::remove ();
SetupSharedFoundation::remove();
SetupSharedThread::remove();
libMozilla::release();
if (semaphore)
CloseHandle(semaphore);
# endif
return 0;
}
}
// ======================================================================

View File

@@ -11,7 +11,11 @@
#include "clientGame/Game.h"
#include "clientUserInterface/CuiMediator.h"
#include "clientUserInterface/CuiWorkspace.h"
#if DEBUG=0
#include "libMozilla/libMozilla.h"
#endif
#include "sharedFoundation/Os.h"
#include "sharedFoundation/Timer.h"
#include "swgClientUserInterface/SwgCuiWebBrowserWidget.h"
@@ -52,6 +56,7 @@ using namespace SwgCuiWebBrowserManagerNamespace;
void SwgCuiWebBrowserManager::install()
{
#if DEBUG=0
DEBUG_FATAL(s_installed, ("SwgCuiWebBrowserManager already installed.\n"));
s_installed = true;
@@ -63,10 +68,12 @@ void SwgCuiWebBrowserManager::install()
libMozilla::setUserAgent("StarWarsGalaxies");
libMozilla::enableMemoryCache(true);
libMozilla::enableDiskCache(true, 50 * 1024);
#endif
}
void SwgCuiWebBrowserManager::remove()
{
#if DEBUG=0
DEBUG_FATAL(!s_installed, ("SwgCuiWebBrowserManager not installed. Failed Remove.\n"));
s_installed = false;
@@ -83,12 +90,12 @@ void SwgCuiWebBrowserManager::remove()
}
s_Widget = NULL;
#endif
}
void SwgCuiWebBrowserManager::update(float deltaTimeSecs)
{
#if DEBUG=0
// Update Mozilla
libMozilla::update();
@@ -125,10 +132,12 @@ void SwgCuiWebBrowserManager::update(float deltaTimeSecs)
s_postData.clear();
s_postDataLength = 0;
}
#endif
}
void SwgCuiWebBrowserManager::createWebBrowserPage(bool useHomePage)
{
#if DEBUG=0
bool isValidPage = Game::isSpace() ? (s_type == WBT_Space) : (s_type == WBT_Ground);
if(s_Window && isValidPage)
@@ -243,19 +252,22 @@ void SwgCuiWebBrowserManager::createWebBrowserPage(bool useHomePage)
browserWindow->activate();
browserWindow->setEnabled(true);
workspace->focusMediator(*browserWindow, true);
#endif
}
void SwgCuiWebBrowserManager::debugOutput()
{
#if DEBUG=0
if(s_Widget)
s_Widget->debugOutput();
#endif
}
void SwgCuiWebBrowserManager::setURL(std::string url, bool clearCachedURL, char const * postData, int postDataLength)
{
if(s_URL.empty() || clearCachedURL )
{
#if DEBUG=0
if(s_URL.empty() || clearCachedURL )
{
s_URL = url;
if(postData)
@@ -266,34 +278,44 @@ void SwgCuiWebBrowserManager::setURL(std::string url, bool clearCachedURL, char
s_timer.reset();
}
#endif
}
void SwgCuiWebBrowserManager::navigateForward()
{
#if DEBUG=0
if(s_Widget)
s_Widget->NavigateForward();
#endif
}
void SwgCuiWebBrowserManager::navigateBack()
{
#if DEBUG=0
if(s_Widget)
s_Widget->NavigateBack();
#endif
}
void SwgCuiWebBrowserManager::navigateStop()
{
#if DEBUG=0
if(s_Widget)
s_Widget->NavigateStop();
#endif
}
void SwgCuiWebBrowserManager::refreshPage()
{
#if DEBUG=0
if(s_Widget)
s_Widget->RefreshPage();
#endif
}
void SwgCuiWebBrowserManager::setHomePage(std::string const & home)
{
#if DEBUG=0
s_homePage = home;
#endif
}

View File

@@ -24,7 +24,11 @@
#include "swgClientUserInterface/SwgCuiHud.h"
#include "swgClientUserInterface/SwgCuiHudFactory.h"
#include "swgClientUserInterface/SwgCuiWebBrowserWindow.h"
#if DEBUG=0
#include "libMozilla/libMozilla.h"
#endif
#include "UnicodeUtils.h"
#include "UICanvas.h"
@@ -34,6 +38,7 @@
// ======================================================================
#if DEBUG=0
namespace browserNamespace
{
std::string s_homePage = "beta.stellabellum.net";
@@ -479,4 +484,5 @@ std::string SwgCuiWebBrowserWidget::getCurrentURL() const
return std::string();
}
#endif
// ======================================================================

View File

@@ -152,7 +152,9 @@ namespace SwgCuiCommandParserUINamespace
const char * const testLootBox = "testLootBox";
const char * const debugStringIds = "debugStringIds";
const char * const debugStringIdColor = "debugStringIdColor";
#if DEBUG=0
const char * const debugBrowserOutput = "mozillaBrowserOutput";
#endif
#endif
}
@@ -208,7 +210,9 @@ namespace SwgCuiCommandParserUINamespace
{CommandNames::testLootBox, 1, "[objectId]...", "Test the loot box with existing object ids."},
{CommandNames::debugStringIds, 0, "[1|0]", "Debug the source string id table and entry."},
{CommandNames::debugStringIdColor, 0, "<ui color string>", "Set the color of the debug StringId string."},
#if DEBUG=0
{CommandNames::debugBrowserOutput, 0, "", "Prints out debug information related to the Mozilla browser." },
#endif
#endif
{"", 0, "", ""} // this must be last
};
@@ -1084,11 +1088,13 @@ bool SwgCuiCommandParserUI::performParsing (const NetworkId & userId, const Stri
LocalizationManager::debugDisplayStringColor(color);
return true;
}
#if DEBUG=0
else if(isCommand(argv[0], CommandNames::debugBrowserOutput))
{
SwgCuiWebBrowserManager::debugOutput();
return true;
}
#endif
#endif