From 3b430656ba343ce20d28dd95eb0a0d3d9e2c9834 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Thu, 24 Mar 2016 21:07:31 +0000 Subject: [PATCH] remove SOE deprecated code and files - leaving in the #if 0 blocks with TODO and other possible uses for later --- .../application/Miff/src/linux/bison.simple | 7 - .../application/Miff/src/linux/miff.cpp | 195 -------- .../src/shared/TaskConnection.cpp | 4 - .../src/linux/TaskManagerSysInfo.cpp | 24 - .../src/shared/MetricsServerConnection.cpp | 4 - .../TaskManager/src/shared/TaskManager.cpp | 9 - .../src/shared/DatabaseProcess.cpp | 17 - .../commoditiesMarket/CommoditiesMarket.cpp | 67 --- .../src/shared/core/PreloadManager.cpp | 7 - .../src/shared/core/ServerBuildoutManager.cpp | 16 - .../src/shared/core/ServerWorld.cpp | 12 - .../src/shared/object/CreatureObject.cpp | 6 - .../shared/object/GroupWaypointBuilder.cpp | 24 - .../src/shared/object/ServerObject.cpp | 7 - .../shared/space/ShipClientUpdateTracker.cpp | 15 - .../src/shared/trading/ServerSecureTrade.cpp | 57 --- .../serverKeyShare/src/shared/KeyServer.cpp | 18 +- .../serverScript/src/shared/JavaLibrary.cpp | 14 - .../src/shared/ScriptMethodsChat.cpp | 23 - .../src/shared/ZlibCompressor.cpp | 8 - .../sharedDebug/src/linux/DebugMonitor.cpp | 4 - .../library/sharedFile/src/shared/Iff.h | 4 - .../src/linux/FloatingPointUnit.cpp | 12 - .../library/sharedFoundation/src/linux/Os.cpp | 18 - .../src/linux/PlatformGlue.cpp | 7 - .../src/linux/SetupSharedFoundation.cpp | 6 - .../sharedFoundation/src/shared/Clock.cpp | 18 - .../sharedFoundation/src/shared/Crc.cpp | 19 - .../appearance/WearableAppearanceMap.cpp | 10 - .../sharedGame/src/shared/quest/Quest.cpp | 9 - .../src/shared/ImageManipulation.cpp | 7 - .../src/shared/ImageManipulation.h | 15 +- .../sharedMath/src/shared/PaletteArgb.cpp | 2 +- .../CustomizationData_Directory.h | 5 - .../CustomizationData_LocalDirectory.cpp | 227 --------- .../CustomizationData_LocalDirectory.h | 10 - .../CustomizationData_RemoteDirectory.cpp | 27 -- .../CustomizationData_RemoteDirectory.h | 5 - .../RangedIntCustomizationVariable.cpp | 53 --- .../RangedIntCustomizationVariable.h | 4 - .../sharedObject/src/shared/object/Object.cpp | 4 - .../src/shared/portal/CellProperty.cpp | 8 - .../src/shared/portal/PortalProperty.cpp | 2 +- .../SamplerProceduralTerrainAppearance.cpp | 124 ----- .../src/shared/generator/CoordinateHash.cpp | 21 - .../library/sharedThread/src/linux/Thread.cpp | 15 - .../sharedThread/src/shared/RunThread.cpp | 23 - .../sharedUtility/src/shared/FileName.cpp | 9 - .../projects/VChat/VChatAPI/CMakeLists.txt | 4 - .../VChatAPI/utils2.0/utils/Base/types.h | 19 +- .../utils2.0/utils/TcpLibrary/TcpListener.cpp | 435 ------------------ .../utils2.0/utils/TcpLibrary/TcpListener.h | 160 ------- .../utils2.0/utils/UdpLibrary/UdpListener.cpp | 394 ---------------- .../utils2.0/utils/UdpLibrary/UdpListener.h | 145 ------ external/3rd/library/udplibrary/udpclient.cpp | 61 +-- external/3rd/library/udplibrary/udpserver.cpp | 13 - .../SwgDatabaseServer/src/CMakeLists.txt | 1 - .../src/shared/buffers/IndexedTableBuffer.h | 54 --- 58 files changed, 7 insertions(+), 2481 deletions(-) delete mode 100755 external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/TcpListener.cpp delete mode 100755 external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/TcpListener.h delete mode 100755 external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/UdpLibrary/UdpListener.cpp delete mode 100755 external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/UdpLibrary/UdpListener.h delete mode 100755 game/server/application/SwgDatabaseServer/src/shared/buffers/IndexedTableBuffer.h diff --git a/engine/client/application/Miff/src/linux/bison.simple b/engine/client/application/Miff/src/linux/bison.simple index 5f8f386e..27927e11 100644 --- a/engine/client/application/Miff/src/linux/bison.simple +++ b/engine/client/application/Miff/src/linux/bison.simple @@ -632,13 +632,6 @@ yyerrlab1: /* here on error raised explicitly by an action */ yyerrdefault: /* current state does not do anything special for the error token. */ -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif - yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) YYABORT; diff --git a/engine/client/application/Miff/src/linux/miff.cpp b/engine/client/application/Miff/src/linux/miff.cpp index 32f52b5b..8f62be65 100755 --- a/engine/client/application/Miff/src/linux/miff.cpp +++ b/engine/client/application/Miff/src/linux/miff.cpp @@ -380,201 +380,6 @@ static errorType evaluateArgs(void) return retVal; return retVal; - -#if 0 - - errorType retVal = ERR_NONE; // assume no error has been found - bool outPathUsed = false; // flag to monitor if -o flag was used, if so, we can ignore -d, -p, -e, -f - bool inFileEntered = false; - int argc = CommandLine::getPlainCount(); - - // get default values from DOS - char currentDir[maxStringSize]; - if (nullptr == getcwd(currentDir, maxStringSize)) // get current working directory - { - retVal = ERR_UNKNOWNDIR; - return(retVal); - } - drive[0] = currentDir[0]; // drive letter - drive[1] = 0; // and nullptr terminate it - strcpy(extension, "IFF"); // default to uppercase .IFF - strcpy(directory, ¤tDir[2]); // get everything after the Drive: including the first backslash - filename[0] = 0; - - // see specs.txt for requests - // scan for any argv's that has '-' in the argv[n][0]'s character - for (int index = 0; index < argc; index++) // note: if using argv[] rather then CommandLine::getPlainString() then start with 1 rather then 0 - { - if ('-' == CommandLine::getPlainString(index)[0]) - { - // we've found a parameter switch - switch (tolower(CommandLine::getPlainString(index)[1])) // assume non case sensitive switches - { - case 'i': // install via #pragma - { - usePragma = true; - break; - } - - case 'c': // use CCCP instead of CPP - useCCCP = true; - break; - - case 'v': // don't show any debug message - verboseMode = true; - break; - - case '$': - debugMode = true; - break; - - case 'o': // target output file name and path (complete path) - { - index++; // next param - outPathUsed = true; - strcpy(outFileName, CommandLine::getPlainString(index)); - break; - - } - - case 'd': // target drive letter (-p must be present) - { - if (!outPathUsed) - { - index++; // next param - strcpy(drive, CommandLine::getPlainString(index)); - } - else - index++; // skip the drive letter arg that SHOULD follow the -d option - break; - } - - case 'p': // target pathname - { - if (!outPathUsed) - { - index++; // next param - strcpy(directory, CommandLine::getPlainString(index)); - } - else - index++; // skip the pathname arg that follows the -p option - break; - } - - case 'f': // target filename - { - if (!outPathUsed) - { - index++; // next param - strcpy(filename, CommandLine::getPlainString(index)); - } - else - index++; // skip the filename arg that follows the -f - break; - } - - case 'e': // target extension - { - if (!outPathUsed) - { - index++; // next param - strcpy(extension, CommandLine::getPlainString(index)); - } - else - index++; // skip the extension arg that follows the -e - break; - } - - case 'h': // help! - case '?': - { - help(); - index = argc; // force to exit - retVal = ERR_HELPREQUEST; - return(retVal); // special case, ONLY time I call return() in the middle of the function (because I check for argc < 2 at the end of the code) - break; - } - - default: - { - sprintf(err_msg, "\nUnknown parameter %s, use -h to seek help...\n", CommandLine::getPlainString(index)); - MIFFMessage(err_msg, 1); - index = argc; // force to exit - break; - } - } - } - else - { - // we found an arg that doesn't start with '-' so let's assume it's a filename - if (!inFileEntered) - { - strcpy(inFileName, CommandLine::getPlainString(index)); - inFileEntered = true; - } - else - { - retVal = ERR_MULTIPLEINFILE; - index = argc; - } - - // now construct the DEFAULT filename for this file by scanning backwards to front and only extracting the filename (no extension, no path) - if (ERR_NONE == retVal) - { - char sourceName[maxStringSize]; - strcpy(sourceName, inFileName); // make a duplicate for us to play with - for (int strIndex = strlen(sourceName); strIndex > 0; strIndex--) - { - if ('.' == sourceName[strIndex]) - sourceName[strIndex] = 0; // put a stopper here... we are assuming that '.' indicates extension! I'm going to assume that the person is just testing me if s/he decides to use filename like "foo.bar.psych" which will truncate to "foo" - if ('\\' == sourceName[strIndex]) - break; // get out, for we've reached the path name... - } - - // ok, by here, strIndex should point to either beginning of the string, or where the first '\' was found scanning backwards - strcpy(filename, &sourceName[strIndex]); // ta-da-! - } - } - } - - if (inFileEntered) - { - if (0 == preprocessSource(inFileName)) - { - if (verboseMode) - { - // using err_msg as my temp buffer... - sprintf(err_msg,"Now compiling %s\n", inFileName); - MIFFMessage(err_msg, 0); - } - - if (ERR_NONE == retVal) - retVal = loadInputToBuffer(sourceBuffer, bufferSize); - } - else // preprocessSource returned an error... - { - retVal = ERR_PREPROCESS; - } - } - else // inFileEntered == false - { - MIFFMessage("Missing input filename in command line!", 1); - } - - // construct a outFileName[] based on drive[], directory[], filename[], and extension[] - if (!outPathUsed && (ERR_NONE == retVal)) - { - if (inFileName[0]) // make sure the user has entered a input filename - sprintf(outFileName,"%s:%s\\%s.%s", drive, directory, filename, extension); - } - - if (argc < 1) - retVal = ERR_ARGSTOOFEW; // we can do this because we know -h was not entered... - - return(retVal); - -#endif - } diff --git a/engine/server/application/MetricsServer/src/shared/TaskConnection.cpp b/engine/server/application/MetricsServer/src/shared/TaskConnection.cpp index c3a6d841..3ec3e534 100755 --- a/engine/server/application/MetricsServer/src/shared/TaskConnection.cpp +++ b/engine/server/application/MetricsServer/src/shared/TaskConnection.cpp @@ -72,10 +72,6 @@ void TaskConnection::onConnectionOpened() void TaskConnection::onReceive(const Archive::ByteStream & message) { UNREF(message); -#if 0 - Archive::ReadIterator r(message); - GameNetworkMessage m(r); -#endif } //----------------------------------------------------------------------- diff --git a/engine/server/application/TaskManager/src/linux/TaskManagerSysInfo.cpp b/engine/server/application/TaskManager/src/linux/TaskManagerSysInfo.cpp index 31bc94bf..798245b3 100755 --- a/engine/server/application/TaskManager/src/linux/TaskManagerSysInfo.cpp +++ b/engine/server/application/TaskManager/src/linux/TaskManagerSysInfo.cpp @@ -46,32 +46,8 @@ TaskManagerSysInfo & TaskManagerSysInfo::operator = (const TaskManagerSysInfo & const float TaskManagerSysInfo::getScore() const { -#if 0 - //Temporariy remove this since it's not giving us good results - FILE * avg = popen("uptime", "r"); - float a = 0.0f; - if(avg) - { - std::string output; - while(!feof(avg)) - { - char buf[1024] = {"\0"}; - - fread(buf, sizeof(buf), 1, avg); - output += buf; - } - char formatted[1024] = {"\0"}; - std::string load = output.substr(output.find("load average:")); - sscanf(load.c_str(), "load average: %f", &a); - pclose(avg); - } - return a; -#else - float ret = static_cast(TaskManager::getNumGameConnections()); return ret; - -#endif } //----------------------------------------------------------------------- diff --git a/engine/server/application/TaskManager/src/shared/MetricsServerConnection.cpp b/engine/server/application/TaskManager/src/shared/MetricsServerConnection.cpp index eeef0926..f5287c2a 100755 --- a/engine/server/application/TaskManager/src/shared/MetricsServerConnection.cpp +++ b/engine/server/application/TaskManager/src/shared/MetricsServerConnection.cpp @@ -77,10 +77,6 @@ void MetricsServerConnection::onProcessKilled(const ProcessKilled & k) void MetricsServerConnection::receive(const Archive::ByteStream & ) { -#if 0 - Archive::ReadIterator r(message); - GameNetworkMessage m(r); -#endif } //----------------------------------------------------------------------- diff --git a/engine/server/application/TaskManager/src/shared/TaskManager.cpp b/engine/server/application/TaskManager/src/shared/TaskManager.cpp index 04550a81..24243de7 100755 --- a/engine/server/application/TaskManager/src/shared/TaskManager.cpp +++ b/engine/server/application/TaskManager/src/shared/TaskManager.cpp @@ -831,15 +831,6 @@ void TaskManager::update() lastTime = currentTime; } -#if 0 - instance().m_sysInfoSource->update(); - if (ms_doUpdate) - { - Locator::updateAllLoads(); - ms_doUpdate = false; - } -#endif//0 - // get process status std::set >::iterator i; for(i = instance().m_localServers.begin(); i != instance().m_localServers.end();) diff --git a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp index fb5a56fe..7164f1b8 100755 --- a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp +++ b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp @@ -498,23 +498,6 @@ void DatabaseProcess::receiveMessage(const MessageDispatch::Emitter & source, co Loader::getInstance().checkVersionNumber(ConfigServerDatabase::getExpectedDBVersion(), ConfigServerDatabase::isCorrectDBVersionRequired()); Loader::getInstance().loadClock(); } - else if(message.isType("LoadObjectMessage")) - { -#if 0 - Archive::ReadIterator ri = static_cast(message).getByteStream().begin(); - LoadObjectMessage lom(ri); - connectToGameServer(lom.getAddress().c_str(),lom.getPort(),lom.getProcess()); -#endif - } - else if (message.isType("LoadUniverseMessage")) - { -#if 0 - Archive::ReadIterator ri = static_cast(message).getByteStream().begin(); - LoadUniverseMessage lom(ri); - connectToGameServer(lom.getAddress().c_str(),lom.getPort(),lom.getProcess()); -#endif - } - else if(message.isType("GameSetProcessId") || message.isType("GameGameServerConnect")) { GameServerConnection * g = const_cast(static_cast(&source)); diff --git a/engine/server/library/serverGame/src/shared/commoditiesMarket/CommoditiesMarket.cpp b/engine/server/library/serverGame/src/shared/commoditiesMarket/CommoditiesMarket.cpp index fbc7b761..5d90b89e 100755 --- a/engine/server/library/serverGame/src/shared/commoditiesMarket/CommoditiesMarket.cpp +++ b/engine/server/library/serverGame/src/shared/commoditiesMarket/CommoditiesMarket.cpp @@ -246,15 +246,6 @@ namespace CommoditiesMarketNamespace errorCode = ar_ITEM_EQUIPPED; } -#if 0 - const VolumeContainer *vol = ContainerInterface::getVolumeContainer(item); - if (vol && vol->getCurrentVolume() > 0) - { - errorCode = ar_NOT_EMPTY; - } - -#endif - if ((errorCode == ar_OK) && auctionContainer.isVendor() && !auctionContainer.isBazaarTerminal()) { // check to make sure the vendor isn't restricted from accepting this item @@ -1772,67 +1763,9 @@ void CommoditiesMarket::auctionCreateImmediate(CreatureObject &owner, ServerObje void CommoditiesMarket::auctionCreatePermanent(const std::string &, const ServerObject &, const ServerObject &, BidAmount , const Unicode::String &, bool ) { - if (!ConfigServerGame::getCommoditiesMarketEnabled()) - return; - DEBUG_WARNING(true, ("auctionCreatePermanent has been depricated and shouldn't be used. If you see this WARNING, add a line to catch cheaters in the command in CommandCppFuncs.cpp")); return; - -#if 0 //what the hell is this? - - const NetworkId & itemId = item.getNetworkId(); - int flags = AUCTION_ALWAYS_PRESENT; - if (premium) - { - flags |= AUCTION_PREMIUM_AUCTION; - } - const TangibleObject *tangibleObject = item.asTangibleObject(); - if (tangibleObject && tangibleObject->hasCondition(ServerTangibleObjectTemplate::C_magicItem)) - { - flags |= AUCTION_MAGIC_ITEM; - } - - const Unicode::String objectName = Auction::getItemAuctionName(&item); - - const AuctionToken & token = AuctionTokenServer::createTokenFor(item); - Unicode::String oobData; - OutOfBandPackager::pack(token, 0, oobData); - - ServerObject::AttributeVector attributes; - - //-- I don't know why this cast is necessary, but MSDEV is apparently confused otherwise - static_cast(item).getAttributes(NetworkId::cms_invalid, attributes); - OutOfBandPackager::pack(attributes, 1, oobData); - - OutOfBandPackager::pack(item.getTemplateName(), 2, oobData); - - if (s_market) - { - s_market->AddImmediateAuction( - -1, - ownerName, - price, - 1, - itemId, - objectName.size(), objectName.data(), - item.getGameObjectType(), - ConfigServerGame::getUnclaimedAuctionItemDestroyTimeSec(), - auctionContainer.getNetworkId(), - getLocationString(auctionContainer), - flags, - userDescription.size(), userDescription.data(), - oobData.size(), - oobData); - } - else - { - - DEBUG_WARNING(true, ("[Commodities API] : No commodities server connection to send AddImmediateAuction.")); - - getCommoditiesServerConnection(); //attempt to reconnect to commodities server - } -#endif } // ---------------------------------------------------------------------- diff --git a/engine/server/library/serverGame/src/shared/core/PreloadManager.cpp b/engine/server/library/serverGame/src/shared/core/PreloadManager.cpp index 799e45df..8e13e7ee 100755 --- a/engine/server/library/serverGame/src/shared/core/PreloadManager.cpp +++ b/engine/server/library/serverGame/src/shared/core/PreloadManager.cpp @@ -91,13 +91,6 @@ namespace PreloadManagerNameSpace if (tmp) line = tmp; - DataTable* dt = DataTableManager::getTable(line, true); -#if 0 - if (dt) - ms_dataTableList.push_back(dt); -#else - UNREF(dt); -#endif DEBUG_REPORT_LOG(true, (".")); line = fgets(buf, 256, fp); } diff --git a/engine/server/library/serverGame/src/shared/core/ServerBuildoutManager.cpp b/engine/server/library/serverGame/src/shared/core/ServerBuildoutManager.cpp index d83f034d..cf247722 100755 --- a/engine/server/library/serverGame/src/shared/core/ServerBuildoutManager.cpp +++ b/engine/server/library/serverGame/src/shared/core/ServerBuildoutManager.cpp @@ -549,16 +549,6 @@ void ServerBuildoutManagerNamespace::buildObjectsToSave(std::vectorgetObjectName() ).c_str(), - (int)obj->getNetworkId().getValue(), - obj->getCacheVersion(), - obj->isPersisted(), - obj->isPlayerControlled(), - obj->getIncludeInBuildout() ) ); -#endif - const ServerObject * const containingObject = safe_cast(ContainerInterface::getContainedByObject(*obj)); // make sure that cells that should be included in the buildout have all their @@ -750,12 +740,6 @@ void ServerBuildoutManagerNamespace::loadArea(AreaInfo &areaInfo) FATAL( isPob && ( cellIndex != 0 || containerId != 0 ), ( "tried to add a pob to a cell or other container. %s (objId=%d cellIndex=%d containerId=%d)", serverTemplateBase->getName(), objId, cellIndex,containerId ) ); -#if 0 - DEBUG_REPORT_LOG_PRINT( true, ( "SERVER --------- objId=%016I64x container=%016I64x\n", - objId, - containerId)); - -#endif Quaternion const q( areaBuildoutTable.getFloatValue(qwColumn, buildoutRow), diff --git a/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp b/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp index 3b76b5db..a3fb0233 100755 --- a/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp +++ b/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp @@ -2524,18 +2524,6 @@ void ServerWorld::remove() delete m_sceneId; m_sceneId = 0; -#if 0 //removed pending objects - ObjectMap::iterator objIter; - while (m_pendingObjects->size() > 0) - { - objIter = m_pendingObjects->begin(); - object = (*objIter).second; - m_pendingObjects->erase(objIter); - delete object; - } - delete m_pendingObjects; - m_pendingObjects = 0; -#endif delete g_objectSphereTree; g_objectSphereTree = 0; delete g_triggerSphereTree; diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp index 65cee1c4..ce7819b6 100755 --- a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp @@ -2821,12 +2821,6 @@ float CreatureObject::alter(float time) } //check timer and migrate stats if necessary - -//disable self stat migration -#if 0 - migrateStats(time); -#endif - if (isPlayerControlled()) { PROFILER_AUTO_BLOCK_DEFINE("CreatureObject::alter auth player stuff"); diff --git a/engine/server/library/serverGame/src/shared/object/GroupWaypointBuilder.cpp b/engine/server/library/serverGame/src/shared/object/GroupWaypointBuilder.cpp index df72f250..4f2e1f58 100755 --- a/engine/server/library/serverGame/src/shared/object/GroupWaypointBuilder.cpp +++ b/engine/server/library/serverGame/src/shared/object/GroupWaypointBuilder.cpp @@ -112,36 +112,12 @@ void GroupWaypointBuilderNamespace::updateGroupWaypoints(PlayerObject &playerObj void GroupWaypointBuilder::updateGroupWaypoints(GroupObject const &groupObject) { -#if 0 - PlayerObject::WaypointMap groupWaypoints; - buildGroupWaypoints(groupObject, groupWaypoints); - GroupWaypointBuilderNamespace::updateGroupWaypoints(groupObject, groupWaypoints); -#endif } // ---------------------------------------------------------------------- void GroupWaypointBuilder::updateGroupWaypoints(PlayerObject &playerObject, bool const updateGroup) { -#if 0 - CreatureObject const * const creatureObject = playerObject.getCreatureObject(); - if (creatureObject) - { - GroupObject const * const groupObject = creatureObject->getGroup(); - if (groupObject && updateGroup) - { - PlayerObject::WaypointMap groupWaypoints; - buildGroupWaypoints(*groupObject, groupWaypoints); - GroupWaypointBuilderNamespace::updateGroupWaypoints(*groupObject, groupWaypoints); - } - else - { - PlayerObject::WaypointMap groupWaypoints; - buildGroupWaypoints(playerObject, groupWaypoints); - GroupWaypointBuilderNamespace::updateGroupWaypoints(playerObject, groupWaypoints); - } - } -#endif } // ====================================================================== diff --git a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp index 19082342..c4903557 100755 --- a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp @@ -2411,13 +2411,6 @@ int ServerObject::getVolume(void) const { const VolumeContainmentProperty* volumeProperty = ContainerInterface::getVolumeContainmentProperty(*this); return volumeProperty ? volumeProperty->getVolume() : 1; -#if 0 - const VolumeContainer * container = ContainerInterface::getVolumeContainer(*this); - if (container) - return m_volume.get()+container->getCurrentVolume(); - else - return m_volume.get(); -#endif } //----------------------------------------------------------------------- diff --git a/engine/server/library/serverGame/src/shared/space/ShipClientUpdateTracker.cpp b/engine/server/library/serverGame/src/shared/space/ShipClientUpdateTracker.cpp index a21cbf33..cec5525b 100755 --- a/engine/server/library/serverGame/src/shared/space/ShipClientUpdateTracker.cpp +++ b/engine/server/library/serverGame/src/shared/space/ShipClientUpdateTracker.cpp @@ -268,20 +268,6 @@ void ShipClientUpdateTracker::update(float elapsedTime) // static static Archive::ByteStream bs; - #if 0 - GameClientMessage gcm( - (*k).second, - false, - ShipUpdateTransformMessage( - ship->getNetworkId(), - controller->getTransform(), - controller->getVelocity(), - controller->getYawRate(), - controller->getPitchRate(), - controller->getRollRate(), - (*j).first->getSyncStampLong())); - gcm.pack(bs); - #else static ConstCharCrcString const s_gcmname("GameClientMessage"); static ConstCharCrcString const s_sutmname("ShipUpdateTransformMessage"); static unsigned int const s_sutmByteStreamLength = @@ -313,7 +299,6 @@ void ShipClientUpdateTracker::update(float elapsedTime) // static PackedRotationRate const packedRollRate(controller->getRollRate()); Archive::put(bs, packedRollRate); Archive::put(bs, (*j).first->getSyncStampLong()); - #endif (*j).first->Connection::send(bs, false); bs.clear(); diff --git a/engine/server/library/serverGame/src/shared/trading/ServerSecureTrade.cpp b/engine/server/library/serverGame/src/shared/trading/ServerSecureTrade.cpp index c486c67f..32299369 100755 --- a/engine/server/library/serverGame/src/shared/trading/ServerSecureTrade.cpp +++ b/engine/server/library/serverGame/src/shared/trading/ServerSecureTrade.cpp @@ -733,63 +733,6 @@ void ServerSecureTrade::removeItem(const CreatureObject & trader, const ServerOb //-- CS requested that removing an item cancels the trade to prevent scamming UNREF (item); cancelTrade (trader); - -#if 0 - if (m_tradeState != TS_Trading) - { - DEBUG_REPORT_LOG(true, ("Secure Trade: received an remove item in non-trade state\n")); - beginTrading(); - } - - if (&trader == m_initiator) - { - std::vector::iterator i = std::find(m_initiatorContents->begin(), m_initiatorContents->end(), &item); - if (i != m_initiatorContents->end()) - { - m_initiatorContents->erase(i); - - Client * const recipientClient = m_recipient->getClient(); - if (recipientClient) - { - RemoveItemMessage const m(item.getNetworkId()); - recipientClient->send(m, true); - } - } - else - { - //@todo need an error message - } - - } - else if (& trader == m_recipient) - { - std::vector::iterator i = std::find(m_recipientContents->begin(), m_recipientContents->end(), &item); - if (i != m_recipientContents->end()) - { - m_recipientContents->erase(i); - - Client * const initiatorClient = m_initiator->getClient(); - if (initiatorClient) - { - RemoveItemMessage const m(item.getNetworkId()); - initiatorClient->send(m, true); - } - } - else - { - //@todo need an error message for not found. - } - - } - else - { - WARNING_STRICT_FATAL(true, ("Secure Trade: received a remove Item from non participant\n")); - return; - } - unacceptOffer(*m_initiator); - unacceptOffer(*m_recipient); -#endif - } // ---------------------------------------------------------------------- diff --git a/engine/server/library/serverKeyShare/src/shared/KeyServer.cpp b/engine/server/library/serverKeyShare/src/shared/KeyServer.cpp index a6124d8f..ab830063 100755 --- a/engine/server/library/serverKeyShare/src/shared/KeyServer.cpp +++ b/engine/server/library/serverKeyShare/src/shared/KeyServer.cpp @@ -42,23 +42,7 @@ KeyServer::~KeyServer() bool KeyServer::update(void) { - bool result = false; -#if 0 // disable key rotation - lastUpdateTime += Clock::frameTime(); - if(lastUpdateTime > updateRate) - { - lastUpdateTime = CONST_REAL(0.0); - KeyShare::Key k; - for(unsigned int j = 0; j < KeyShareConstants::keyLength; j ++) - { - k.value[j] = static_cast(randomNumberGenerator->random(255)); - } - pushKey(k); - result = true; - } -#endif // disable key rotation - - return result; + return false; } //----------------------------------------------------------------------- diff --git a/engine/server/library/serverScript/src/shared/JavaLibrary.cpp b/engine/server/library/serverScript/src/shared/JavaLibrary.cpp index b2932622..cc2bc006 100755 --- a/engine/server/library/serverScript/src/shared/JavaLibrary.cpp +++ b/engine/server/library/serverScript/src/shared/JavaLibrary.cpp @@ -4705,20 +4705,6 @@ int JavaLibrary::runScript(const NetworkId & caller, const std::string& script, } } break; -#if 0 - case 'S': - { - arg = globals.getNextStringId(); - if (arg == 0) - { - return SCRIPT_OVERRIDE; - } - // @todo: fix this when we get real string ids -// int param = atoi(stringArg); -// ms_env->SetIntField(arg, ms_fidStringIdData, static_cast(param)); - } - break; -#endif default: DEBUG_REPORT_LOG(true, ("unknown parameter type %c(%#x)\n", argList[i], static_cast(argList[i]))); //lint !e571 suspicious cast diff --git a/engine/server/library/serverScript/src/shared/ScriptMethodsChat.cpp b/engine/server/library/serverScript/src/shared/ScriptMethodsChat.cpp index 39fbf062..53992c20 100755 --- a/engine/server/library/serverScript/src/shared/ScriptMethodsChat.cpp +++ b/engine/server/library/serverScript/src/shared/ScriptMethodsChat.cpp @@ -181,29 +181,6 @@ jstring JNICALL ScriptMethodsChatNamespace::chatPackOutOfBandToken(JNIEnv * env, JavaString result("JavaLibrary::chatPackOutOfBandToken - FAILED Token archive not implemented"); return result.getReturnValue(); - -#if 0 - JavaStringParam jt(target); - Unicode::String t; - if(! JavaLibrary::convert(jt, t)) - return 0; - - if(! source) - return 0; - - Token * token = 0; - if(!JavaLibrary::getObject(source, token)) - return 0; - - Archive::ByteStream bs; - Archive::put(bs, std::string(token->getObjectTemplateName())); - Archive::put(bs, *token); - - OutOfBandPackager::pack(bs, gs_Object, position, t); - - JavaString result(t); - return result.getReturnValue(); -#endif } //---------------------------------------------------------------------- diff --git a/engine/shared/library/sharedCompression/src/shared/ZlibCompressor.cpp b/engine/shared/library/sharedCompression/src/shared/ZlibCompressor.cpp index 7f3aed3d..8a0515a8 100755 --- a/engine/shared/library/sharedCompression/src/shared/ZlibCompressor.cpp +++ b/engine/shared/library/sharedCompression/src/shared/ZlibCompressor.cpp @@ -43,9 +43,6 @@ voidpf ZlibCompressorNamespace::allocateWrapper(voidpf opaque, uInt items, uInt UNREF(opaque); void *result = 0; -#if 0 - result = operator new(items * size); -#else int totalSize = items * size; if (totalSize > cms_poolElementThreshold) { @@ -67,7 +64,6 @@ voidpf ZlibCompressorNamespace::allocateWrapper(voidpf opaque, uInt items, uInt ms_mutex.leave(); } -#endif return result; } @@ -78,9 +74,6 @@ void ZlibCompressorNamespace::freeWrapper(voidpf opaque, voidpf address) { UNREF(opaque); -#if 0 - operator delete(address); -#else if (address < ms_memoryBottom || address >= ms_memoryTop) operator delete(address); else @@ -89,7 +82,6 @@ void ZlibCompressorNamespace::freeWrapper(voidpf opaque, voidpf address) ms_memoryPool.push_back(address); ms_mutex.leave(); } -#endif } // ====================================================================== diff --git a/engine/shared/library/sharedDebug/src/linux/DebugMonitor.cpp b/engine/shared/library/sharedDebug/src/linux/DebugMonitor.cpp index 95dfef41..8f4f0682 100755 --- a/engine/shared/library/sharedDebug/src/linux/DebugMonitor.cpp +++ b/engine/shared/library/sharedDebug/src/linux/DebugMonitor.cpp @@ -417,10 +417,6 @@ void DebugMonitor::flushOutput() const int input = wgetch(s_outputWindow); if (input != ERR) { -#if 0 - DEBUG_REPORT_LOG(true, ("DebugMonitor: received key [index=%d].\n", input)); -#endif - //-- Handle input. switch (input) { diff --git a/engine/shared/library/sharedFile/src/shared/Iff.h b/engine/shared/library/sharedFile/src/shared/Iff.h index 1fe0660a..9fe54c7d 100755 --- a/engine/shared/library/sharedFile/src/shared/Iff.h +++ b/engine/shared/library/sharedFile/src/shared/Iff.h @@ -248,10 +248,6 @@ public: void read_string(Unicode::String &str); Unicode::String read_unicodeString(); - -#if 0 - real *read_float (int count, real *array=nullptr); -#endif }; // ---------------------------------------------------------------------- diff --git a/engine/shared/library/sharedFoundation/src/linux/FloatingPointUnit.cpp b/engine/shared/library/sharedFoundation/src/linux/FloatingPointUnit.cpp index 3ad0c949..4c8f48a1 100755 --- a/engine/shared/library/sharedFoundation/src/linux/FloatingPointUnit.cpp +++ b/engine/shared/library/sharedFoundation/src/linux/FloatingPointUnit.cpp @@ -115,26 +115,14 @@ void FloatingPointUnit::update(void) WORD FloatingPointUnit::getControlWord(void) { - //TODO wtf is this asm statement? -#if 0 - WORD controlWord = 0; - __asm fnstcw controlWord; - return controlWord; -#else return status; -#endif } // ---------------------------------------------------------------------- void FloatingPointUnit::setControlWord(WORD controlWord) { - //TODO see above? - UNREF(controlWord); -#if 0 - __asm fldcw controlWord; -#endif } // ---------------------------------------------------------------------- diff --git a/engine/shared/library/sharedFoundation/src/linux/Os.cpp b/engine/shared/library/sharedFoundation/src/linux/Os.cpp index b1e26987..fd3ee6c2 100755 --- a/engine/shared/library/sharedFoundation/src/linux/Os.cpp +++ b/engine/shared/library/sharedFoundation/src/linux/Os.cpp @@ -88,11 +88,6 @@ void Os::installCommon(void) ExitChain::add(Os::remove, "Os::remove", 0, true); -#if 0 //TODO For now we won't screw with the priority of the process - HANDLE threadHandle = GetCurrentThread(); - DEBUG_FATAL(!SetThreadPriority(threadHandle, THREAD_PRIORITY_ABOVE_NORMAL), ("Failed to set game thread priority")); -#endif - numberOfUpdates = 0; mainThreadId = pthread_self(); @@ -299,19 +294,6 @@ bool Os::update(void) ++numberOfUpdates; -#if 0 -#ifdef _DEBUG - - if (DEBUG_FLAG_PLATFORM(validateHeap)) - { - PROFILER_START("validate heap"); - MemoryManager::validate(); - PROFILER_STOP("validate heap"); - } - -#endif -#endif - Clock::update(); wasPaused = false; diff --git a/engine/shared/library/sharedFoundation/src/linux/PlatformGlue.cpp b/engine/shared/library/sharedFoundation/src/linux/PlatformGlue.cpp index 822a4ee5..97059d06 100755 --- a/engine/shared/library/sharedFoundation/src/linux/PlatformGlue.cpp +++ b/engine/shared/library/sharedFoundation/src/linux/PlatformGlue.cpp @@ -179,13 +179,6 @@ DWORD GetFileSize(FILE* hFile, DWORD* lpHighSize) endPos = ftell(hFile); fseek(hFile, curPos, SEEK_SET); return endPos; - -#if 0 -//This is what I want to do, but I have no file des number - struct stat buf; - fstat(hFile, &buf); - return buf->st_size; -#endif } BOOL FileExists(const char* filename) diff --git a/engine/shared/library/sharedFoundation/src/linux/SetupSharedFoundation.cpp b/engine/shared/library/sharedFoundation/src/linux/SetupSharedFoundation.cpp index 8a0b901e..08809fcc 100755 --- a/engine/shared/library/sharedFoundation/src/linux/SetupSharedFoundation.cpp +++ b/engine/shared/library/sharedFoundation/src/linux/SetupSharedFoundation.cpp @@ -44,12 +44,6 @@ void SetupSharedFoundation::install(const Data &data) if (data.argc) CommandLine::absorbStrings(const_cast(data.argv+1), data.argc-1); -#if 0 - //currently there's a problem that we cannot override the defaults here. - if (data.configFile) - IGNORE_RETURN(ConfigFile::loadFile(data.configFile)); -#endif - // get the post command-line text for the ConfigFile (key-value pairs) const char *configString = CommandLine::getPostCommandLineString(); if (configString) diff --git a/engine/shared/library/sharedFoundation/src/shared/Clock.cpp b/engine/shared/library/sharedFoundation/src/shared/Clock.cpp index 6851f8fb..8aa01785 100755 --- a/engine/shared/library/sharedFoundation/src/shared/Clock.cpp +++ b/engine/shared/library/sharedFoundation/src/shared/Clock.cpp @@ -254,24 +254,6 @@ void Clock::update(void) ms_lastFrameRate = RECIP(ms_lastFrameTime); } -#if 0 - // -qq- debugging W2K QueryPerformanceCounter - static DWORD lastTick; - DWORD newTick = GetTickCount(); - - DEBUG_REPORT_LOG_PRINT(true, ("Clock::update %I64d %I64d %6I64d %10d %10d %3d %6.2f=fps %6.4f=time\n", ms_lastPoll, newPoll, newPoll - ms_lastPoll, lastTick, newTick, newTick - lastTick, ms_lastFrameRate, ms_lastFrameTime)); - - static int bad = 0; - - if (bad && ++bad > 64) - __asm int 3; - - if (ms_lastFrameTime > 3.0) - bad = 1; - - lastTick = newTick; -#endif - ms_lastPoll = newPoll; diff --git a/engine/shared/library/sharedFoundation/src/shared/Crc.cpp b/engine/shared/library/sharedFoundation/src/shared/Crc.cpp index 28ef3514..8ae9cb51 100755 --- a/engine/shared/library/sharedFoundation/src/shared/Crc.cpp +++ b/engine/shared/library/sharedFoundation/src/shared/Crc.cpp @@ -78,25 +78,6 @@ uint32 Crc::calculate(const char *string) // ---------------------------------------------------------------------- -#if 0 - -uint32 Crc::calculateWithToLower(const char *string) -{ - uint32 crc; - - if (!string) - return 0; - - for (crc = CRC_INIT; *string; ++string) - crc = crctable[((crc>>24) ^ static_cast(tolower(*string))) & 0xFF] ^ (crc << 8); - - return (crc ^ CRC_INIT); -} - -#endif - -// ---------------------------------------------------------------------- - uint32 Crc::calculate(const void *data, int length, uint32 initCrc) { DEBUG_FATAL(!data, ("nullptr data arg")); diff --git a/engine/shared/library/sharedGame/src/shared/appearance/WearableAppearanceMap.cpp b/engine/shared/library/sharedGame/src/shared/appearance/WearableAppearanceMap.cpp index 5b7e478f..a0a22121 100755 --- a/engine/shared/library/sharedGame/src/shared/appearance/WearableAppearanceMap.cpp +++ b/engine/shared/library/sharedGame/src/shared/appearance/WearableAppearanceMap.cpp @@ -321,16 +321,6 @@ WearableAppearanceMap::MapResult::MapResult(MapResult const &rhs) : // ---------------------------------------------------------------------- -#if 0 - -WearableAppearanceMap::MapResult &WearableAppearanceMap::MapResult::operator =(MapResult const &rhs) -{ -} - -#endif - -// ---------------------------------------------------------------------- - bool WearableAppearanceMap::MapResult::hasMapping() const { return m_hasMapping; diff --git a/engine/shared/library/sharedGame/src/shared/quest/Quest.cpp b/engine/shared/library/sharedGame/src/shared/quest/Quest.cpp index 14d2fcab..50052b8a 100755 --- a/engine/shared/library/sharedGame/src/shared/quest/Quest.cpp +++ b/engine/shared/library/sharedGame/src/shared/quest/Quest.cpp @@ -485,15 +485,6 @@ int Quest::getMoneyRewardCredits() const // ---------------------------------------------------------------------- -#if 0 -std::vector const & Quest::getTasks() const -{ - return *m_tasks; -} -#endif - -// ---------------------------------------------------------------------- - /** * Conversts a comma-delimited list of strings into a vector or the CRCs * of those strings. diff --git a/engine/shared/library/sharedImage/src/shared/ImageManipulation.cpp b/engine/shared/library/sharedImage/src/shared/ImageManipulation.cpp index 4495b31e..5a71abc9 100755 --- a/engine/shared/library/sharedImage/src/shared/ImageManipulation.cpp +++ b/engine/shared/library/sharedImage/src/shared/ImageManipulation.cpp @@ -367,13 +367,6 @@ void ImageManipulation::install(const InstallData &installData) //-- make sure we've got valid function pointers for all NOT_NULL(ms_nextMipmapFunction); -#if 0 - NOT_NULL(ms_convertFormatFunction); - NOT_NULL(ms_copyIgnoreAlphaFunction); - NOT_NULL(ms_copyRespectAlphaFunction); - NOT_NULL(ms_blendFunction); - NOT_NULL(ms_blendTwoFunction); -#endif } // ---------------------------------------------------------------------- diff --git a/engine/shared/library/sharedImage/src/shared/ImageManipulation.h b/engine/shared/library/sharedImage/src/shared/ImageManipulation.h index 4a8d6bbd..f29ecbcf 100755 --- a/engine/shared/library/sharedImage/src/shared/ImageManipulation.h +++ b/engine/shared/library/sharedImage/src/shared/ImageManipulation.h @@ -55,20 +55,7 @@ public: static void install(const InstallData &installData); - static void generateNextSmallerMipmap(const Image &sourceImage, Image &destImage); - -#if 0 - static void convertFormatSameSize(const Image &sourceImage, Image &destImage); - - // these functions require same pixel format. they do not stretch or compress pixels. - static void copyIgnoreAlpha(const Image &sourceImage, int sourceX, int sourceY, int width, int height, Image &destImage, int destX, int destY); - static void copyRespectAlpha(const Image &sourceImage, int sourceX, int sourceY, int width, int height, Image &destImage, int destX, int destY); - - // these two always respect alpha - static void blend(float sourceBlendFactor, const Image &sourceImage, int sourceX, int sourceY, int width, int height, Image &destImage, int destX, int destY); - static void blendTwo(float firstSourceBlendFactor, float resultToDestBlendFactor, const Image &sourceImage1, const Image &sourceImage2, int sourceX, int sourceY, int width, int height, Image &destImage, int destX, int destY); -#endif - + static void generateNextSmallerMipmap(const Image &sourceImage, Image &destImage); private: static void remove(); diff --git a/engine/shared/library/sharedMath/src/shared/PaletteArgb.cpp b/engine/shared/library/sharedMath/src/shared/PaletteArgb.cpp index a1d12e7c..d91aa072 100755 --- a/engine/shared/library/sharedMath/src/shared/PaletteArgb.cpp +++ b/engine/shared/library/sharedMath/src/shared/PaletteArgb.cpp @@ -146,7 +146,7 @@ void PaletteArgb::release() const --m_referenceCount; //-- We are going to let the PaletteArgbList keep references to the palettes and clean them up at the end. -#if 0 +#if 0 //TODO: should we use the below or nuke it? if (m_referenceCount == 0) { PaletteArgbList::stopTracking(*this); diff --git a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_Directory.h b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_Directory.h index fabdd186..688b7324 100755 --- a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_Directory.h +++ b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_Directory.h @@ -41,11 +41,6 @@ public: virtual void deleteLinksTo(const CustomizationData &customizationData) = 0; virtual bool isLocalDirectory() const = 0; -#if 0 - virtual std::string writeLocalDirectoryToString() const = 0; - - virtual void loadLocalDirectoryFromString(int version, const std::string &string, int startIndex) = 0; -#endif CustomizationData &getOwner(); const CustomizationData &getOwner() const; diff --git a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_LocalDirectory.cpp b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_LocalDirectory.cpp index 1a12a2fd..b631344f 100755 --- a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_LocalDirectory.cpp +++ b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_LocalDirectory.cpp @@ -395,231 +395,4 @@ bool CustomizationData::LocalDirectory::isLocalDirectory() const return true; } -// ---------------------------------------------------------------------- - -#if 0 - -std::string CustomizationData::LocalDirectory::writeLocalDirectoryToString() const -{ - char scratchBuffer[1024]; - std::string data; - - //-- count # persistable variables - int variableCount = 0; - - { - const CustomizationVariableMap::const_iterator endIt = m_variables.end(); - for (CustomizationVariableMap::const_iterator it = m_variables.begin(); it != endIt; ++it) - { - //-- verify it's a non-nullptr variable - const CustomizationVariable *const variable = it->second; - if (variable && variable->doesVariablePersist()) - { - // we will write this variable - ++variableCount; - } - } - } - - //-- write # variables - sprintf(scratchBuffer, "%x%c", variableCount, cms_stringFieldSeparator); - data += scratchBuffer; - - //-- write each variable - { - const CustomizationVariableMap::const_iterator endIt = m_variables.end(); - for (CustomizationVariableMap::const_iterator it = m_variables.begin(); it != endIt; ++it) - { - //-- verify it's a non-nullptr variable - const CustomizationVariable *const variable = it->second; - if (!variable) - { - WARNING(true, ("writeLocalDirectoryToString: nullptr variable for [%s], skipping variable writing.")); - continue; - } - - //-- skip variables that should not be written. typically this will be constant data - // that doesn't need to be customized or transmitted/persisted. - if (!variable->doesVariablePersist()) - continue; - - //-- write variable name - data += it->first.getString(); - data += cms_stringFieldSeparator; - - //-- write variable data - // get variable content data - const std::string variableContents = variable->writeToString(); - - // write content length (we do this so we can skip a variable if its not supported at load time) - sprintf(scratchBuffer, "%x%c", variableContents.size(), cms_stringFieldSeparator); - data += scratchBuffer; - - // write variable content - data += variableContents; - } - } - - //-- get # local directories to write - int directoryCount = 0; - { - const DirectoryMap::const_iterator endIt = m_directories.end(); - for (DirectoryMap::const_iterator it = m_directories.begin(); it != endIt; ++it) - { - if (it->second && it->second->isLocalDirectory()) - ++directoryCount; - } - } - - //-- write # directories - sprintf(scratchBuffer, "%x%c", directoryCount, cms_stringFieldSeparator); - data += scratchBuffer; - - //-- write directory contents - { - const DirectoryMap::const_iterator endIt = m_directories.end(); - for (DirectoryMap::const_iterator it = m_directories.begin(); it != endIt; ++it) - { - if (it->second && it->second->isLocalDirectory()) - { - // write directory name - data += it->first.getString(); - data += cms_stringFieldSeparator; - - // get directory data contents - const std::string subdirData = it->second->writeLocalDirectoryToString(); - - // write directory data size (we do this so we can skip a directory if its not supported at load time) - sprintf(scratchBuffer, "%x%c", subdirData.size(), cms_stringFieldSeparator); - data += scratchBuffer; - - // write directory contents - data += subdirData; - } - } - } - - return data; -} - -#endif - -// ---------------------------------------------------------------------- - -#if 0 - -void CustomizationData::LocalDirectory::loadLocalDirectoryFromString(int version, const std::string &string, int startIndex) -{ - if (version == 2) - loadLocalDirectoryFromString_0002(string, startIndex); - else - WARNING(true, ("loadLocalDirectoryFromString(): unsupported version [%d]", version)); -} - -#endif - -// ====================================================================== - -#if 0 - -void CustomizationData::LocalDirectory::loadLocalDirectoryFromString_0002(const std::string &data, int startIndex) -{ - int currentPosition = startIndex; - - //-- get # variables - const int variableCount = parseSeparatedHexInt(data, currentPosition, currentPosition); - if (currentPosition == static_cast(std::string::npos)) - { - WARNING(true, ("loadLocalDirectoryFromString_0002(): failed to load variable count, aborting load.")); - return; - } - - //-- load each variable - { - for (int i = 0; i < variableCount; ++i) - { - //-- load the variable name - const std::string variableName = parseSeparatedString(data, currentPosition, currentPosition); - if (currentPosition == static_cast(std::string::npos)) - { - WARNING(true, ("loadLocalDirectoryFromString_0002(): failed to load variable name, aborting load.")); - return; - } - - //-- load the # characters in the value data - const int valueCharacterCount = parseSeparatedHexInt(data, currentPosition, currentPosition); - if (currentPosition == static_cast(std::string::npos)) - { - WARNING(true, ("loadLocalDirectoryFromString_0002(): failed to load variable data size, aborting load.")); - return; - } - - //-- find the customization variable - CustomizationVariable *const variable = findVariable(variableName, 0); - if (!variable) - { - WARNING(true, ("loadLocalDirectoryFromString_0002(): variable [%s] does not exist to be restored.", variableName.c_str())); - return; - } - else - { - //-- load the data - if (!variable->loadFromString(2, std::string(data, static_cast(currentPosition), static_cast(valueCharacterCount)))) - WARNING(true, ("loadLocalDirectoryFromString_0002(): variable [%s] failed to load.", variableName.c_str())); - } - - //-- pass the variable data - currentPosition += valueCharacterCount; - } - } - - //-- get # subdirectories - const int directoryCount = parseSeparatedHexInt(data, currentPosition, currentPosition); - if (currentPosition == static_cast(std::string::npos)) - { - WARNING(true, ("loadLocalDirectoryFromString_0002(): failed to load directory count, aborting load.")); - return; - } - - //-- load each subdirectory - { - for (int i = 0; i < directoryCount; ++i) - { - //-- load the directory name - const std::string directoryName = parseSeparatedString(data, currentPosition, currentPosition); - if (currentPosition == static_cast(std::string::npos)) - { - WARNING(true, ("loadLocalDirectoryFromString_0002(): failed to load directory name, aborting load.")); - return; - } - - //-- load the # characters in the value data - const int directoryCharacterCount = parseSeparatedHexInt(data, currentPosition, currentPosition); - if (currentPosition == static_cast(std::string::npos)) - { - WARNING(true, ("loadLocalDirectoryFromString_0002(): failed to load directory data size, aborting load.")); - return; - } - - //-- find the customization variable - Directory *const directory = findDirectory(directoryName, 0); - if (!directory) - { - WARNING(true, ("loadLocalDirectoryFromString_0002(): object id=[%s], directory [%s] does not exist to be restored.", getOwner().getOwnerObject().getNetworkId().getValueString().c_str(), directoryName.c_str())); - return; - } - else - { - //-- load the data - directory->loadLocalDirectoryFromString(2, data, currentPosition); - } - - //-- pass the variable data - currentPosition += directoryCharacterCount; - } - } -} - -#endif - // ====================================================================== diff --git a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_LocalDirectory.h b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_LocalDirectory.h index a8fba11f..1fc5159a 100755 --- a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_LocalDirectory.h +++ b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_LocalDirectory.h @@ -49,11 +49,6 @@ public: virtual void deleteLinksTo(const CustomizationData &customizationData); virtual bool isLocalDirectory() const; -#if 0 - virtual std::string writeLocalDirectoryToString() const; - - virtual void loadLocalDirectoryFromString(int version, const std::string &string, int startIndex); -#endif private: @@ -61,11 +56,6 @@ private: typedef stdmap::fwd CustomizationVariableMap; private: - -#if 0 - void loadLocalDirectoryFromString_0002(const std::string &string, int startIndex); -#endif - // Disabled. LocalDirectory(); LocalDirectory(const LocalDirectory&); diff --git a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_RemoteDirectory.cpp b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_RemoteDirectory.cpp index d52cb830..7f906066 100755 --- a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_RemoteDirectory.cpp +++ b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_RemoteDirectory.cpp @@ -164,31 +164,4 @@ bool CustomizationData::RemoteDirectory::isLocalDirectory() const return false; } -// ---------------------------------------------------------------------- - -#if 0 - -std::string CustomizationData::RemoteDirectory::writeLocalDirectoryToString() const -{ - WARNING(true, ("writeLocalDirectoryToString(): operation makes no sense on RemoteDirectory instances.\n")); - return ""; -} - -#endif - -// ---------------------------------------------------------------------- - -#if 0 - -void CustomizationData::RemoteDirectory::loadLocalDirectoryFromString(int version, const std::string &string, int startIndex) -{ - UNREF(version); - UNREF(string); - UNREF(startIndex); - - WARNING(true, ("loadLocalDirectoryFromString(): operation makes no sense on RemoteDirectory instances.")); -} - -#endif - // ====================================================================== diff --git a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_RemoteDirectory.h b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_RemoteDirectory.h index e1d89ce7..a14c88c4 100755 --- a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_RemoteDirectory.h +++ b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData_RemoteDirectory.h @@ -47,11 +47,6 @@ public: virtual void deleteLinksTo(const CustomizationData &customizationData); virtual bool isLocalDirectory() const; -#if 0 - virtual std::string writeLocalDirectoryToString() const; - - virtual void loadLocalDirectoryFromString(int version, const std::string &string, int startIndex); -#endif private: diff --git a/engine/shared/library/sharedObject/src/shared/customization/RangedIntCustomizationVariable.cpp b/engine/shared/library/sharedObject/src/shared/customization/RangedIntCustomizationVariable.cpp index a9ef4255..2373dfb2 100755 --- a/engine/shared/library/sharedObject/src/shared/customization/RangedIntCustomizationVariable.cpp +++ b/engine/shared/library/sharedObject/src/shared/customization/RangedIntCustomizationVariable.cpp @@ -52,36 +52,6 @@ int RangedIntCustomizationVariable::getPersistedDataByteCount() const // ---------------------------------------------------------------------- -#if 0 - -std::string RangedIntCustomizationVariable::writeToString() const -{ - char buffer[64]; - sprintf(buffer, "%x", getValue()); - return std::string(buffer); -} - -#endif - -// ---------------------------------------------------------------------- - -#if 0 - -bool RangedIntCustomizationVariable::loadFromString(int version, const std::string &data) -{ - if (version == 2) - return loadFromString_0002(data); - else - { - WARNING(true, ("loadFromString(): version %d unsupported.\n", version)); - return false; - } -} - -#endif - -// ---------------------------------------------------------------------- - void RangedIntCustomizationVariable::saveToByteVector(ByteVector &data) const { int const byteCount = getPersistedDataByteCount(); @@ -179,29 +149,6 @@ RangedIntCustomizationVariable::RangedIntCustomizationVariable() // ====================================================================== -#if 0 - -bool RangedIntCustomizationVariable::loadFromString_0002(const std::string &data) -{ - int newValue; - - const int scanfResult = sscanf(data.c_str(), "%x", &newValue); - if (scanfResult != 1) - { - // failed - return false; - } - else - { - setValue(newValue); - return true; - } -} - -#endif - -//---------------------------------------------------------------------- - /** * This function computes the normalized value. * @return a number in [0.0,1.0] diff --git a/engine/shared/library/sharedObject/src/shared/customization/RangedIntCustomizationVariable.h b/engine/shared/library/sharedObject/src/shared/customization/RangedIntCustomizationVariable.h index 8c172383..76e0db26 100755 --- a/engine/shared/library/sharedObject/src/shared/customization/RangedIntCustomizationVariable.h +++ b/engine/shared/library/sharedObject/src/shared/customization/RangedIntCustomizationVariable.h @@ -46,10 +46,6 @@ protected: private: -#if 0 - bool loadFromString_0002(const std::string &data); -#endif - // disabled RangedIntCustomizationVariable(const RangedIntCustomizationVariable&); RangedIntCustomizationVariable &operator =(const RangedIntCustomizationVariable&); diff --git a/engine/shared/library/sharedObject/src/shared/object/Object.cpp b/engine/shared/library/sharedObject/src/shared/object/Object.cpp index 2cad0571..ce7e05cf 100755 --- a/engine/shared/library/sharedObject/src/shared/object/Object.cpp +++ b/engine/shared/library/sharedObject/src/shared/object/Object.cpp @@ -1390,10 +1390,6 @@ void Object::setParentCell(CellProperty *cellProperty) if (getParentCell() == cellProperty) return; -#if 0 - DEBUG_FATAL(isChildObject(), ("Object::setParentCell called on child object [id=%s template=%s] with parent object [id=%s template=%s]", getNetworkId().getValueString().c_str(), getObjectTemplateName(), m_attachedToObject->getNetworkId().getValueString().c_str(), m_attachedToObject->getObjectTemplateName())); -#endif - // if we were in another cell, detach us. This will leave out object in world space. if (!isInWorldCell()) detachFromObject(DF_world); diff --git a/engine/shared/library/sharedObject/src/shared/portal/CellProperty.cpp b/engine/shared/library/sharedObject/src/shared/portal/CellProperty.cpp index 95281e88..21d861bd 100755 --- a/engine/shared/library/sharedObject/src/shared/portal/CellProperty.cpp +++ b/engine/shared/library/sharedObject/src/shared/portal/CellProperty.cpp @@ -722,14 +722,6 @@ CellProperty *CellProperty::getDestinationCell(const Vector &startPosition, cons CellProperty *cellProperty = 0; closestPortalT = FLT_MAX; -#if 0 - if ((startPosition - endPosition).magnitude() > 2.0f) - { - static volatile int debug = 0; - ++debug; - } -#endif - const PortalObjectList::const_iterator iEnd = m_portalObjectList->end(); for (PortalObjectList::const_iterator i = m_portalObjectList->begin(); i != iEnd; ++i) { diff --git a/engine/shared/library/sharedObject/src/shared/portal/PortalProperty.cpp b/engine/shared/library/sharedObject/src/shared/portal/PortalProperty.cpp index 716b488a..4dce02ea 100755 --- a/engine/shared/library/sharedObject/src/shared/portal/PortalProperty.cpp +++ b/engine/shared/library/sharedObject/src/shared/portal/PortalProperty.cpp @@ -229,7 +229,7 @@ bool PortalProperty::serverEndBaselines(int serverObjectCrc, std::vector vmax.x || pos.z < vmin.z || pos.z > vmax.z) - { - DEBUG_WARNING (true, ("called getHeightAt for position not within chunk")); - return false; - } - // ------------------------------------------------ - - // ------------------------------------------------ - // get height pole and tile coordinate. - const Vector localPos = pos - vmin; - - const ProceduralTerrainAppearanceTemplate *proceduralTerrainAppearanceTemplate = getAppearanceTemplate(); - const float distanceBetweenPoles = proceduralTerrainAppearanceTemplate->getTileWidthInMeters() / 2.0f; - const int numberOfPolesPerChunk = proceduralTerrainAppearanceTemplate->getNumberOfTilesPerChunk() * 2; - - int poleX = int(floor(localPos.x / distanceBetweenPoles)); - if (poleX>=numberOfPolesPerChunk) - { - poleX=numberOfPolesPerChunk-1; - } - - int poleZ = int(floor(localPos.z / distanceBetweenPoles)); - if (poleZ>=numberOfPolesPerChunk) - { - poleZ=numberOfPolesPerChunk-1; - } - - const int tileX = poleX>>1; - const int tileZ = poleZ>>1; - // ------------------------------------------------ - - // ------------------------------------------------ - // if the tile at x,z is excluded, return failure. - - // DEBUG - { - int dbgTileX, dbgTileZ; - _findTileXz(pos, dbgTileX, dbgTileZ); - DEBUG_FATAL(dbgTileX!=tileX, ("")); - DEBUG_FATAL(dbgTileZ!=tileZ, ("")); - } - - if (isExcluded(tileX, tileZ)) - { - return false; - } - // ------------------------------------------------ - - - // ------------------------------------------------ - // construct vertical vector at x,z that goes - // from the highest point in the chunk to the - // lowest point in the chunk. - const Vector start(pos.x, vmax.y + 0.1f, pos.z); - const Vector end(pos.x, vmin.y - 0.1f, pos.z); - const Vector dir = end - start; - // ------------------------------------------------ - - //-- collide with the 8 polygons in the tile - bool found = false; - - CollisionInfo result; - result.setPoint (end); - - Vector intersection; - - const int numberOfTilesPerChunk = m_proceduralTerrainAppearance.getNumberOfTilesPerChunk(); - const int tileIndex = tileZ * numberOfTilesPerChunk + tileX; - const int triangleOffset = tileIndex * 8; - for (int tri = triangleOffset; tri < triangleOffset + 8; ++tri) - { - const Plane& plane = (*m_planeList) [tri]; - const Vector& normal = plane.getNormal (); - - if ( dir.dot(normal)<0.f // if triangle is facing upward - && plane.findIntersection(start, end, intersection) - ) - { - const int i0 = (*ms_indexList)[tri*3 + 0]; - const int i1 = (*ms_indexList)[tri*3 + 1]; - const int i2 = (*ms_indexList)[tri*3 + 2]; - - const Vector& v0 = (*m_vertexList)[i0]; - const Vector& v1 = (*m_vertexList)[i1]; - const Vector& v2 = (*m_vertexList)[i2]; - - DenormalizedLine2d const line01 (Vector2d (v0.x, v0.z), Vector2d (v1.x, v1.z)); - DenormalizedLine2d const line12 (Vector2d (v1.x, v1.z), Vector2d (v2.x, v2.z)); - DenormalizedLine2d const line20 (Vector2d (v2.x, v2.z), Vector2d (v0.x, v0.z)); - - if (line01.computeDistanceTo (Vector2d (start.x, start.z)) <= 0 && - line12.computeDistanceTo (Vector2d (start.x, start.z)) <= 0 && - line20.computeDistanceTo (Vector2d (start.x, start.z)) <= 0) - { - found = true; - - result.setPoint (intersection); - result.setNormal (normal); - } - } - } - - if (found) - { - if (height) - *height = result.getPoint ().y; - - if (normal) - *normal = result.getNormal (); - - return true; - } - - return false; -} -#endif //------------------------------------------------------------------- #define ALLOW_BACKFACING_COLLISION 0 diff --git a/engine/shared/library/sharedTerrain/src/shared/generator/CoordinateHash.cpp b/engine/shared/library/sharedTerrain/src/shared/generator/CoordinateHash.cpp index efd2f614..e6d8c6f5 100755 --- a/engine/shared/library/sharedTerrain/src/shared/generator/CoordinateHash.cpp +++ b/engine/shared/library/sharedTerrain/src/shared/generator/CoordinateHash.cpp @@ -209,25 +209,4 @@ float CoordinateHash::makeFloat(unsigned long hash) return returnValue; } -#if 0 -long CoordinateHash::hashTuple(float x, float z) -{ - const unsigned long ix = (*(unsigned long *)&x)^0x5a5a5a5a; - const unsigned long iz = (*(unsigned long *)&z)^0xa5a5a5a5; - const unsigned long hx = _hash1((ix>>8) | (ix<<24)); - const unsigned long hz = _hash1((iz>>16) | (iz<<16)); - const unsigned long hmix1 = hx^hz; - const unsigned long h = hmix1; - - /* - FastRandomGenerator rngx(hx); - FastRandomGenerator rngz(hz); - const long rnx = rngx.random(); - const long rnz = rngz.random(); - return rnx^rnz; - */ - - return h; -} -#endif //=================================================================== diff --git a/engine/shared/library/sharedThread/src/linux/Thread.cpp b/engine/shared/library/sharedThread/src/linux/Thread.cpp index 90de4e55..2db4ec46 100755 --- a/engine/shared/library/sharedThread/src/linux/Thread.cpp +++ b/engine/shared/library/sharedThread/src/linux/Thread.cpp @@ -142,18 +142,3 @@ void Thread::setPriority(ePriority priority) pthread_setschedparam(thread, policies[priority], &p); } -// Make sure the header-only files compile :) - -#if 0 - -#include "sharedSynchronization/CountingSemaphore.h" -#include "sharedSynchronization/BlockingPointer.h" -#include "sharedSynchronization/BlockingQueue.h" -#include "sharedSynchronization/WriteOnce.h" - -Mutex t; -BlockingQueue bqint(t, 0, 0); -BlockingPointer bpint(t, 0, 0); -WriteOnce woint; - -#endif diff --git a/engine/shared/library/sharedThread/src/shared/RunThread.cpp b/engine/shared/library/sharedThread/src/shared/RunThread.cpp index 3f5e0962..3b4f985d 100755 --- a/engine/shared/library/sharedThread/src/shared/RunThread.cpp +++ b/engine/shared/library/sharedThread/src/shared/RunThread.cpp @@ -19,26 +19,3 @@ FuncPtrThreadZero::Handle runNamedThread(const std::string &name, void (* func)( { return TypedThreadHandle (new FuncPtrThreadZero(name, func)); } - -#if 0 -// Testing stuff - -class testclass -{ -public: - void zeroArg() {} - void oneArg(testclass *) {} - void twoArg(testclass *, int) {} -}; - -testclass m; - -typedef MemberFunctionThreadZero::Handle AsyncTestMemberFunctionZero; -AsyncTestMemberFunctionZero temp = runThread(m, testclass::zeroArg); - -typedef MemberFunctionThreadOne::Handle AsyncTestMemberFunctionOne; -AsyncTestMemberFunctionOne temp2 = runThread(m, testclass::oneArg, &m); - -typedef MemberFunctionThreadTwo::Handle AsyncTestMemberFunctionTwo; -AsyncTestMemberFunctionTwo temp3 = runThread(m, testclass::twoArg, &m, 4); -#endif diff --git a/engine/shared/library/sharedUtility/src/shared/FileName.cpp b/engine/shared/library/sharedUtility/src/shared/FileName.cpp index 1e8936f4..82d68367 100755 --- a/engine/shared/library/sharedUtility/src/shared/FileName.cpp +++ b/engine/shared/library/sharedUtility/src/shared/FileName.cpp @@ -278,12 +278,3 @@ void FileName::stripSpecificPathAndExt (Path path, char* nameBuffer, int nameBuf } //------------------------------------------------------------------- - -#if 0 - - DEBUG_REPORT_LOG_PRINT (true, ("%s\n", FileName (FileName::P_none, "test"))); - DEBUG_REPORT_LOG_PRINT (true, ("%s\n", FileName (FileName::P_none, "test", "iff"))); - DEBUG_REPORT_LOG_PRINT (true, ("%s\n", FileName (FileName::P_sound, "test"))); - DEBUG_REPORT_LOG_PRINT (true, ("%s\n", FileName (FileName::P_sound, "test", "iff"))); - -#endif diff --git a/external/3rd/library/soePlatform/VChatAPI/projects/VChat/VChatAPI/CMakeLists.txt b/external/3rd/library/soePlatform/VChatAPI/projects/VChat/VChatAPI/CMakeLists.txt index 2887003c..7393c1e4 100644 --- a/external/3rd/library/soePlatform/VChatAPI/projects/VChat/VChatAPI/CMakeLists.txt +++ b/external/3rd/library/soePlatform/VChatAPI/projects/VChat/VChatAPI/CMakeLists.txt @@ -87,14 +87,10 @@ add_library(VChatAPI ../../../utils2.0/utils/TcpLibrary/TcpConnection.cpp ../../../utils2.0/utils/TcpLibrary/TcpConnection.h ../../../utils2.0/utils/TcpLibrary/TcpHandlers.h - ../../../utils2.0/utils/TcpLibrary/TcpListener.cpp - ../../../utils2.0/utils/TcpLibrary/TcpListener.h ../../../utils2.0/utils/TcpLibrary/TcpManager.cpp ../../../utils2.0/utils/TcpLibrary/TcpManager.h ../../../utils2.0/utils/UdpLibrary/UdpHandler.hpp ../../../utils2.0/utils/UdpLibrary/UdpLibrary.cpp ../../../utils2.0/utils/UdpLibrary/UdpLibrary.hpp - ../../../utils2.0/utils/UdpLibrary/UdpListener.cpp - ../../../utils2.0/utils/UdpLibrary/UdpListener.h ) diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/types.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/types.h index b0f24d83..ba396c51 100755 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/types.h +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/types.h @@ -9,23 +9,8 @@ #include #endif -#if 0 -# pragma warning (disable: 4251) - -# ifndef DECLSPEC -# if defined (IMPORT_DLL) -# define DECLSPEC __declspec(dllimport) -# elif defined (EXPORT_DLL) -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif -# endif -# define DECLIMPORT __declspec(dllimport) -#else -# define DECLSPEC -# define DECLIMPORT extern -#endif +#define DECLSPEC +#define DECLIMPORT extern #ifdef WIN32 # define FILENAME (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/TcpListener.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/TcpListener.cpp deleted file mode 100755 index 8ae72bac..00000000 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/TcpListener.cpp +++ /dev/null @@ -1,435 +0,0 @@ - -//This code is not used by anything intentionally -//The Connection class was getting mistakenly linked in -//instead of the SWG Connection class that is used for -//all of our connections. Removing the whole thing -//to prevent the issue from coming up again. -#if 0 - -#ifdef WIN32 -#pragma warning (disable: 4786) -#endif - -#include -#include "TcpConnection.h" -#include "TcpListener.h" - -#ifdef WIN32 -#define snprintf _snprintf -#endif - -#ifdef EXTERNAL_DISTRO -namespace NAMESPACE -{ -#endif - -//////////////////////////////////////////////////////////////////////////////// - -Listener::QueueNode::QueueNode() : - connection(0), - request(0) -{ -} - -Listener::QueueNode::QueueNode(Connection * con, RequestBase * req) : - connection(con), - request(req) -{ -} - -Listener::Listener() : - mParams(), - mTcpManager(0), - mConnections(), - mConnectionCount(0), - mClosedConnections(), - mQueuedRequests(), - mActiveRequests(), - mActiveCount(0), - mActiveMax(0), - mAcceptingNewConnections(true) -{ - //printf("ctor 0x%x Listener\n",this); -} - -Listener::~Listener() -{ - std::set::iterator iterator; - for (iterator = mConnections.begin(); iterator != mConnections.end(); iterator++) - { - Connection * connection = *iterator; - delete connection; - } - mConnections.clear(); - - if (mTcpManager != 0) - { - mTcpManager->Release(); - mTcpManager = 0; - } - - //printf("dtor 0x%x Listener\n",this); -} - -void Listener::RequestSleep(RequestBase * request) -{ - mSleepingRequests.insert(request); -} - -void Listener::RequestWake(RequestBase * request) -{ - if (mSleepingRequests.erase(request)) - { - QueueNode node(request->mConnection, request); - mActiveRequests.push_front(node); - } -} - -void Listener::OnConnectRequest(TcpConnection * connection) -{ - if (IsAcceptingNewConnections()) - { - Connection * connectionObject = new Connection(*this, connection); - - mConnections.insert(connectionObject); - mConnectionCount++; - - OnConnectionOpened(connectionObject); - } -} - -void Listener::QueueRequest(Connection * connection, RequestBase * request) -{ - if (connection) - { - // normal request, internal requests have no connection - connection->NotifyQueuedRequest(request); - } - mQueuedRequests.push_back(QueueNode(connection,request)); -} - -bool Listener::IsIdle() const -{ - return (!IsActive() && !mTcpManager && mQueuedRequests.empty() && !mActiveCount); -} - -bool Listener::IsAcceptingNewConnections() const -{ - return (IsActive() && mAcceptingNewConnections); -} - -unsigned Listener::Process() -{ - //Profile profile("Listener::Process"); - //////////////////////////////////////// - // handle inactive state (with UdpManager) - if (!IsActive() && mTcpManager) - { - // check all connections to see if they are idle - std::set::iterator iterator; - for (iterator = mConnections.begin(); iterator != mConnections.end(); iterator++) - { - Connection * connection = *iterator; - if (connection->IsConnected()) - connection->Disconnect(); - } - // close the UdpManager if all the connections are closed - if (!mConnectionCount) - { - mTcpManager->Release(); - mTcpManager = 0; - OnShutdown(); - } - } - //////////////////////////////////////// - // handle active state (without UdpManager) - else if (IsActive() && !mTcpManager) - { - mParams = GetConnectionParams(); - mActiveMax = GetActiveRequestMax(); - mTcpManager = new TcpManager(mParams); - mTcpManager->SetHandler(this); - if (mTcpManager->BindAsServer()){ - OnStartup(); - }else{ - OnFailedStartup(); - return 0; - } - } - - //////////////////////////////////////// - // process the TcpManager - if (mTcpManager) - { - //Profile subProfile("TcpManager::GiveTime()"); - mTcpManager->GiveTime(); - } - - // check all closed connections to see if they are idle - std::list::iterator closedIterator = mClosedConnections.begin(); - while (closedIterator != mClosedConnections.end()) - { - //Profile profile("Listener::Process (cleanup connection)"); - std::list::iterator current = closedIterator++; - Connection * connection = *current; - if (!connection->GetActiveRequests() && - !connection->GetQueuedRequests()) - { - mClosedConnections.erase(current); - mConnections.erase(connection); - mConnectionCount--; - OnConnectionDestroyed(connection); - delete connection; - } - } - - //////////////////////////////////////// - // process request queue - while (!mQueuedRequests.empty() && (!mActiveMax || mActiveCount < mActiveMax)) - { - //Profile profile("Listener::Process (activate queued request)"); - QueueNode & node = mQueuedRequests.front(); - if (!IsActive()) - { - // If not active, discard queued request - if (node.connection) - { - // normal request, internal requests have no connection - node.connection->NotifyDiscardRequest(node.request); - } - DestroyRequest(node.request); - } - else - { - // Move request to active list - if (node.connection) - { - // normal request, internal requests have no connection - node.connection->NotifyBeginRequest(node.request); - } - mActiveRequests.push_back(node); - mActiveCount++; - } - mQueuedRequests.pop_front(); - } - - //////////////////////////////////////// - // Process active requests - unsigned requestsProcessed = 0; - std::list::iterator iterator = mActiveRequests.begin(); - while (iterator != mActiveRequests.end()) - { - //Profile profile("Listener::Process (process request)"); - std::list::iterator current = iterator++; - RequestBase * request = current->request; - Connection * connection = current->connection; - - if (request->Process()) - { - if (connection) - { - // normal request, internal requests have no connection - connection->NotifyEndRequest(request); - } - DestroyRequest(request); - mActiveRequests.erase(current); - mActiveCount--; - } - else if (mSleepingRequests.find(request) != mSleepingRequests.end()) - { - mActiveRequests.erase(current); - } - requestsProcessed++; - } - return requestsProcessed; -} - -/* -void Listener::GetStats(UdpManagerStatistics & statsStruct) -{ - if (mTcpManager) - mTcpManager->GetStats(&statsStruct); -} - -void Listener::ResetStats() -{ - if (mTcpManager) - mTcpManager->ResetStats(); -} -*/ - -void Listener::OnStartup() -{ -} - -void Listener::OnShutdown() -{ -} - -void Listener::OnFailedStartup() -{ -} - -void Listener::OnConnectionOpened(Connection * connection) -{ -} - -void Listener::OnConnectionClosed(Connection * connection, const char * reason) -{ -} - -void Listener::OnConnectionDestroyed(Connection * connection) -{ -} - -void Listener::OnCrcReject(Connection *connection, const unsigned char * buffer, unsigned size) -{ -} - -/* -void Listener::OnPacketCorrupt(Connection *con, const unsigned char *data, int dataLen, UdpCorruptionReason reason) -{ -} -*/ - -//////////////////////////////////////////////////////////////////////////////// - - -Connection::Connection(Listener & listener, TcpConnection * connection) : - mListener(listener), - mConnection(connection), - mHost(), - mHostIp(0), - mDisconnectReason(0), - mQueuedRequests(0), - mActiveRequests(0) -{ - mConnection->AddRef(); - mConnection->SetHandler(this); - - char buffer[256]; - char addr[32]; - mHostIp = mConnection->GetDestinationIp().GetAddress(); - mConnection->GetDestinationIp().GetAddress(addr); - snprintf(buffer, sizeof(buffer), "%s:%u", addr, mConnection->GetDestinationPort()); - mHost = buffer; - - //printf("ctor 0x%x connection\n",this); -} - -Connection::~Connection() -{ - Disconnect(); - - //printf("dtor 0x%x connection\n",this); -} - -unsigned Connection::Send(const unsigned char * data, unsigned dataLen) -{ - if (mConnection) - { - mConnection->Send((const char*)data, dataLen); - return dataLen; - } - return 0; -} - -void Connection::Disconnect() -{ - if (mConnection) - OnTerminated(mConnection); -} - -bool Connection::IsConnected() const -{ - return mConnection != 0; -} - -const std::string & Connection::GetHost() const -{ - return mHost; -} - -const unsigned Connection::GetHostIP() const -{ - return mHostIp; -} - -unsigned Connection::GetQueuedRequests() const -{ - return mQueuedRequests; -} - -unsigned Connection::GetActiveRequests() const -{ - return mActiveRequests; -} - -void Connection::OnTerminated(TcpConnection *con) -{ - mConnection->SetHandler(0); - mConnection->Disconnect(); - //TcpConnection::DisconnectReason disconnectReason = mConnection->GetDisconnectReason(); - mConnection->Release(); - mConnection = 0; - mListener.mClosedConnections.push_back(this); - mListener.OnConnectionClosed(this, "Test"/*TcpConnection::DisconnectReasonText(disconnectReason)*/); -} - -void Connection::OnRoutePacket(TcpConnection *, const unsigned char * data, int dataLen) -{ - mListener.OnReceive(this, data, dataLen); -} - -void Connection::OnCrcReject(TcpConnection *, const unsigned char * data, int dataLen) -{ - mListener.OnCrcReject(this, data, dataLen); -} - -/* -void Connection::OnPacketCorrupt(TcpConnection *, const uchar *data, int dataLen, UdpCorruptionReason reason) -{ - mListener.OnPacketCorrupt(this, data, dataLen, reason); -} -*/ - -void Connection::NotifyQueuedRequest(RequestBase * request) -{ - mQueuedRequests++; -} - -void Connection::NotifyDiscardRequest(RequestBase * request) -{ - mQueuedRequests--; -} - -void Connection::NotifyBeginRequest(RequestBase * request) -{ - mQueuedRequests--; - mActiveRequests++; -} - -void Connection::NotifyEndRequest(RequestBase * request) -{ - mActiveRequests--; -} - - -//////////////////////////////////////////////////////////////////////////////// - - -RequestBase::RequestBase(Connection * connection, bool isInternal) : - mConnection(connection), - mProcessState(0), - mIsInternal(isInternal) -{ -} - -RequestBase::~RequestBase() -{ -} -#ifdef EXTERNAL_DISTRO -} -#endif - -#endif diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/TcpListener.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/TcpListener.h deleted file mode 100755 index 4b6a680d..00000000 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/TcpListener.h +++ /dev/null @@ -1,160 +0,0 @@ - -//This code is not used by anything intentionally -//The Connection class was getting mistakenly linked in -//instead of the SWG Connection class that is used for -//all of our connections. Removing the whole thing -//to prevent the issue from coming up again. -#if 0 - - -#ifndef TCP_LISTENER_H -#define TCP_LISTENER_H - -#include -#include -#include - -#include "TcpManager.h" - - -#ifdef EXTERNAL_DISTRO -namespace NAMESPACE -{ -#endif - -//////////////////////////////////////////////////////////////////////////////// - - class RequestBase; - class Connection; - class Listener : public TcpManagerHandler - { - friend class Connection; - struct QueueNode - { - QueueNode(); - QueueNode(Connection * connection, RequestBase * request); - bool operator<(const QueueNode & rhs) { return request < rhs.request; } - - Connection * connection; - RequestBase * request; - }; - - public: - Listener(); - virtual ~Listener(); - - void QueueRequest(Connection * connection, RequestBase * request); - bool IsIdle() const; - bool IsAcceptingNewConnections() const; - unsigned Process(); - void SetAcceptingNewConnections(bool value) { mAcceptingNewConnections = value; } - //void GetStats(TcpManagerStatistics & statsStruct); - //void ResetStats(); - - unsigned GetNumberQueuedRequests() { return (unsigned)mQueuedRequests.size(); } - - void RequestSleep(RequestBase * request); - void RequestWake(RequestBase * request); - - virtual bool IsActive() const = 0; - virtual unsigned GetActiveRequestMax() = 0; - virtual TcpManager::TcpParams GetConnectionParams() = 0; - - virtual void OnStartup(); - virtual void OnShutdown(); - virtual void OnFailedStartup(); - virtual void OnConnectionOpened(Connection * connection); - virtual void OnConnectionClosed(Connection * connection, const char * reason); - virtual void OnConnectionDestroyed(Connection * connection); - virtual void OnReceive(Connection * connection, const unsigned char * data, unsigned dataLen) = 0; - virtual void OnCrcReject(Connection *connection, const unsigned char * data, unsigned dataLen); - //virtual void OnPacketCorrupt(Connection *con, const unsigned char *data, int dataLen, TcpCorruptionReason reason); - virtual void DestroyRequest(RequestBase * request) = 0; - - virtual void OnConnectRequest(TcpConnection *con); - - protected: - TcpManager::TcpParams mParams; - TcpManager * mTcpManager; - - std::set mConnections; - unsigned mConnectionCount; - std::list mClosedConnections; - - std::list mQueuedRequests; - std::list mActiveRequests; - std::set mSleepingRequests; - unsigned mActiveCount; - unsigned mActiveMax; - bool mAcceptingNewConnections; - }; - -//////////////////////////////////////////////////////////////////////////////// - - class Connection : public TcpConnectionHandler - { - friend class Listener; - public: - Connection(Listener & listener, TcpConnection * connection); - virtual ~Connection(); - - unsigned Send(const unsigned char * data, unsigned dataLen); - void Disconnect(); - bool IsConnected() const; - - const std::string & GetHost() const; - const unsigned GetHostIP() const; - unsigned GetQueuedRequests() const; - unsigned GetActiveRequests() const; - - virtual void OnTerminated(TcpConnection *con); - virtual void OnConnectRequest(TcpConnection *con) {}; - virtual void OnRoutePacket(TcpConnection *con, const unsigned char *data, int dataLen); - virtual void OnCrcReject(TcpConnection *con, const unsigned char *data, int dataLen); - //virtual void OnPacketCorrupt(TcpConnection *con, const unsigned char *data, int dataLen, TcpCorruptionReason reason); - - protected: - void NotifyQueuedRequest(RequestBase * request); - void NotifyDiscardRequest(RequestBase * request); - void NotifyBeginRequest(RequestBase * request); - void NotifyEndRequest(RequestBase * request); - - protected: - Listener & mListener; - TcpConnection * mConnection; - std::string mHost; - unsigned mHostIp; - const char * mDisconnectReason; - unsigned mQueuedRequests; - unsigned mActiveRequests; - }; - -//////////////////////////////////////////////////////////////////////////////// - - class RequestBase - { - friend class Listener; - public: - RequestBase(Connection * connection, bool isInternal=false); - virtual ~RequestBase(); - - virtual bool Process() = 0; - - Connection * GetConnection() const { return mConnection; } - unsigned GetState() const { return mProcessState; } - - protected: - Connection * mConnection; - unsigned mProcessState; - bool mIsInternal; - }; - -//////////////////////////////////////////////////////////////////////////////// - -#ifdef EXTERNAL_DISTRO -} -#endif - -#endif - -#endif diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/UdpLibrary/UdpListener.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/UdpLibrary/UdpListener.cpp deleted file mode 100755 index 5b52d6b6..00000000 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/UdpLibrary/UdpListener.cpp +++ /dev/null @@ -1,394 +0,0 @@ -//This code is not used by anything intentionally -//The Connection class was getting mistakenly linked in -//instead of the SWG Connection class that is used for -//all of our connections. Removing the whole thing -//to prevent the issue from coming up again. -#if 0 - -#ifdef WIN32 -#pragma warning (disable: 4786) -#endif - -#include "Base/timer.h" -#include "UdpListener.h" -#include "Base/profile.h" - - -#ifdef WIN32 -#define snprintf _snprintf -#endif - - -namespace UdpLibrary -{ - //////////////////////////////////////////////////////////////////////////////// - - - Listener::QueueNode::QueueNode() : - connection(0), - request(0) - { - } - - Listener::QueueNode::QueueNode(Connection * con, RequestBase * req) : - connection(con), - request(req) - { - } - - Listener::Listener() : - mParams(), - mUdpManager(0), - mConnections(), - mConnectionCount(0), - mClosedConnections(), - mQueuedRequests(), - mActiveRequests(), - mActiveCount(0), - mActiveMax(0) - { - //printf("ctor 0x%x Listener\n",this); - } - - Listener::~Listener() - { - std::set::iterator iterator; - for (iterator = mConnections.begin(); iterator != mConnections.end(); iterator++) - { - Connection * connection = *iterator; - delete connection; - } - mConnections.clear(); - - if (mUdpManager != 0) - { - mUdpManager->Release(); - mUdpManager = 0; - } - - //printf("dtor 0x%x Listener\n",this); - } - - void Listener::RequestSleep(RequestBase * request) - { - mSleepingRequests.insert(request); - } - - void Listener::RequestWake(RequestBase * request) - { - if (mSleepingRequests.erase(request)) - { - QueueNode node(request->mConnection, request); - mActiveRequests.push_front(node); - } - } - - void Listener::OnConnectRequest(UdpConnection * connection) - { - if (IsActive()) - { - Connection * connectionObject = new Connection(*this, connection); - - mConnections.insert(connectionObject); - mConnectionCount++; - - OnConnectionOpened(connectionObject); - } - } - - void Listener::QueueRequest(Connection * connection, RequestBase * request) - { - connection->NotifyQueuedRequest(request); - mQueuedRequests.push_back(QueueNode(connection,request)); - } - - bool Listener::IsIdle() const - { - return (!IsActive() && !mUdpManager && mQueuedRequests.empty() && !mActiveCount); - } - - unsigned Listener::Process() - { - Profile profile("Listener::Process"); - //////////////////////////////////////// - // handle inactive state (with UdpManager) - if (!IsActive() && mUdpManager) - { - // check all connections to see if they are idle - std::set::iterator iterator; - for (iterator = mConnections.begin(); iterator != mConnections.end(); iterator++) - { - Connection * connection = *iterator; - if (connection->IsConnected()) - connection->Disconnect(); - } - // close the UdpManager if all the connections are closed - if (!mConnectionCount) - { - mUdpManager->Release(); - mUdpManager = 0; - OnShutdown(); - } - } - //////////////////////////////////////// - // handle active state (without UdpManager) - else if (IsActive() && !mUdpManager) - { - mParams = GetConnectionParams(); - mParams.handler = this; - mActiveMax = GetActiveRequestMax(); - mUdpManager = new UdpManager(&mParams); - OnStartup(); - } - - //////////////////////////////////////// - // process the UdpManager - if (mUdpManager) - { - Profile subProfile("UdpManager::GiveTime()"); - mUdpManager->GiveTime(); - } - - // check all closed connections to see if they are idle - std::list::iterator closedIterator = mClosedConnections.begin(); - while (closedIterator != mClosedConnections.end()) - { - Profile profile("Listener::Process (cleanup connection)"); - std::list::iterator current = closedIterator++; - Connection * connection = *current; - if (!connection->GetActiveRequests() && - !connection->GetQueuedRequests()) - { - mClosedConnections.erase(current); - mConnections.erase(connection); - mConnectionCount--; - OnConnectionDestroyed(connection); - delete connection; - } - } - - //////////////////////////////////////// - // process request queue - while (!mQueuedRequests.empty() && (!mActiveMax || mActiveCount < mActiveMax)) - { - Profile profile("Listener::Process (activate queued request)"); - QueueNode & node = mQueuedRequests.front(); - if (!IsActive()) - { - // If not active, discard queued request - node.connection->NotifyDiscardRequest(node.request); - DestroyRequest(node.request); - } - else - { - // Move request to active list - node.connection->NotifyBeginRequest(node.request); - mActiveRequests.push_back(node); - mActiveCount++; - } - mQueuedRequests.pop_front(); - } - - //////////////////////////////////////// - // Process active requests - unsigned requestsProcessed = 0; - std::list::iterator iterator = mActiveRequests.begin(); - while (iterator != mActiveRequests.end()) - { - Profile profile("Listener::Process (process request)"); - std::list::iterator current = iterator++; - RequestBase * request = current->request; - Connection * connection = current->connection; - - if (request->Process()) - { - connection->NotifyEndRequest(request); - DestroyRequest(request); - mActiveRequests.erase(current); - mActiveCount--; - } - else if (mSleepingRequests.find(request) != mSleepingRequests.end()) - { - mActiveRequests.erase(current); - } - requestsProcessed++; - } - return requestsProcessed; - } - - void Listener::GetStats(UdpManagerStatistics & statsStruct) - { - if (mUdpManager) - mUdpManager->GetStats(&statsStruct); - } - - void Listener::ResetStats() - { - if (mUdpManager) - mUdpManager->ResetStats(); - } - - void Listener::OnStartup() - { - } - - void Listener::OnShutdown() - { - } - - void Listener::OnConnectionOpened(Connection * connection) - { - } - - void Listener::OnConnectionClosed(Connection * connection, const char * reason) - { - } - - void Listener::OnConnectionDestroyed(Connection * connection) - { - } - - void Listener::OnCrcReject(Connection *connection, const unsigned char * buffer, unsigned size) - { - } - - void Listener::OnPacketCorrupt(Connection *con, const unsigned char *data, int dataLen, UdpCorruptionReason reason) - { - } - - //////////////////////////////////////////////////////////////////////////////// - - - Connection::Connection(Listener & listener, UdpConnection * connection) : - mListener(listener), - mConnection(connection), - mHost(), - mHostIp(0), - mDisconnectReason(0), - mQueuedRequests(0), - mActiveRequests(0) - { - mConnection->AddRef(); - mConnection->SetHandler(this); - - char buffer[256]; - char addr[32]; - mHostIp = mConnection->GetDestinationIp().GetAddress(); - mConnection->GetDestinationIp().GetAddress(addr); - snprintf(buffer, sizeof(buffer), "%s:%u", addr, mConnection->GetDestinationPort()); - mHost = buffer; - - //printf("ctor 0x%x connection\n",this); - } - - Connection::~Connection() - { - Disconnect(); - - //printf("dtor 0x%x connection\n",this); - } - - unsigned Connection::Send(const unsigned char * data, unsigned dataLen) - { - if (mConnection) - { - mConnection->Send(cUdpChannelReliable1, data, dataLen); - return dataLen; - } - return 0; - } - - void Connection::Disconnect() - { - if (mConnection) - OnTerminated(mConnection); - } - - bool Connection::IsConnected() const - { - return mConnection != 0; - } - - const std::string & Connection::GetHost() const - { - return mHost; - } - - const unsigned Connection::GetHostIP() const - { - return mHostIp; - } - - unsigned Connection::GetQueuedRequests() const - { - return mQueuedRequests; - } - - unsigned Connection::GetActiveRequests() const - { - return mActiveRequests; - } - - void Connection::OnTerminated(UdpConnection *con) - { - mConnection->SetHandler(0); - mConnection->Disconnect(); - UdpConnection::DisconnectReason disconnectReason = mConnection->GetDisconnectReason(); - mConnection->Release(); - mConnection = 0; - mListener.mClosedConnections.push_back(this); - mListener.OnConnectionClosed(this, UdpConnection::DisconnectReasonText(disconnectReason)); - } - - void Connection::OnRoutePacket(UdpConnection *, const unsigned char * data, int dataLen) - { - mListener.OnReceive(this, data, dataLen); - } - - void Connection::OnCrcReject(UdpConnection *, const unsigned char * data, int dataLen) - { - mListener.OnCrcReject(this, data, dataLen); - } - - void Connection::OnPacketCorrupt(UdpConnection *, const uchar *data, int dataLen, UdpCorruptionReason reason) - { - mListener.OnPacketCorrupt(this, data, dataLen, reason); - } - - void Connection::NotifyQueuedRequest(RequestBase * request) - { - mQueuedRequests++; - } - - void Connection::NotifyDiscardRequest(RequestBase * request) - { - mQueuedRequests--; - } - - void Connection::NotifyBeginRequest(RequestBase * request) - { - mQueuedRequests--; - mActiveRequests++; - } - - void Connection::NotifyEndRequest(RequestBase * request) - { - mActiveRequests--; - } - - - //////////////////////////////////////////////////////////////////////////////// - - - RequestBase::RequestBase(Connection * connection) : - mConnection(connection), - mProcessState(0) - { - } - - RequestBase::~RequestBase() - { - } -} - -#endif diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/UdpLibrary/UdpListener.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/UdpLibrary/UdpListener.h deleted file mode 100755 index 678b12f0..00000000 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/UdpLibrary/UdpListener.h +++ /dev/null @@ -1,145 +0,0 @@ -//This code is not used by anything intentionally -//The Connection class was getting mistakenly linked in -//instead of the SWG Connection class that is used for -//all of our connections. Removing the whole thing -//to prevent the issue from coming up again. -#if 0 - -#ifndef COMMON_SERVER__LISTENER_H -#define COMMON_SERVER__LISTENER_H - -#include -#include -#include -#include "UdpLibrary.hpp" - -namespace UdpLibrary -{ - //////////////////////////////////////////////////////////////////////////////// - - class RequestBase; - class Connection; - class Listener : public UdpManagerHandler - { - friend class Connection; - struct QueueNode - { - QueueNode(); - QueueNode(Connection * connection, RequestBase * request); - bool operator<(const QueueNode & rhs) { return request < rhs.request; } - - Connection * connection; - RequestBase * request; - }; - - public: - Listener(); - virtual ~Listener(); - - void QueueRequest(Connection * connection, RequestBase * request); - bool IsIdle() const; - unsigned Process(); - void GetStats(UdpManagerStatistics & statsStruct); - void ResetStats(); - - void RequestSleep(RequestBase * request); - void RequestWake(RequestBase * request); - - virtual bool IsActive() const = 0; - virtual unsigned GetActiveRequestMax() = 0; - virtual UdpManager::Params GetConnectionParams() = 0; - - virtual void OnStartup(); - virtual void OnShutdown(); - virtual void OnConnectionOpened(Connection * connection); - virtual void OnConnectionClosed(Connection * connection, const char * reason); - virtual void OnConnectionDestroyed(Connection * connection); - virtual void OnReceive(Connection * connection, const unsigned char * data, unsigned dataLen) = 0; - virtual void OnCrcReject(Connection *connection, const unsigned char * data, unsigned dataLen); - virtual void OnPacketCorrupt(Connection *con, const unsigned char *data, int dataLen, UdpCorruptionReason reason); - virtual void DestroyRequest(RequestBase * request) = 0; - - virtual void OnConnectRequest(UdpConnection *con); - - protected: - UdpManager::Params mParams; - UdpManager * mUdpManager; - - std::set mConnections; - unsigned mConnectionCount; - std::list mClosedConnections; - - std::list mQueuedRequests; - std::list mActiveRequests; - std::set mSleepingRequests; - unsigned mActiveCount; - unsigned mActiveMax; - }; - - - //////////////////////////////////////////////////////////////////////////////// - - - class Connection : public UdpConnectionHandler - { - friend class Listener; - public: - Connection(Listener & listener, UdpConnection * connection); - virtual ~Connection(); - - unsigned Send(const uchar * data, unsigned dataLen); - void Disconnect(); - bool IsConnected() const; - - const std::string & GetHost() const; - const unsigned GetHostIP() const; - unsigned GetQueuedRequests() const; - unsigned GetActiveRequests() const; - - virtual void OnTerminated(UdpConnection *con); - virtual void OnRoutePacket(UdpConnection *con, const uchar *data, int dataLen); - virtual void OnCrcReject(UdpConnection *con, const uchar *data, int dataLen); - virtual void OnPacketCorrupt(UdpConnection *con, const uchar *data, int dataLen, UdpCorruptionReason reason); - - protected: - void NotifyQueuedRequest(RequestBase * request); - void NotifyDiscardRequest(RequestBase * request); - void NotifyBeginRequest(RequestBase * request); - void NotifyEndRequest(RequestBase * request); - - protected: - Listener & mListener; - UdpConnection * mConnection; - std::string mHost; - unsigned mHostIp; - const char * mDisconnectReason; - unsigned mQueuedRequests; - unsigned mActiveRequests; - }; - - - //////////////////////////////////////////////////////////////////////////////// - - - class RequestBase - { - friend class Listener; - public: - RequestBase(Connection * connection); - virtual ~RequestBase(); - - virtual bool Process() = 0; - - protected: - Connection * mConnection; - unsigned mProcessState; - }; - - - //////////////////////////////////////////////////////////////////////////////// -} - - -#endif - -#endif diff --git a/external/3rd/library/udplibrary/udpclient.cpp b/external/3rd/library/udplibrary/udpclient.cpp index 9ed52d3e..b66ed3a8 100755 --- a/external/3rd/library/udplibrary/udpclient.cpp +++ b/external/3rd/library/udplibrary/udpclient.cpp @@ -72,15 +72,6 @@ int main(int argc, char **argv) params.pooledPacketMax = 50; params.pooledPacketSize = 512; -#if 0 - params.simulateIncomingByteRate = 0; - params.simulateIncomingLossPercent = 10; - params.simulateOutgoingByteRate = 0; - params.simulateOutgoingLossPercent = 10; - params.simulateDestinationOverloadLevel = 0; - params.simulateOutgoingOverloadLevel = 0; -#endif - params.reliable[0].maxInstandingPackets = 500; params.reliable[0].maxOutstandingBytes = 200000; params.reliable[0].maxOutstandingPackets = 500; @@ -156,9 +147,7 @@ int main(int argc, char **argv) break; } - -#if 1 - // randomly send a medium sized packet on a random channel + // randomly send a medium sized packet on a random channel if (rand() % 200 == 0) { char buf[8000]; @@ -176,54 +165,6 @@ int main(int argc, char **argv) myConnection->Send(cUdpChannelReliable1, buf, len); } } -#elif 0 - // send a very large packet one after the other (don't send next packet til the previous one has made it) - if (myConnection->TotalPendingBytes() == 0) - { - // send another packet - SimpleLogicalPacket *lp = new SimpleLogicalPacket(nullptr, 30000000); - int dlen = lp->GetDataLen(); - char *ptr = (char *)lp->GetDataPtr(); - - ptr[0] = (char)(rand() % 50); - for (int i = 1; i < dlen; i++) - { - ptr[i] = (char)(i % 100); - } - - printf("OUT LEN=%d \n", dlen); - myConnection->Send(cUdpChannelReliable1, lp); - lp->Release(); - } -#else - // prepare a random sized group of medium packets and then send the group, don't prepare next group until previous one has made it - UdpConnection::ChannelStatus cs; - myConnection->GetChannelStatus(cUdpChannelReliable1, &cs); - if (cs.queuedBytes == 0) - { - int count = 0; - GroupLogicalPacket *glp = new GroupLogicalPacket(); - int di = rand() % 20 + 1; - for (int i = 0; i < di; i++) - { - GroupLogicalPacket *sub = new GroupLogicalPacket(); - for (int j = 0; j < di; j++) - { - char buf[8000]; - *(ushort *)buf = count; - int len = (rand() % 1000) + 10; - *(ushort *)(buf + len - 2) = count; - sub->AddPacket(buf, len); - count++; - } - glp->AddPacket(sub); - sub->Release(); - } - myConnection->Send(cUdpChannelReliable1, glp); - glp->Release(); - printf("Group of %d packets sent\n", count); - } -#endif myUdpManager->GiveTime(); Sleep(10); diff --git a/external/3rd/library/udplibrary/udpserver.cpp b/external/3rd/library/udplibrary/udpserver.cpp index c8641671..65f844ec 100755 --- a/external/3rd/library/udplibrary/udpserver.cpp +++ b/external/3rd/library/udplibrary/udpserver.cpp @@ -97,14 +97,6 @@ int main(int argc, char **argv) params.pooledPacketMax = 5000; params.pooledPacketSize = 512; -#if 0 - params.simulateIncomingByteRate = 2000; - params.simulateIncomingLossPercent = 0; - params.simulateOutgoingByteRate = 2000; - params.simulateOutgoingLossPercent = 0; - params.simulateDestinationOverloadLevel = 8000; - params.simulateOutgoingOverloadLevel = 8000; -#endif params.reliable[0].maxInstandingPackets = 500; params.reliable[0].maxOutstandingBytes = 200000; params.reliable[0].maxOutstandingPackets = 500; @@ -197,11 +189,6 @@ void Player::OnRoutePacket(UdpConnection * /*con*/, const uchar *data, int dataL char hold[256]; printf("FROM=%s,%d LEN=%d \n", mConnection->GetDestinationIp().GetAddress(hold), mConnection->GetDestinationPort(), dataLen); - -#if 0 - // reflect exact packet back to client - mConnection->Send(cUdpChannelReliable1, data, dataLen); -#endif } diff --git a/game/server/application/SwgDatabaseServer/src/CMakeLists.txt b/game/server/application/SwgDatabaseServer/src/CMakeLists.txt index 4746ea61..b1277e1d 100644 --- a/game/server/application/SwgDatabaseServer/src/CMakeLists.txt +++ b/game/server/application/SwgDatabaseServer/src/CMakeLists.txt @@ -12,7 +12,6 @@ set(SHARED_SOURCES shared/buffers/ExperienceBuffer.h shared/buffers/IndexedNetworkTableBuffer.cpp shared/buffers/IndexedNetworkTableBuffer.h - shared/buffers/IndexedTableBuffer.h shared/buffers/LocationBuffer.cpp shared/buffers/LocationBuffer.h shared/buffers/ManufactureSchematicAttributeBuffer.cpp diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/IndexedTableBuffer.h b/game/server/application/SwgDatabaseServer/src/shared/buffers/IndexedTableBuffer.h deleted file mode 100755 index bf2fc1d6..00000000 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/IndexedTableBuffer.h +++ /dev/null @@ -1,54 +0,0 @@ -#if 0 //@todo code reorg -// ====================================================================== -// -// IndexedNetworkTableBuffer.h -// copyright (c) 2001 Sony Online Entertainment -// -// ====================================================================== - -#ifndef INCLUDED_IndexedNetworkTableBuffer_H -#define INCLUDED_IndexedNetworkTableBuffer_H - -// ====================================================================== - -#include -#include "serverDatabase/TableBuffer.h" - -// ====================================================================== - -/** - * Adds to NetworkTableBuffer the ability to retrieve rows based on an - * integer index. - * @todo Remove "Network" from the name because it no longer has anything to - * do with the network. - * @todo If we have time someday :) Play with the idea of making this be a - * class that's attached to a TableBuffer, much the same way a real DB index - * is attached to a table. The TableBuffer could have a list of pointers - * to indexes, and it would invoke addRow, etc., as needed. - */ - -class IndexedNetworkTableBuffer : public TableBuffer -{ - public: - void addRowToIndex(int indexValue, DB::Row *row); - DB::Row *findRowByIndex(int indexValue); - - protected: - IndexedNetworkTableBuffer(TableBufferMode mode, DB::ModeQuery *query); - - private: - typedef std::unordered_map IndexType; - /** - * Index to locate rows. - * - * Note that the rows are owned by the TableBuffer base class. This - * is just an index to find a specific row quickly. Therefore, this - * class does not create or delete the rows. - */ - IndexType m_index; -}; - -// ====================================================================== - -#endif -#endif