mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-31 00:15:55 -04:00
cleanups
This commit is contained in:
@@ -230,7 +230,7 @@ void Persister::onFrameBarrierReached()
|
||||
for (ObjectSnapshotMap::iterator obj=m_objectSnapshotMap.begin(); obj!=m_objectSnapshotMap.end();)
|
||||
{
|
||||
if (obj->second == i->second)
|
||||
m_objectSnapshotMap.erase(obj++);
|
||||
obj = m_objectSnapshotMap.erase(obj);
|
||||
else
|
||||
++obj;
|
||||
}
|
||||
|
||||
@@ -643,7 +643,11 @@ void GameServer::connectToDatabaseProcess(std::string const &address, uint16 por
|
||||
void GameServer::createRemoteProxy(uint32 remoteProcessId, ServerObject *object)
|
||||
{
|
||||
|
||||
WARNING_STRICT_FATAL(!object, ("Told to create an object on %d we know nothing about!\n", remoteProcessId));
|
||||
if (!object) {
|
||||
WARNING(!object, ("Told to create an object on %d we know nothing about!\n", remoteProcessId));
|
||||
return;
|
||||
}
|
||||
|
||||
NetworkId objectId = object->getNetworkId();
|
||||
|
||||
DEBUG_REPORT_LOG(ConfigServerGame::getLogObjectLoading(),("createRemoteProxy(%lu,%s)\n",remoteProcessId, objectId.getValueString().c_str()));
|
||||
|
||||
@@ -3367,38 +3367,38 @@ void JNICALL ScriptMethodsObjectInfoNamespace::sendScriptVarsToProxies(JNIEnv *
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JNI::sendScriptVarsToProxies");
|
||||
|
||||
ServerObject * object = 0;
|
||||
if (obj != 0 && buffer != 0)
|
||||
{
|
||||
ServerObject *object = nullptr;
|
||||
if (JavaLibrary::getObject(obj, object) && object != nullptr)
|
||||
if (JavaLibrary::getObject(obj, object))
|
||||
{
|
||||
ProxyList proxyList(object->getExposedProxyList());
|
||||
ProxyList const &proxyList = object->getExposedProxyList();
|
||||
if (!proxyList.empty())
|
||||
{
|
||||
std::vector<int8> data;
|
||||
if (ScriptConversion::convert(buffer, data))
|
||||
std::vector<int8> data;
|
||||
if (ScriptConversion::convert(buffer, data))
|
||||
{
|
||||
if(data.size() > 0)
|
||||
{
|
||||
if(data.size() > 0)
|
||||
{
|
||||
WARNING(data.size() > 60000, ("JavaLibrary::sendScriptVarsToProxies: "
|
||||
"Packing scriptvars for object %s, packed data size = %d",
|
||||
|
||||
WARNING(data.size() > 60000, ("JavaLibrary::sendScriptVarsToProxies: "
|
||||
"Packing scriptvars for object %s, packed data size = %d",
|
||||
object->getNetworkId().getValueString().c_str(),
|
||||
static_cast<int>(data.size())));
|
||||
|
||||
uint32 const myProcessId = GameServer::getInstance().getProcessId();
|
||||
uint32 const authProcessId = object->getAuthServerProcessId();
|
||||
|
||||
ProxyList syncServers(proxyList);
|
||||
if (myProcessId != authProcessId)
|
||||
{
|
||||
proxyList.erase(myProcessId);
|
||||
proxyList.insert(authProcessId);
|
||||
syncServers.erase(myProcessId);
|
||||
syncServers.insert(authProcessId);
|
||||
}
|
||||
|
||||
ServerMessageForwarding::begin(std::vector<uint32>(proxyList.begin(), proxyList.end()));
|
||||
|
||||
ServerMessageForwarding::begin(std::vector<uint32>(syncServers.begin(), syncServers.end()));
|
||||
|
||||
SynchronizeScriptVarDeltasMessage const deltasMessage(object->getNetworkId(), data);
|
||||
|
||||
ServerMessageForwarding::send(deltasMessage);
|
||||
|
||||
ServerMessageForwarding::end();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,12 +325,8 @@ ObjvarBuffer::updateObjvars(const NetworkId &objectId, const std::vector <Dynami
|
||||
|
||||
void ObjvarBuffer::removeObject(const NetworkId &object) {
|
||||
DataType::iterator i = m_data.lower_bound(IndexKey(object, 0));
|
||||
while (i != m_data.end()) {
|
||||
if (i->first.m_objectId == object) {
|
||||
i = m_data.erase(i);
|
||||
} else {
|
||||
++i;
|
||||
}
|
||||
while (i != m_data.end() && i->first.m_objectId==object) {
|
||||
i = m_data.erase(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user