mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-28 23:16:15 -04:00
well this is closer to correct but i think we may need to ALWAYS use "myProcessId" instead of the one from db
This commit is contained in:
@@ -3365,54 +3365,67 @@ jboolean JNICALL ScriptMethodsObjectInfoNamespace::canEquipWearable(JNIEnv * env
|
||||
|
||||
jboolean JNICALL ScriptMethodsObjectInfoNamespace::sendScriptVarsToProxies(JNIEnv * env, jobject self, jlong obj, jbyteArray buffer)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JNI::sendScriptVarsToProxies");
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JNI::sendScriptVarsToProxies");
|
||||
|
||||
jboolean res = JNI_FALSE;
|
||||
jboolean res = JNI_FALSE;
|
||||
|
||||
ServerObject * object = 0;
|
||||
if (obj != 0 && buffer != 0)
|
||||
{
|
||||
if (JavaLibrary::getObject(obj, object))
|
||||
{
|
||||
ProxyList const &proxyList = object->getExposedProxyList();
|
||||
if (!proxyList.empty())
|
||||
{
|
||||
std::vector<int8> data;
|
||||
if (ScriptConversion::convert(buffer, data))
|
||||
{
|
||||
if(data.size() > 0)
|
||||
{
|
||||
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())));
|
||||
ServerObject * object = 0;
|
||||
if (obj != 0 && buffer != 0)
|
||||
{
|
||||
if (JavaLibrary::getObject(obj, object))
|
||||
{
|
||||
ProxyList const &proxyList = object->getExposedProxyList();
|
||||
if (!proxyList.empty())
|
||||
{
|
||||
std::vector<int8> data;
|
||||
if (ScriptConversion::convert(buffer, data))
|
||||
{
|
||||
if(data.size() > 0)
|
||||
{
|
||||
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)
|
||||
{
|
||||
//syncServers.erase(myProcessId);
|
||||
syncServers.insert(authProcessId);
|
||||
}
|
||||
uint32 const myProcessId = GameServer::getInstance().getProcessId();
|
||||
uint32 const authProcessId = object->getAuthServerProcessId();
|
||||
|
||||
ServerMessageForwarding::begin(std::vector<uint32>(syncServers.begin(), syncServers.end()));
|
||||
|
||||
SynchronizeScriptVarDeltasMessage const deltasMessage(object->getNetworkId(), data);
|
||||
ServerMessageForwarding::send(deltasMessage);
|
||||
|
||||
ServerMessageForwarding::end();
|
||||
|
||||
res = JNI_TRUE;
|
||||
ProxyList syncServers;
|
||||
|
||||
for (auto i = proxyList.begin(); i!=proxyList.end(); ++i) {
|
||||
if (myProcessId != authProcessId) {
|
||||
if (*i != myProcessId) {
|
||||
syncServers.insert(*i);
|
||||
}
|
||||
} else {
|
||||
syncServers.insert(*i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
if (myProcessId != authProcessId && syncServers.find(authProcessId) == syncServers.end())
|
||||
syncServers.insert(authProcessId);
|
||||
|
||||
ServerMessageForwarding::begin(std::vector<uint32>(syncServers.begin(), syncServers.end()));
|
||||
|
||||
SynchronizeScriptVarDeltasMessage const deltasMessage(object->getNetworkId(), data);
|
||||
ServerMessageForwarding::send(deltasMessage);
|
||||
|
||||
ServerMessageForwarding::end();
|
||||
}
|
||||
res = JNI_TRUE;
|
||||
}
|
||||
}
|
||||
else{
|
||||
res = JNI_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
void JavaLibrary::unpackScriptVars(const ServerObject & target, const std::vector<int8> & buffer)
|
||||
|
||||
Reference in New Issue
Block a user