mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-14 00:01:30 -04:00
and more performance tweaks
This commit is contained in:
@@ -1299,7 +1299,7 @@ void ChatServer::destroyRoom(const std::string & roomName)
|
||||
if (pos != roomName.npos)
|
||||
{
|
||||
std::string tmpRoomName = roomName.substr(0, pos);
|
||||
char lastChar = tmpRoomName[strlen(tmpRoomName.c_str()) - 1];
|
||||
char lastChar = tmpRoomName[tmpRoomName.length() - 1];
|
||||
if (lastChar >= '0' && lastChar <= '9')
|
||||
{
|
||||
ChatServer::destroyRoom(tmpRoomName);
|
||||
|
||||
@@ -146,9 +146,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
// deliver IM to character
|
||||
ChatInstantMessageToCharacter chat(cri);
|
||||
ChatAvatarId characterName = chat.getCharacterName();
|
||||
if(characterName.gameCode == "")
|
||||
if(characterName.gameCode.empty())
|
||||
characterName.gameCode = "SWG";
|
||||
if(characterName.cluster == "")
|
||||
if(characterName.cluster.empty())
|
||||
characterName.cluster = ConfigChatServer::getClusterName();
|
||||
|
||||
ChatAvatarId fromName;
|
||||
@@ -185,9 +185,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
// deliver IM to character
|
||||
ChatInstantMessageToCharacter chat(cri);
|
||||
ChatAvatarId characterName = chat.getCharacterName();
|
||||
if(characterName.gameCode == "")
|
||||
if(characterName.gameCode.empty())
|
||||
characterName.gameCode = "SWG";
|
||||
if(characterName.cluster == "")
|
||||
if(characterName.cluster.empty())
|
||||
characterName.cluster = ConfigChatServer::getClusterName();
|
||||
|
||||
ChatServer::sendInstantMessage(*i, chat.getSequence(), characterName, chat.getMessage(), chat.getOutOfBand());
|
||||
@@ -205,9 +205,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
//printf("ConnectionServerConnection -- ChatPersistentMessageToServer\n");
|
||||
ChatPersistentMessageToServer chat(cri);
|
||||
ChatAvatarId characterName = chat.getToCharacterName();
|
||||
if(characterName.gameCode == "")
|
||||
if(characterName.gameCode.empty())
|
||||
characterName.gameCode = "SWG";
|
||||
if(characterName.cluster == "")
|
||||
if(characterName.cluster.empty())
|
||||
characterName.cluster = ConfigChatServer::getClusterName();
|
||||
|
||||
ChatServer::sendPersistentMessage((*i), chat.getSequence(), characterName, chat.getSubject(), chat.getMessage(), chat.getOutOfBand());
|
||||
@@ -283,9 +283,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
//printf("ConnectionServerConnection -- ChatREmoveModeratorFromRoom\n");
|
||||
ChatRemoveModeratorFromRoom chat(cri);
|
||||
ChatAvatarId characterName = chat.getAvatarId();
|
||||
if(characterName.gameCode == "")
|
||||
if(characterName.gameCode.empty())
|
||||
characterName.gameCode = "SWG";
|
||||
if(characterName.cluster == "")
|
||||
if(characterName.cluster.empty())
|
||||
characterName.cluster = ConfigChatServer::getClusterName();
|
||||
ChatServer::removeModeratorFromRoom(chat.getSequenceId(), (*i), characterName, chat.getRoomName());
|
||||
}
|
||||
@@ -316,9 +316,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
//printf("ConnectionServerConnection -- ChatInviteAvatarToRoom\n");
|
||||
ChatInviteAvatarToRoom chat(cri);
|
||||
ChatAvatarId characterName = chat.getAvatarId();
|
||||
if(characterName.gameCode == "")
|
||||
if(characterName.gameCode.empty())
|
||||
characterName.gameCode = "SWG";
|
||||
if(characterName.cluster == "")
|
||||
if(characterName.cluster.empty())
|
||||
characterName.cluster = ConfigChatServer::getClusterName();
|
||||
ChatServer::invite((*i), characterName, chat.getRoomName());
|
||||
}
|
||||
@@ -328,9 +328,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
//printf("ConnectionServerConnection -- ChatUninviteAvatarToRoom\n");
|
||||
ChatUninviteFromRoom chat(cri);
|
||||
ChatAvatarId characterName = chat.getAvatar();
|
||||
if(characterName.gameCode == "")
|
||||
if(characterName.gameCode.empty())
|
||||
characterName.gameCode = "SWG";
|
||||
if(characterName.cluster == "")
|
||||
if(characterName.cluster.empty())
|
||||
characterName.cluster = ConfigChatServer::getClusterName();
|
||||
ChatServer::uninvite((*i), chat.getSequence(), characterName, chat.getRoomName());
|
||||
}
|
||||
@@ -340,9 +340,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
//printf("ConnectionServerConnection -- ChatBanAvatarFromRoom\n");
|
||||
ChatBanAvatarFromRoom chat(cri);
|
||||
ChatAvatarId characterName = chat.getAvatarId();
|
||||
if(characterName.gameCode == "")
|
||||
if(characterName.gameCode.empty())
|
||||
characterName.gameCode = "SWG";
|
||||
if(characterName.cluster == "")
|
||||
if(characterName.cluster.empty())
|
||||
characterName.cluster = ConfigChatServer::getClusterName();
|
||||
ChatServer::banFromRoom(chat.getSequence(), (*i), characterName, chat.getRoomName());
|
||||
}
|
||||
@@ -352,9 +352,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
|
||||
//printf("ConnectionServerConnection -- ChatUnbanAvatarFromRoom\n");
|
||||
ChatUnbanAvatarFromRoom chat(cri);
|
||||
ChatAvatarId characterName = chat.getAvatarId();
|
||||
if(characterName.gameCode == "")
|
||||
if(characterName.gameCode.empty())
|
||||
characterName.gameCode = "SWG";
|
||||
if(characterName.cluster == "")
|
||||
if(characterName.cluster.empty())
|
||||
characterName.cluster = ConfigChatServer::getClusterName();
|
||||
ChatServer::unbanFromRoom(chat.getSequence(), (*i), characterName, chat.getRoomName());
|
||||
}
|
||||
|
||||
@@ -905,7 +905,7 @@ std::string VChatInterface::parseWorldName(std::string const & input)
|
||||
std::string::size_type findIndex = input.find(worldCode);
|
||||
if(findIndex != std::string::npos)
|
||||
{
|
||||
findIndex += strlen(worldCode.c_str());
|
||||
findIndex += worldCode.length());
|
||||
output = input.substr(findIndex);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace AuctionMarketNamespace
|
||||
{
|
||||
HexString += buffer;
|
||||
}
|
||||
z++;
|
||||
++z;
|
||||
}
|
||||
|
||||
DEBUG_REPORT_LOG(ConfigCommodityServer::getShowAllDebugInfo(), ("[Commodities Server ][HEX OOB IN] : %s \n", HexString.c_str()));
|
||||
@@ -3002,7 +3002,7 @@ void AuctionMarket::DestroyVendorMarket(const DestroyVendorMarketMessage &messag
|
||||
std::vector<std::map<NetworkId, Auction *>::iterator> destroyedAuctions;
|
||||
std::map<NetworkId, Auction *>::iterator item;
|
||||
// get all the auctions for this location and get an iterator from the real auctions map
|
||||
for( std::map<NetworkId, Auction*>::iterator j = (*i).second->GetAuctions().begin(); j != (*i).second->GetAuctions().end(); j++ )
|
||||
for( std::map<NetworkId, Auction*>::iterator j = (*i).second->GetAuctions().begin(); j != (*i).second->GetAuctions().end(); ++j )
|
||||
{
|
||||
item = m_auctions.find((*j).first);
|
||||
if( item != m_auctions.end() )
|
||||
@@ -3012,7 +3012,7 @@ void AuctionMarket::DestroyVendorMarket(const DestroyVendorMarketMessage &messag
|
||||
}
|
||||
|
||||
// do it again for all vendor offers
|
||||
for( std::map<NetworkId, Auction*>::iterator k = (*i).second->GetVendorOffers().begin(); k != (*i).second->GetVendorOffers().end(); k++ )
|
||||
for( std::map<NetworkId, Auction*>::iterator k = (*i).second->GetVendorOffers().begin(); k != (*i).second->GetVendorOffers().end(); ++k )
|
||||
{
|
||||
item = m_auctions.find((*k).first);
|
||||
if( item != m_auctions.end() )
|
||||
@@ -3077,7 +3077,7 @@ void AuctionMarket::DeleteAuctionLocation(const DeleteAuctionLocationMessage &me
|
||||
std::vector<std::map<NetworkId, Auction *>::iterator> destroyedAuctions;
|
||||
std::map<NetworkId, Auction *>::iterator item;
|
||||
// get all the auctions for this location and get an iterator from the real auctions map
|
||||
for( std::map<NetworkId, Auction*>::iterator j = (*i).second->GetAuctions().begin(); j != (*i).second->GetAuctions().end(); j++ )
|
||||
for( std::map<NetworkId, Auction*>::iterator j = (*i).second->GetAuctions().begin(); j != (*i).second->GetAuctions().end(); ++j )
|
||||
{
|
||||
item = m_auctions.find((*j).first);
|
||||
if( item != m_auctions.end() )
|
||||
@@ -3087,7 +3087,7 @@ void AuctionMarket::DeleteAuctionLocation(const DeleteAuctionLocationMessage &me
|
||||
}
|
||||
|
||||
// do it again for all vendor offers
|
||||
for( std::map<NetworkId, Auction*>::iterator k = (*i).second->GetVendorOffers().begin(); k != (*i).second->GetVendorOffers().end(); k++ )
|
||||
for( std::map<NetworkId, Auction*>::iterator k = (*i).second->GetVendorOffers().begin(); k != (*i).second->GetVendorOffers().end(); ++k )
|
||||
{
|
||||
item = m_auctions.find((*k).first);
|
||||
if( item != m_auctions.end() )
|
||||
@@ -3473,7 +3473,7 @@ bool AuctionMarket::FixVendorLocation( const std::string &loc )
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -4341,7 +4341,7 @@ void static decodeOOB(const std::string & UTF8String, Unicode::String & UniStrin
|
||||
UniString.push_back(unicharvalue);
|
||||
tempstring.clear();
|
||||
}
|
||||
c++;
|
||||
++c;
|
||||
}
|
||||
if (tempstring.length() != 0)
|
||||
{
|
||||
|
||||
@@ -176,7 +176,7 @@ void CSToolConnection::onReceive( const Archive::ByteStream & message )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sInputBuffer = "";
|
||||
m_sInputBuffer.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace TaskManagerNameSpace
|
||||
std::vector<QueuedSpawnRequest> s_delayedSpawnRequests;
|
||||
struct OutstandingSpawnRequestAck
|
||||
{
|
||||
OutstandingSpawnRequestAck(const std::string n, const Archive::ByteStream & a, int t) :
|
||||
OutstandingSpawnRequestAck(const std::string &n, const Archive::ByteStream & a, int t) :
|
||||
nodeLabel(n), request(a), transactionId(t)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -273,9 +273,9 @@ namespace DB
|
||||
template<int S>
|
||||
void BindableString<S>::setValue(const std::string &buffer)
|
||||
{
|
||||
FATAL(strlen(buffer.c_str())>S,("Attempt to save a std::string \"%s\"that is too long to the database.", buffer.c_str()));
|
||||
FATAL(buffer.length())>S,("Attempt to save a std::string \"%s\"that is too long to the database.", buffer.c_str()));
|
||||
strncpy(m_value, buffer.c_str(), S+1);
|
||||
indicator=strlen(buffer.c_str());
|
||||
indicator=buffer.length();
|
||||
}
|
||||
|
||||
template<int S>
|
||||
|
||||
@@ -632,7 +632,7 @@ void apiCore::Process()
|
||||
while (mapIterator != mRequestMap.end())
|
||||
{
|
||||
apiTrackedRequest & request = (*mapIterator).second;
|
||||
mapIterator++;
|
||||
++mapIterator;
|
||||
|
||||
if (request.Expired())
|
||||
{
|
||||
|
||||
@@ -1657,7 +1657,7 @@ namespace LoginAPI
|
||||
Message::NotifySessionKick message(iterator);
|
||||
|
||||
std::vector<const char *> sessionList;
|
||||
for (std::vector<std::string>::const_iterator i=message.GetSessionList().begin(); i!=message.GetSessionList().end(); i++)
|
||||
for (std::vector<std::string>::const_iterator i=message.GetSessionList().begin(); i!=message.GetSessionList().end(); ++i)
|
||||
{
|
||||
sessionList.push_back(i->c_str());
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ void RGetAvatarKeywords::pack(ByteStream &msg)
|
||||
put(msg, m_srcAvatarID);
|
||||
}
|
||||
|
||||
RSearchAvatarKeywords::RSearchAvatarKeywords(const ChatUnicodeString nodeAddress, const ChatUnicodeString *keywordsList, unsigned keywordsLength)
|
||||
RSearchAvatarKeywords::RSearchAvatarKeywords(const ChatUnicodeString &nodeAddress, const ChatUnicodeString *keywordsList, unsigned keywordsLength)
|
||||
: GenericRequest(REQUEST_SEARCHAVATARKEYWORDS),
|
||||
m_keywordsLength(keywordsLength),
|
||||
m_keywordsList(NULL)
|
||||
@@ -1282,7 +1282,7 @@ void RClassifyPersistentMessages::pack(ByteStream &msg)
|
||||
put(msg, m_track);
|
||||
put(msg, m_srcAvatarID);
|
||||
put(msg, m_messageIDs.size());
|
||||
for (idIter = m_messageIDs.begin(); idIter != m_messageIDs.end(); idIter++)
|
||||
for (idIter = m_messageIDs.begin(); idIter != m_messageIDs.end(); ++idIter)
|
||||
{
|
||||
put(msg, *idIter);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ private:
|
||||
class RSearchAvatarKeywords : public GenericAPI::GenericRequest
|
||||
{
|
||||
public:
|
||||
RSearchAvatarKeywords(const ChatUnicodeString nodeAddress, const ChatUnicodeString *keywordsList, unsigned keywordsLength);
|
||||
RSearchAvatarKeywords(const ChatUnicodeString &nodeAddress, const ChatUnicodeString *keywordsList, unsigned keywordsLength);
|
||||
virtual ~RSearchAvatarKeywords();
|
||||
|
||||
virtual void pack(Base::ByteStream &msg);
|
||||
|
||||
@@ -119,12 +119,12 @@ namespace API_NAMESPACE
|
||||
{
|
||||
// ensure that callback mecahnism isn't triggered at this point
|
||||
HostMap_t::iterator iter;
|
||||
for (iter = mHostMap[0].begin(); iter != mHostMap[0].end(); iter++)
|
||||
for (iter = mHostMap[0].begin(); iter != mHostMap[0].end(); ++iter)
|
||||
{
|
||||
iter->first->SetHandler(0);
|
||||
iter->first->Release();
|
||||
}
|
||||
for (iter = mHostMap[1].begin(); iter != mHostMap[1].end(); iter++)
|
||||
for (iter = mHostMap[1].begin(); iter != mHostMap[1].end(); ++iter)
|
||||
{
|
||||
iter->first->SetHandler(0);
|
||||
iter->first->Release();
|
||||
@@ -555,7 +555,7 @@ namespace API_NAMESPACE
|
||||
if (mTimeoutTimer != currentTime)
|
||||
{
|
||||
TimeoutMap_t::iterator iterator;
|
||||
for (iterator = mTimeoutMap.begin(); iterator != mTimeoutMap.end(); iterator++)
|
||||
for (iterator = mTimeoutMap.begin(); iterator != mTimeoutMap.end(); ++iterator)
|
||||
{
|
||||
TimeoutList_t & timeoutList = iterator->second;
|
||||
while (!timeoutList.empty() && timeoutList.front().second < currentTime)
|
||||
@@ -870,7 +870,7 @@ namespace API_NAMESPACE
|
||||
size_t i = labelsAndValues.size();
|
||||
|
||||
labelsAndValues.resize(labelsAndValues.size() + mspLabelToEntryMap->size());
|
||||
for (LabelToEntryMap_t::const_iterator it = mspLabelToEntryMap->begin(); it != mspLabelToEntryMap->end(); it++, i++)
|
||||
for (LabelToEntryMap_t::const_iterator it = mspLabelToEntryMap->begin(); it != mspLabelToEntryMap->end(); ++it, ++i)
|
||||
{
|
||||
string value;
|
||||
|
||||
@@ -938,7 +938,7 @@ namespace API_NAMESPACE
|
||||
{
|
||||
initializeMap();
|
||||
|
||||
for (soe::NameValuePairs_t::const_iterator it = labelsAndValues.begin(); it != labelsAndValues.end(); it++)
|
||||
for (soe::NameValuePairs_t::const_iterator it = labelsAndValues.begin(); it != labelsAndValues.end(); ++it)
|
||||
{
|
||||
LabelToEntryMap_t::iterator mIter = mspLabelToEntryMap->find(it->name);
|
||||
|
||||
@@ -1029,7 +1029,7 @@ namespace API_NAMESPACE
|
||||
{
|
||||
ClassScribeSet_t::iterator scribeIter;
|
||||
|
||||
for (scribeIter = classScribeSet.begin(); scribeIter != classScribeSet.end(); scribeIter++)
|
||||
for (scribeIter = classScribeSet.begin(); scribeIter != classScribeSet.end(); ++scribeIter)
|
||||
{
|
||||
// This will cause the scribe to reinitialize itself next time it's used,
|
||||
// thereby copying the new values. Storing references was too dangerous.
|
||||
|
||||
+6
-6
@@ -24,7 +24,7 @@ namespace API_NAMESPACE
|
||||
#ifdef TRACK_READ_WRITE_FAILURES
|
||||
soe::ClearMessageFailureStack();
|
||||
#endif
|
||||
for(iterator=mMembers.begin(); iterator!=mMembers.end(); iterator++)
|
||||
for(iterator=mMembers.begin(); iterator!=mMembers.end(); ++iterator)
|
||||
{
|
||||
MemberInfo_t & memberInfo = *iterator;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace API_NAMESPACE
|
||||
}
|
||||
if (succeeded)
|
||||
{
|
||||
for(iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); iterator++)
|
||||
for(iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); ++iterator)
|
||||
{
|
||||
MemberInfo_t & memberInfo = *iterator;
|
||||
unsigned bytes = memberInfo.data->Read(stream, size, memberInfo.size, version);
|
||||
@@ -80,7 +80,7 @@ namespace API_NAMESPACE
|
||||
soe::ClearMessageFailureStack();
|
||||
#endif
|
||||
|
||||
for (iterator=mMembers.begin(); iterator!=mMembers.end(); iterator++)
|
||||
for (iterator=mMembers.begin(); iterator!=mMembers.end(); ++iterator)
|
||||
{
|
||||
const MemberInfo_t & memberInfo = *iterator;
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace API_NAMESPACE
|
||||
}
|
||||
if (succeeded)
|
||||
{
|
||||
for (iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); iterator++)
|
||||
for (iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); ++iterator)
|
||||
{
|
||||
const MemberInfo_t & memberInfo = *iterator;
|
||||
unsigned bytes = memberInfo.data->Write(stream, size, version);
|
||||
@@ -151,7 +151,7 @@ namespace API_NAMESPACE
|
||||
|
||||
bool printedOne = false;
|
||||
MemberVector_t::const_iterator iterator;
|
||||
for (iterator=mMembers.begin(); iterator!=mMembers.end(); iterator++)
|
||||
for (iterator=mMembers.begin(); iterator!=mMembers.end(); ++iterator)
|
||||
{
|
||||
int bytes = 0;
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace API_NAMESPACE
|
||||
bytesTotal += bytes;
|
||||
}
|
||||
}
|
||||
for (iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); iterator++)
|
||||
for (iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); ++iterator)
|
||||
{
|
||||
int bytes = 0;
|
||||
|
||||
|
||||
@@ -109,12 +109,12 @@ namespace NAMESPACE
|
||||
{
|
||||
// ensure that callback mecahnism isn't triggered at this point
|
||||
HostMap_t::iterator iter;
|
||||
for (iter = mHostMap[0].begin(); iter != mHostMap[0].end(); iter++)
|
||||
for (iter = mHostMap[0].begin(); iter != mHostMap[0].end(); ++iter)
|
||||
{
|
||||
iter->first->SetHandler(0);
|
||||
iter->first->Release();
|
||||
}
|
||||
for (iter = mHostMap[1].begin(); iter != mHostMap[1].end(); iter++)
|
||||
for (iter = mHostMap[1].begin(); iter != mHostMap[1].end(); ++iter)
|
||||
{
|
||||
iter->first->SetHandler(0);
|
||||
iter->first->Release();
|
||||
@@ -294,7 +294,7 @@ namespace NAMESPACE
|
||||
ApiConnection * connection = NULL;
|
||||
unsigned hashIndex = hashValue % mActiveHosts[0].size();
|
||||
unsigned curIndex = 0;
|
||||
for (ConnectionSet_t::iterator it = mActiveHosts[0].begin(); it != mActiveHosts[0].end(); it++, curIndex++)
|
||||
for (ConnectionSet_t::iterator it = mActiveHosts[0].begin(); it != mActiveHosts[0].end(); ++it, ++curIndex)
|
||||
{
|
||||
if (hashIndex == curIndex)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ namespace NAMESPACE
|
||||
ApiConnection * connection = NULL;
|
||||
unsigned hashIndex = hashValue % mActiveHosts[1].size();
|
||||
unsigned curIndex = 0;
|
||||
for (ConnectionSet_t::iterator it = mActiveHosts[1].begin(); it != mActiveHosts[1].end(); it++, curIndex++)
|
||||
for (ConnectionSet_t::iterator it = mActiveHosts[1].begin(); it != mActiveHosts[1].end(); ++it, ++curIndex)
|
||||
{
|
||||
if (hashIndex == curIndex)
|
||||
{
|
||||
@@ -399,7 +399,7 @@ namespace NAMESPACE
|
||||
if (mTimeoutTimer != currentTime)
|
||||
{
|
||||
TimeoutMap_t::iterator iterator;
|
||||
for (iterator = mTimeoutMap.begin(); iterator != mTimeoutMap.end(); iterator++)
|
||||
for (iterator = mTimeoutMap.begin(); iterator != mTimeoutMap.end(); ++iterator)
|
||||
{
|
||||
TimeoutList_t & timeoutList = iterator->second;
|
||||
while (!timeoutList.empty() && timeoutList.front().second < currentTime)
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace soe
|
||||
Update(input);
|
||||
}
|
||||
|
||||
vector<int> MD5::Decode(vector<char> achar0, int i, int j)
|
||||
vector<int> MD5::Decode(const vector<char> &achar0, int i, int j)
|
||||
{
|
||||
vector<int> ai(16,0);
|
||||
int l;
|
||||
@@ -61,7 +61,7 @@ namespace soe
|
||||
return ai;
|
||||
}
|
||||
|
||||
vector<char> MD5::Encode(vector<int> ai, int i)
|
||||
vector<char> MD5::Encode(const vector<int> &ai, int i)
|
||||
{
|
||||
vector<char> achar0(i,0);
|
||||
int k;
|
||||
@@ -127,7 +127,7 @@ namespace soe
|
||||
finalsNull = true;
|
||||
}
|
||||
|
||||
void MD5::Transform(State & state1, vector<char> achar0, int i)
|
||||
void MD5::Transform(State & state1, const vector<char> &achar0, int i)
|
||||
{
|
||||
int j = state1.state[0];
|
||||
int k = state1.state[1];
|
||||
@@ -211,7 +211,7 @@ namespace soe
|
||||
Update(achar0, 1);
|
||||
}
|
||||
|
||||
void MD5::Update(State & state1, vector<char> achar0, int i, int j)
|
||||
void MD5::Update(State & state1, const vector<char> &achar0, int i, int j)
|
||||
{
|
||||
finalsNull = true;
|
||||
if (j - i > (int)achar0.size())
|
||||
@@ -245,7 +245,7 @@ namespace soe
|
||||
}
|
||||
}
|
||||
|
||||
void MD5::Update(string s)
|
||||
void MD5::Update(const string &s)
|
||||
{
|
||||
vector<char> achar(s.size(),0);
|
||||
for (int i=0; i<(int)s.size(); i++)
|
||||
@@ -258,12 +258,12 @@ namespace soe
|
||||
Update(achar0, 0, achar0.size());
|
||||
}
|
||||
|
||||
void MD5::Update(vector<char> achar0, int i)
|
||||
void MD5::Update(const vector<char> &achar0, int i)
|
||||
{
|
||||
Update(state, achar0, 0, i);
|
||||
}
|
||||
|
||||
void MD5::Update(vector<char> achar0, int i, int j)
|
||||
void MD5::Update(const vector<char> &achar0, int i, int j)
|
||||
{
|
||||
Update(state, achar0, i, j);
|
||||
}
|
||||
|
||||
@@ -31,22 +31,22 @@ namespace soe
|
||||
void Init();
|
||||
std::vector<char> Final();
|
||||
void Update(char char0);
|
||||
void Update(State & state1, std::vector<char> achar0, int i, int j);
|
||||
void Update(std::string s);
|
||||
void Update(State & state1, const std::vector<char> &achar0, int i, int j);
|
||||
void Update(const std::string &s);
|
||||
void Update(std::vector<char> achar0);
|
||||
void Update(std::vector<char> achar0, int i);
|
||||
void Update(std::vector<char> achar0, int i, int j);
|
||||
void Update(const std::vector<char> &achar0, int i);
|
||||
void Update(const std::vector<char> &achar0, int i, int j);
|
||||
std::string asHex();
|
||||
static std::string asHex(std::vector<char> achar0);
|
||||
|
||||
private:
|
||||
std::vector<int> Decode(std::vector<char> achar0, int i, int j);
|
||||
std::vector<char> Encode(std::vector<int> ai, int i);
|
||||
std::vector<int> Decode(const std::vector<char> &achar0, int i, int j);
|
||||
std::vector<char> Encode(const std::vector<int> &ai, int i);
|
||||
int FF(int i, int j, int k, int l, int i1, int j1, int k1);
|
||||
int GG(int i, int j, int k, int l, int i1, int j1, int k1);
|
||||
int HH(int i, int j, int k, int l, int i1, int j1, int k1);
|
||||
int II(int i, int j, int k, int l, int i1, int j1, int k1);
|
||||
void Transform(State & state1, std::vector<char> achar0, int i);
|
||||
void Transform(State & state1, const std::vector<char> &achar0, int i);
|
||||
int rotate_left(int i, int j);
|
||||
int uadd(int i, int j);
|
||||
int uadd(int i, int j, int k);
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ BasicConfig::~BasicConfig()
|
||||
|
||||
void BasicConfig::Push(const soe::NameValuePairs_t & paramValuePairs)
|
||||
{
|
||||
for (soe::NameValuePairs_t::const_iterator pIter = paramValuePairs.begin(); pIter != paramValuePairs.end(); pIter++)
|
||||
for (soe::NameValuePairs_t::const_iterator pIter = paramValuePairs.begin(); pIter != paramValuePairs.end(); ++pIter)
|
||||
{
|
||||
Set(pIter->name, pIter->value);
|
||||
}
|
||||
@@ -40,7 +40,7 @@ void BasicConfig::Pull(soe::NameValuePairs_t & paramValuePairs) const
|
||||
size_t index = paramValuePairs.size();
|
||||
|
||||
paramValuePairs.resize(index + mParamMap.size());
|
||||
for (ConfigMap_t::const_iterator pIter = mParamMap.begin(); pIter != mParamMap.end(); pIter++, index++)
|
||||
for (ConfigMap_t::const_iterator pIter = mParamMap.begin(); pIter != mParamMap.end(); ++pIter, ++index)
|
||||
{
|
||||
paramValuePairs[index].name = pIter->first;
|
||||
paramValuePairs[index].value = pIter->second.first;
|
||||
|
||||
@@ -79,7 +79,7 @@ int CmdLine::SplitLine(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
arg = "";
|
||||
arg.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ int CmdLine::SplitLine(int argc, char **argv)
|
||||
CmdParam cmd;
|
||||
|
||||
// only add non-empty args
|
||||
if (arg != "")
|
||||
if (!arg.empty())
|
||||
{
|
||||
cmd.m_strings.push_back(arg);
|
||||
}
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@ namespace soe
|
||||
return 0;
|
||||
}
|
||||
size_t index = 0;
|
||||
for (typename std::map<K, T>::const_iterator iter = data.begin(); iter != data.end(); iter++, index++)
|
||||
for (typename std::map<K, T>::const_iterator iter = data.begin(); iter != data.end(); ++iter, ++index)
|
||||
{
|
||||
elementBytes = Write(stream+bytes, size-bytes, iter->second, version);
|
||||
if (!elementBytes) {
|
||||
@@ -621,7 +621,7 @@ namespace soe
|
||||
virtual void ClearMembers()
|
||||
{
|
||||
typename MemberScribeVector_t::const_iterator memberIter;
|
||||
for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); memberIter++)
|
||||
for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); ++memberIter)
|
||||
{
|
||||
MemberScribe_t * pMemberScribe = *memberIter;
|
||||
delete pMemberScribe;
|
||||
@@ -655,7 +655,7 @@ namespace soe
|
||||
unsigned bytesTotal = 0;
|
||||
typename MemberScribeVector_t::const_iterator memberIter;
|
||||
|
||||
for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); memberIter++)
|
||||
for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); ++memberIter)
|
||||
{
|
||||
MemberScribe_t * pMemberScribe = *memberIter;
|
||||
|
||||
@@ -688,7 +688,7 @@ namespace soe
|
||||
unsigned bytesTotal = 0;
|
||||
typename MemberScribeVector_t::const_iterator memberIter;
|
||||
|
||||
for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); memberIter++)
|
||||
for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); ++memberIter)
|
||||
{
|
||||
const MemberScribe_t * pMemberScribe = *memberIter;
|
||||
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ inline typename AutoDeltaSet<ValueType, ObjectType>::const_iterator AutoDeltaSet
|
||||
// @note apathy - hack to convert from const_iterator to iterator as requried by STLPort
|
||||
typename SetType::iterator tmp(m_set.begin());
|
||||
std::advance(tmp, std::distance<const_iterator>(tmp, i));
|
||||
i++;
|
||||
++i;
|
||||
m_set.erase(tmp);
|
||||
|
||||
touch();
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ void MarketAuctionsBufferCreate::setMarketAuctions(const NetworkId &itemId, cons
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void MarketAuctionsBufferCreate::setMarketAuctions(const NetworkId &itemId, const NetworkId &ownerId, const NetworkId &creatorId, const NetworkId &locationId, const int minBid, const int buyNowPrice, const int auctionTimer, std::vector<std::pair<std::string, Unicode::String> > const & attributes, const Unicode::String userDescription, const int category, const int itemTemplateId, const Unicode::String itemName, const int itemTimer, const int active, const int itemSize)
|
||||
void MarketAuctionsBufferCreate::setMarketAuctions(const NetworkId &itemId, const NetworkId &ownerId, const NetworkId &creatorId, const NetworkId &locationId, const int minBid, const int buyNowPrice, const int auctionTimer, std::vector<std::pair<std::string, Unicode::String> > const & attributes, const Unicode::String &userDescription, const int category, const int itemTemplateId, const Unicode::String &itemName, const int itemTimer, const int active, const int itemSize)
|
||||
{
|
||||
DBSchema::MarketAuctionsRow *row=findRowByIndex(itemId);
|
||||
if (!row)
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
DBSchema::MarketAuctionsRow * findRowByIndex (const NetworkId &itemId);
|
||||
|
||||
void setMarketAuctions (const NetworkId &itemId, const NetworkId &ownerId, const int active);
|
||||
void setMarketAuctions (const NetworkId &itemId, const NetworkId &ownerId, const NetworkId &creatorId, const NetworkId &locationId, const int minBid, const int buyNowPrice, const int auctionTimer, std::vector<std::pair<std::string, Unicode::String> > const & attributes, const Unicode::String userDescription, const int category, const int itemTemplateId, const Unicode::String itemName, const int itemTimer, const int active, const int itemSize);
|
||||
void setMarketAuctions (const NetworkId &itemId, const NetworkId &ownerId, const NetworkId &creatorId, const NetworkId &locationId, const int minBid, const int buyNowPrice, const int auctionTimer, std::vector<std::pair<std::string, Unicode::String> > const & attributes, const Unicode::String &userDescription, const int category, const int itemTemplateId, const Unicode::String &itemName, const int itemTimer, const int active, const int itemSize);
|
||||
void removeMarketAuctions (const NetworkId &itemId);
|
||||
virtual void removeObject (const NetworkId &object);
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ void SwgLoader::verifyCharacterFinished (TaskVerifyCharacter *task)
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void SwgLoader::locateStructure(const NetworkId &structureId, const std::string whoRequested)
|
||||
void SwgLoader::locateStructure(const NetworkId &structureId, const std::string &whoRequested)
|
||||
{
|
||||
TaskLocateStructure *task = new TaskLocateStructure(structureId, whoRequested);
|
||||
taskQ->asyncRequest(task);
|
||||
|
||||
@@ -32,7 +32,7 @@ class SwgLoader : public Loader
|
||||
virtual void verifyCharacter(StationId suid, const NetworkId &id, const TransferCharacterData *);
|
||||
virtual void update(real updateTime);
|
||||
void verifyCharacterFinished (TaskVerifyCharacter *task);
|
||||
virtual void locateStructure(const NetworkId &structureId, const std::string whoRequested);
|
||||
virtual void locateStructure(const NetworkId &structureId, const std::string &whoRequested);
|
||||
|
||||
private:
|
||||
virtual LoaderSnapshotGroup *makeLoaderSnapshotGroup(uint32 processId);
|
||||
|
||||
@@ -163,17 +163,17 @@ ConfigCombatEngine::SkeletonAttackMod skeletonAttackMod;
|
||||
{
|
||||
m_data.numberSkeletons = file.read_uint8() + 1;
|
||||
// set up all-body skeleton
|
||||
bodyAttackMod.name = "";
|
||||
bodyAttackMod.modelBoneName = "";
|
||||
bodyAttackMod.name.clear();
|
||||
bodyAttackMod.modelBoneName.clear();
|
||||
bodyAttackMod.toHitChance = 100;
|
||||
bodyAttackMod.toWoundBonus = 0;
|
||||
bodyAttackMod.combatSkeletonBone = 0;
|
||||
bodyAttackMod.damageBonus[Attributes::Health] = 0;
|
||||
bodyAttackMod.damageBonus[Attributes::Action] = 0;
|
||||
bodyAttackMod.damageBonus[Attributes::Mind] = 0;
|
||||
skeletonAttackMod.name = "";
|
||||
skeletonAttackMod.name.clear();
|
||||
skeletonAttackMod.numHitLocations = 1;
|
||||
skeletonAttackMod.script = "";
|
||||
skeletonAttackMod.script.clear();
|
||||
skeletonAttackMod.attackMods.clear();
|
||||
skeletonAttackMod.attackMods.push_back(bodyAttackMod);
|
||||
m_data.skeletonAttackMods.push_back(skeletonAttackMod);
|
||||
|
||||
Reference in New Issue
Block a user