mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-09-11 21:44:58 -04:00
remove SOE deprecated code and files - leaving in the #if 0 blocks with TODO and other possible uses for later
This commit is contained in:
-5
@@ -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;
|
||||
|
||||
|
||||
-227
@@ -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<int>(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<int>(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<int>(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<std::string::size_type>(currentPosition), static_cast<std::string::size_type>(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<int>(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<int>(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<int>(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
|
||||
|
||||
// ======================================================================
|
||||
|
||||
-10
@@ -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<const CrcLowerString, CustomizationVariable*>::fwd CustomizationVariableMap;
|
||||
|
||||
private:
|
||||
|
||||
#if 0
|
||||
void loadLocalDirectoryFromString_0002(const std::string &string, int startIndex);
|
||||
#endif
|
||||
|
||||
// Disabled.
|
||||
LocalDirectory();
|
||||
LocalDirectory(const LocalDirectory&);
|
||||
|
||||
-27
@@ -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
|
||||
|
||||
// ======================================================================
|
||||
|
||||
-5
@@ -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:
|
||||
|
||||
|
||||
-53
@@ -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]
|
||||
|
||||
-4
@@ -46,10 +46,6 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
#if 0
|
||||
bool loadFromString_0002(const std::string &data);
|
||||
#endif
|
||||
|
||||
// disabled
|
||||
RangedIntCustomizationVariable(const RangedIntCustomizationVariable&);
|
||||
RangedIntCustomizationVariable &operator =(const RangedIntCustomizationVariable&);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -229,7 +229,7 @@ bool PortalProperty::serverEndBaselines(int serverObjectCrc, std::vector<Object*
|
||||
//-- fixupObject() causes the fixedup object to get added to the world before its parent has been
|
||||
//-- for now, we won't queue anything for fixup
|
||||
|
||||
#if 0
|
||||
#if 0 //TODO: see above
|
||||
// go through the cells and remove objects
|
||||
for (size_t cell=1 ; cell< numberOfCells; ++cell)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user