mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-28 22:15:49 -04:00
hopefully this fixes some more...
This commit is contained in:
@@ -735,7 +735,6 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
else if (message.isType("RequestSameServer"))
|
||||
{
|
||||
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
GenericValueTypeMessage<std::pair<NetworkId, NetworkId> > msg(ri);
|
||||
|
||||
bool result=Scene::getInstance().requestSameServer(msg.getValue().first, msg.getValue().second);
|
||||
@@ -751,7 +750,6 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
else if (message.isType("RequestAuthTransfer"))
|
||||
{
|
||||
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
GenericValueTypeMessage<std::pair<NetworkId, uint32> > msg(ri);
|
||||
|
||||
bool result=Scene::getInstance().requestAuthTransfer(msg.getValue().first, msg.getValue().second);
|
||||
@@ -767,7 +765,6 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
else if (message.isType("GameServerForceChangeAuthorityMessage"))
|
||||
{
|
||||
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
GameServerForceChangeAuthorityMessage msg(ri);
|
||||
GameServerData * fromServer = PlanetServer::getGameServerData(msg.getFromProcess());
|
||||
GameServerData * toServer = PlanetServer::getGameServerData(msg.getToProcess());
|
||||
@@ -805,7 +802,6 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
else if (message.isType("FindAuthObjectResponse"))
|
||||
{
|
||||
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
GenericValueTypeMessage<std::pair<std::pair<NetworkId, unsigned int>, bool> > msg(ri);
|
||||
GameServerConnection const *gameServer = dynamic_cast<const GameServerConnection*>(&source);
|
||||
NOT_NULL(gameServer);
|
||||
@@ -814,7 +810,6 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
|
||||
else if (message.isType("TaskProcessDiedMessage"))
|
||||
{
|
||||
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
TaskProcessDiedMessage died(ri);
|
||||
// verify it was a game server
|
||||
const std::string & proc = died.getProcessName();
|
||||
|
||||
@@ -240,82 +240,75 @@ void TaskManager::remove()
|
||||
void TaskManager::processRcFile()
|
||||
{
|
||||
AbstractFile * file = new StdioFile(ConfigTaskManager::getRcFileName(), "r");
|
||||
if(file)
|
||||
if(file->isOpen())
|
||||
{
|
||||
if(file->isOpen())
|
||||
// read spawn directives
|
||||
int fileLength = file->length();
|
||||
if(fileLength > 0)
|
||||
{
|
||||
// read spawn directives
|
||||
int fileLength = file->length();
|
||||
if(fileLength > 0)
|
||||
char * buffer = new char[fileLength + 1]; //lint !e737 Loss of sign in promotion from int to unsigned long
|
||||
IGNORE_RETURN(memset(buffer, 0, fileLength + 1)); //lint !e732 loss of sign in promotion from int to unsigned long
|
||||
int readResult = file->read(buffer, fileLength);
|
||||
if(readResult > 0)
|
||||
{
|
||||
char * buffer = new char[fileLength + 1]; //lint !e737 Loss of sign in promotion from int to unsigned long
|
||||
IGNORE_RETURN(memset(buffer, 0, fileLength + 1)); //lint !e732 loss of sign in promotion from int to unsigned long
|
||||
int readResult = file->read(buffer, fileLength);
|
||||
if(readResult > 0)
|
||||
// parse the file
|
||||
size_t start = 0;
|
||||
std::string rcData = buffer;
|
||||
while(start < rcData.size())
|
||||
{
|
||||
// parse the file
|
||||
size_t start = 0;
|
||||
std::string rcData = buffer;
|
||||
while(start < rcData.size())
|
||||
size_t recordEnd = rcData.find_first_of('\n', start);
|
||||
if(recordEnd < std::string::npos)
|
||||
{
|
||||
size_t recordEnd = rcData.find_first_of('\n', start);
|
||||
if(recordEnd < std::string::npos)
|
||||
std::string record = rcData.substr(start, recordEnd - start);
|
||||
if(record.length() > 0)
|
||||
{
|
||||
std::string record = rcData.substr(start, recordEnd - start);
|
||||
if(record.length() > 0)
|
||||
size_t firstChar = record.find_first_not_of(" \t");
|
||||
if(firstChar < std::string::npos)
|
||||
{
|
||||
size_t firstChar = record.find_first_not_of(" \t");
|
||||
if(record[firstChar] == '#')
|
||||
{
|
||||
start = recordEnd + 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ProcessEntry pe;
|
||||
|
||||
// get server name
|
||||
size_t serverNameEndPos = record.find_first_of(' ', firstChar);
|
||||
if(serverNameEndPos < std::string::npos)
|
||||
{
|
||||
pe.processName = record.substr(firstChar, serverNameEndPos - firstChar);
|
||||
|
||||
// get target host directive
|
||||
firstChar = record.find_first_not_of(' ', serverNameEndPos);
|
||||
if(firstChar < std::string::npos)
|
||||
{
|
||||
if(record[firstChar] == '#')
|
||||
size_t hostEndPos = record.find_first_of(' ', firstChar);
|
||||
if(hostEndPos < std::string::npos)
|
||||
{
|
||||
start = recordEnd + 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ProcessEntry pe;
|
||||
|
||||
// get server name
|
||||
size_t serverNameEndPos = record.find_first_of(' ', firstChar);
|
||||
if(serverNameEndPos < std::string::npos)
|
||||
{
|
||||
pe.processName = record.substr(firstChar, serverNameEndPos - firstChar);
|
||||
|
||||
// get target host directive
|
||||
firstChar = record.find_first_not_of(' ', serverNameEndPos);
|
||||
if(firstChar < std::string::npos)
|
||||
{
|
||||
size_t hostEndPos = record.find_first_of(' ', firstChar);
|
||||
if(hostEndPos < std::string::npos)
|
||||
pe.targetHost = record.substr(firstChar, hostEndPos - firstChar);
|
||||
if(pe.targetHost != "any" && pe.targetHost != "local")
|
||||
{
|
||||
pe.targetHost = record.substr(firstChar, hostEndPos - firstChar);
|
||||
if(pe.targetHost != "any" && pe.targetHost != "local")
|
||||
{
|
||||
Address a(pe.targetHost, 0);
|
||||
pe.targetHost = a.getHostAddress();
|
||||
}
|
||||
Address a(pe.targetHost, 0);
|
||||
pe.targetHost = a.getHostAddress();
|
||||
}
|
||||
|
||||
// get executable name
|
||||
firstChar = record.find_first_not_of(' ', hostEndPos);
|
||||
if(firstChar < std::string::npos)
|
||||
// get executable name
|
||||
firstChar = record.find_first_not_of(' ', hostEndPos);
|
||||
if(firstChar < std::string::npos)
|
||||
{
|
||||
size_t executableEndPos = record.find_first_of(' ', firstChar);
|
||||
if(executableEndPos < std::string::npos)
|
||||
{
|
||||
size_t executableEndPos = record.find_first_of(' ', firstChar);
|
||||
if(executableEndPos < std::string::npos)
|
||||
pe.executable = record.substr(firstChar, executableEndPos - firstChar);
|
||||
|
||||
// get options
|
||||
firstChar = record.find_first_not_of(' ', executableEndPos);
|
||||
if(firstChar < std::string::npos)
|
||||
{
|
||||
pe.executable = record.substr(firstChar, executableEndPos - firstChar);
|
||||
pe.options = record.substr(firstChar);
|
||||
|
||||
// get options
|
||||
firstChar = record.find_first_not_of(' ', executableEndPos);
|
||||
if(firstChar < std::string::npos)
|
||||
{
|
||||
pe.options = record.substr(firstChar);
|
||||
|
||||
IGNORE_RETURN(m_processEntries.insert(std::make_pair(pe.processName, pe)));
|
||||
}
|
||||
else
|
||||
{
|
||||
REPORT_LOG(true, ("Could not parse taskmanager.rc entry [%s]\n", record.c_str()));
|
||||
}
|
||||
IGNORE_RETURN(m_processEntries.insert(std::make_pair(pe.processName, pe)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -339,26 +332,29 @@ void TaskManager::processRcFile()
|
||||
}
|
||||
else
|
||||
{
|
||||
REPORT_LOG(true, ("Could not parse taskmanager.rc ent-ry [%s]\n", record.c_str()));
|
||||
REPORT_LOG(true, ("Could not parse taskmanager.rc entry [%s]\n", record.c_str()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
REPORT_LOG(true, ("Could not parse taskmanager.rc ent-ry [%s]\n", record.c_str()));
|
||||
}
|
||||
// m_localServers.insert(std::pair<std::string, unsigned long>(record,0));
|
||||
// IGNORE_RETURN(loadOnStart.insert(record));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
start = recordEnd + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
start = recordEnd + 1;
|
||||
}
|
||||
delete [] buffer;
|
||||
}
|
||||
file->close();
|
||||
delete file;
|
||||
delete [] buffer;
|
||||
}
|
||||
file->close();
|
||||
delete file;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -560,7 +560,6 @@ void DatabaseProcess::receiveMessage(const MessageDispatch::Emitter & source, co
|
||||
else if (message.isType("ExcommunicateGameServerMessage"))
|
||||
{
|
||||
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
|
||||
ExcommunicateGameServerMessage msg(ri);
|
||||
|
||||
LOG("GameGameConnect",("Database Process was told to drop connection to %lu by Central",msg.getServerId()));
|
||||
|
||||
@@ -52,8 +52,6 @@ bool TaskGetStructures::process(DB::Session *session)
|
||||
{
|
||||
StructureRec *cr=new StructureRec;
|
||||
|
||||
NOT_NULL(cr);
|
||||
|
||||
cr->structureId = NetworkId(qry.getData().object_id.getValue());
|
||||
cr->location = Unicode::wideToNarrow(qry.getData().scene_id.getValue());
|
||||
cr->objectTemplate = Unicode::wideToNarrow(qry.getData().object_template.getValue());
|
||||
|
||||
@@ -97,7 +97,6 @@ void BattlefieldMarkerObject::onRegionNameChanged(std::string const &oldName, st
|
||||
Controller *BattlefieldMarkerObject::createDefaultController()
|
||||
{
|
||||
Controller * _controller = new BattlefieldMarkerController(this);
|
||||
NOT_NULL(_controller);
|
||||
|
||||
setController(_controller);
|
||||
return _controller;
|
||||
|
||||
@@ -416,7 +416,6 @@ void BuildingObject::removeDefaultTemplate(void)
|
||||
Controller* BuildingObject::createDefaultController(void)
|
||||
{
|
||||
Controller* _controller = new BuildingController(this);
|
||||
NOT_NULL(_controller);
|
||||
|
||||
setController(_controller);
|
||||
return _controller;
|
||||
|
||||
@@ -84,7 +84,6 @@ CellObject::~CellObject()
|
||||
Controller * CellObject::createDefaultController()
|
||||
{
|
||||
Controller *controller = new CellController(this);
|
||||
NOT_NULL(controller);
|
||||
setController(controller);
|
||||
return controller;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,6 @@ CityObject::~CityObject()
|
||||
Controller* CityObject::createDefaultController()
|
||||
{
|
||||
Controller* controller = new CityController(this);
|
||||
NOT_NULL(controller);
|
||||
|
||||
setController(controller);
|
||||
return controller;
|
||||
|
||||
@@ -326,7 +326,6 @@ bool DraftSchematicObject::getAttribMinMax(int index, int & minValue,
|
||||
{
|
||||
const SharedDraftSchematicObjectTemplate::SchematicAttribute & minAttrib =
|
||||
getAttribMin(index);
|
||||
minValue = minAttrib.value;
|
||||
const SharedDraftSchematicObjectTemplate::SchematicAttribute & maxAttrib =
|
||||
getAttribMax(index);
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ CrcString const & CallStackCollectorNamespace::Node::getName() const
|
||||
void CallStackCollectorNamespace::Node::addCallStack(uint32 * const callStack)
|
||||
{
|
||||
//-- Compute crc of memory
|
||||
uint32 const crc = Crc::calculate(callStack, sizeof(uint32) * CALLSTACK_DEPTH);
|
||||
uint32 const crc = Crc::calculate(callStack, (sizeof(uint32) * CALLSTACK_DEPTH));
|
||||
|
||||
//-- Find callstack in list
|
||||
CallStackEntryMap::iterator iter = m_callStackEntryMap.find(crc);
|
||||
@@ -141,7 +141,7 @@ void CallStackCollectorNamespace::Node::addCallStack(uint32 * const callStack)
|
||||
{
|
||||
//-- Create new callstack
|
||||
uint32 * const newCallStack = new uint32[CALLSTACK_DEPTH];
|
||||
memcpy(newCallStack, callStack, sizeof(uint32) * CALLSTACK_DEPTH);
|
||||
memcpy(newCallStack, callStack, (sizeof(uint32) * CALLSTACK_DEPTH));
|
||||
|
||||
CallStackEntry callStackEntry;
|
||||
callStackEntry.m_callStack = newCallStack;
|
||||
|
||||
@@ -567,7 +567,6 @@ TerrainQuadTree::Node * TerrainQuadTree::Node::findChunkNode (const ProceduralTe
|
||||
|
||||
TerrainQuadTree::Node * TerrainQuadTree::Node::findFirstRenderablePeerNeighbor (const TerrainQuadTree::Node * const otherNode, const int dir)
|
||||
{
|
||||
NOT_NULL (this);
|
||||
NOT_NULL (otherNode);
|
||||
|
||||
const int dir_offsets[4][2] =
|
||||
@@ -595,7 +594,6 @@ TerrainQuadTree::Node * TerrainQuadTree::Node::findFirstRenderablePeerNeighbor (
|
||||
|
||||
TerrainQuadTree::Node * TerrainQuadTree::Node::findFirstRenderableLowerNeighbor (const TerrainQuadTree::Node * const otherNode, const int dir)
|
||||
{
|
||||
NOT_NULL (this);
|
||||
NOT_NULL (otherNode);
|
||||
|
||||
const int halfSize = otherNode->getSize () / 2;
|
||||
|
||||
@@ -758,7 +758,7 @@ void AffectorRiver::createWaterTables (ArrayList<AffectorRiver::WaterTable>& wat
|
||||
const Vector2d currentEndRight = currentEnd + currentNormal * waterWidth;
|
||||
|
||||
const Vector2d& previousStart = !atStart ? m_pointList [i - 1] : m_pointList [i];
|
||||
const Vector2d& previousEnd = !atStart ? m_pointList [i] : m_pointList [i];
|
||||
const Vector2d& previousEnd = m_pointList [i];
|
||||
const Vector2d previousSegment = previousEnd - previousStart;
|
||||
const Vector2d previousDirection = !atStart ? Vector2d::normalized (previousSegment) : currentDirection;
|
||||
const Vector2d previousNormal = !atStart ? Vector2d::normal (previousDirection, false) : currentNormal;
|
||||
@@ -768,7 +768,7 @@ void AffectorRiver::createWaterTables (ArrayList<AffectorRiver::WaterTable>& wat
|
||||
const Vector2d previousEndLeft = previousEnd - previousNormal * waterWidth;
|
||||
const Vector2d previousEndRight = previousEnd + previousNormal * waterWidth;
|
||||
|
||||
const Vector2d& nextStart = !atEndNext ? m_pointList [i + 1] : m_pointList [i + 1];
|
||||
const Vector2d& nextStart = m_pointList [i + 1];
|
||||
const Vector2d& nextEnd = !atEndNext ? m_pointList [i + 2] : m_pointList [i + 1];
|
||||
const Vector2d nextSegment = nextEnd - nextStart;
|
||||
const Vector2d nextDirection = !atEndNext ? Vector2d::normalized (nextSegment) : currentDirection;
|
||||
|
||||
@@ -87,10 +87,10 @@ int UdpMisc::Crc32(const void *buffer, int bufferLen, int encryptValue)
|
||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D};
|
||||
|
||||
int crc = 0xffffffff;
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ (encryptValue & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 8) & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 16) & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 24) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ (encryptValue & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 8) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 16) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 24) & 0xff)) & 0x000000FFL];
|
||||
|
||||
const udp_uchar *bufPtr = (const udp_uchar *)buffer;
|
||||
const udp_uchar *endPtr = (const udp_uchar *)buffer + bufferLen;
|
||||
|
||||
+4
-2
@@ -223,16 +223,18 @@ namespace VChatSystem
|
||||
case MESSAGE_REMOVE_CHARACTER_CHANNEL_REPLY:
|
||||
{
|
||||
Message::RemoveCharacterChannelReply message;
|
||||
if(message.Read(data, dataLen))
|
||||
if (message.Read(data, dataLen)) {
|
||||
mClient.OnRemoveCharacterChannel(message.GetTrackingNumber(), message.GetResult(), userData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case MESSAGE_GET_CHARACTER_CHANNEL_REPLY:
|
||||
{
|
||||
Message::GetCharacterChannelReply message;
|
||||
if(message.Read(data, dataLen))
|
||||
if (message.Read(data, dataLen)) {
|
||||
mClient.OnGetCharacterChannel(message.GetTrackingNumber(), message.GetResult(), message.GetChannelList(), userData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
+3
-8
@@ -266,10 +266,8 @@ namespace VChatSystem
|
||||
output = (char*)outBuffer;
|
||||
}
|
||||
|
||||
if (outBuffer)
|
||||
{
|
||||
delete [] outBuffer;
|
||||
}
|
||||
|
||||
delete [] outBuffer;
|
||||
}
|
||||
|
||||
void DecodeVivoxString(const std::string & input, std::string & output)
|
||||
@@ -293,10 +291,7 @@ namespace VChatSystem
|
||||
output = (char*)outBuffer;
|
||||
}
|
||||
|
||||
if (outBuffer)
|
||||
{
|
||||
delete [] outBuffer;
|
||||
}
|
||||
delete [] outBuffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -350,11 +350,8 @@ void Logger::logSimple(unsigned logenum, int level, const char *message)
|
||||
|
||||
if(m_rollDate && info->ts.tm_mday != m_lastDateTime.tm_mday)
|
||||
{
|
||||
if(info->ts.tm_mday != m_lastDateTime.tm_mday)
|
||||
{
|
||||
memcpy(&m_lastDateTime, &info->ts, sizeof(tm));
|
||||
rollDate(t);
|
||||
}
|
||||
memcpy(&m_lastDateTime, &info->ts, sizeof(tm));
|
||||
rollDate(t);
|
||||
}
|
||||
if(iter != m_logTable.end())
|
||||
{
|
||||
@@ -426,11 +423,8 @@ void Logger::logSimpleWithSys(unsigned logenum, unsigned priority, int level, co
|
||||
|
||||
if(m_rollDate && info->ts.tm_mday != m_lastDateTime.tm_mday)
|
||||
{
|
||||
if(info->ts.tm_mday != m_lastDateTime.tm_mday)
|
||||
{
|
||||
memcpy(&m_lastDateTime, &info->ts, sizeof(tm));
|
||||
rollDate(t);
|
||||
}
|
||||
memcpy(&m_lastDateTime, &info->ts, sizeof(tm));
|
||||
rollDate(t);
|
||||
}
|
||||
if(iter != m_logTable.end())
|
||||
{
|
||||
@@ -507,11 +501,8 @@ void Logger::logWithSys(unsigned logenum, unsigned priority, int level, const ch
|
||||
}
|
||||
if(m_rollDate && info->ts.tm_mday != m_lastDateTime.tm_mday)
|
||||
{
|
||||
if(info->ts.tm_mday != m_lastDateTime.tm_mday)
|
||||
{
|
||||
memcpy(&m_lastDateTime, &info->ts, sizeof(tm));
|
||||
rollDate(t);
|
||||
}
|
||||
memcpy(&m_lastDateTime, &info->ts, sizeof(tm));
|
||||
rollDate(t);
|
||||
}
|
||||
|
||||
if(iter != m_logTable.end())
|
||||
@@ -590,11 +581,8 @@ void Logger::vlogWithSys(unsigned logenum, unsigned priority, int level, const c
|
||||
}
|
||||
if(m_rollDate && info->ts.tm_mday != m_lastDateTime.tm_mday)
|
||||
{
|
||||
if(info->ts.tm_mday != m_lastDateTime.tm_mday)
|
||||
{
|
||||
memcpy(&m_lastDateTime, &info->ts, sizeof(tm));
|
||||
rollDate(t);
|
||||
}
|
||||
memcpy(&m_lastDateTime, &info->ts, sizeof(tm));
|
||||
rollDate(t);
|
||||
}
|
||||
|
||||
if(iter != m_logTable.end())
|
||||
|
||||
+5
-16
@@ -520,10 +520,7 @@ stringMessage::stringMessage(const unsigned short command,const unsigned short s
|
||||
monMessage(command, sequence, size)
|
||||
{
|
||||
data = new char [strlen(newData) + 1];
|
||||
if (data)
|
||||
strncpy(data, newData, strlen(newData + 1));
|
||||
else
|
||||
data = NULL;
|
||||
strncpy(data, newData, strlen(newData + 1));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
@@ -559,13 +556,8 @@ monMessage(source)
|
||||
{
|
||||
data = new unsigned char[getSize()+1];
|
||||
|
||||
if (data)
|
||||
{
|
||||
memcpy(data, source + 6, getSize());
|
||||
data[getSize()] = 0;
|
||||
}
|
||||
else
|
||||
data = NULL;
|
||||
memcpy(data, source + 6, getSize());
|
||||
data[getSize()] = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
@@ -586,11 +578,8 @@ monMessage(command, sequence, size)
|
||||
//----------------------------------------------------------------
|
||||
dataReplyMessage::~dataReplyMessage()
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
delete [] data;
|
||||
data = 0;
|
||||
}
|
||||
delete [] data;
|
||||
data = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
+4
-4
@@ -4201,10 +4201,10 @@ int UdpMisc::Crc32(const void *buffer, int bufferLen, int encryptValue)
|
||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D};
|
||||
|
||||
int crc = 0xffffffff;
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ (encryptValue & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 8) & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 16) & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 24) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ (encryptValue & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 8) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 16) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 24) & 0xff)) & 0x000000FFL];
|
||||
|
||||
const uchar *bufPtr = (const uchar *)buffer;
|
||||
const uchar *endPtr = (const uchar *)buffer + bufferLen;
|
||||
|
||||
+4
-4
@@ -4178,10 +4178,10 @@ int UdpMisc::Crc32(const void *buffer, int bufferLen, int encryptValue)
|
||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D};
|
||||
|
||||
int crc = 0xffffffff;
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ (encryptValue & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 8) & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 16) & 0xff)) & 0x000000FFL];
|
||||
crc = ((crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 24) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ (encryptValue & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 8) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 16) & 0xff)) & 0x000000FFL];
|
||||
crc = (crc >> 8 & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 24) & 0xff)) & 0x000000FFL];
|
||||
|
||||
const uchar *bufPtr = (const uchar *)buffer;
|
||||
const uchar *endPtr = (const uchar *)buffer + bufferLen;
|
||||
|
||||
@@ -48,8 +48,6 @@ bool TaskGetCharacters::process(DB::Session *session)
|
||||
{
|
||||
CharacterRec *cr=new CharacterRec;
|
||||
|
||||
NOT_NULL(cr);
|
||||
|
||||
cr->characterName = qry.getData().character_name.getValue();
|
||||
cr->characterId = NetworkId(qry.getData().object_id.getValue());
|
||||
cr->location = Unicode::wideToNarrow(qry.getData().scene_id.getValue());
|
||||
|
||||
@@ -274,7 +274,6 @@ bool CombatEngine::onSuccessfulAttack(const TangibleObject & attacker,
|
||||
|
||||
// send the damage info to the authoritative object
|
||||
MessageQueueCombatDamageList * message = new MessageQueueCombatDamageList();
|
||||
NOT_NULL(message);
|
||||
CombatEngineData::DamageData & damageData = message->addDamage();
|
||||
|
||||
damageData.attackerId = attacker.getNetworkId();
|
||||
@@ -372,7 +371,6 @@ bool CombatEngine::onSuccessfulAttack(const TangibleObject & attacker,
|
||||
|
||||
// send the damage info to the authoritative object
|
||||
MessageQueueCombatDamageList * message = new MessageQueueCombatDamageList();
|
||||
NOT_NULL(message);
|
||||
CombatEngineData::DamageData & damageData = message->addDamage();
|
||||
|
||||
damageData.attackerId = attacker.getNetworkId();
|
||||
@@ -722,7 +720,6 @@ void CombatEngine::alter(TangibleObject & object)
|
||||
|
||||
// send the damage info to the authoritative object
|
||||
MessageQueueCombatDamageList * message = new MessageQueueCombatDamageList();
|
||||
NOT_NULL(message);
|
||||
for (iter = damageData.begin(); iter != damageData.end(); ++iter)
|
||||
message->addDamage(*iter);
|
||||
tangibleController->appendMessage(
|
||||
|
||||
@@ -163,7 +163,6 @@ void JediManagerObject::onServerUniverseGainedAuthority()
|
||||
Controller * JediManagerObject::createDefaultController()
|
||||
{
|
||||
Controller * controller = new JediManagerController(this);
|
||||
NOT_NULL(controller);
|
||||
|
||||
setController(controller);
|
||||
return controller;
|
||||
|
||||
@@ -135,7 +135,7 @@ void WorldSnapshotParser::createWorldSnapshots (const char* const filename)
|
||||
|
||||
//-- scan each line of the file
|
||||
bool quit = false;
|
||||
while (!quit && fgets (buffer, 1024, infile) != 0)
|
||||
while (fgets (buffer, 1024, infile) != 0)
|
||||
{
|
||||
const char* current = buffer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user