hopefully this fixes some more...

This commit is contained in:
DarthArgus
2014-10-26 22:20:06 -07:00
parent 9db3229116
commit eb2e7c78d8
23 changed files with 105 additions and 156 deletions
@@ -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;
@@ -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:
@@ -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())
@@ -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;
}
//----------------------------------------------------------------
@@ -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
View File
@@ -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;