diff --git a/Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp index c6af1fc2..069de24f 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp @@ -91,15 +91,40 @@ void plSDLModifier::ISendNetMsg(plStateDataRecord*& state, plKey senderKey, uint bool dirtyOnly = (sendFlags & plSynchedObject::kForceFullSend) == 0; bool broadcast = (sendFlags & plSynchedObject::kBCastToClients) != 0; int writeOptions=0; + // if (dirtyOnly) writeOptions |= plSDL::kDirtyOnly; if (broadcast) writeOptions |= plSDL::kBroadcast; - + writeOptions |= plSDL::kTimeStampOnRead; - - plNetClientMgr::GetInstance()->StoreSDLState(state, senderKey->GetUoid(), sendFlags, writeOptions); - + + + // send to server + plNetMsgSDLState* msg = state->PrepNetMsg(0, writeOptions); + msg->SetNetProtocol(kNetProtocolCli2Game); + msg->ObjectInfo()->SetUoid(senderKey->GetUoid()); + + if (sendFlags & plSynchedObject::kNewState) + msg->SetBit(plNetMessage::kNewSDLState); + + if (sendFlags & plSynchedObject::kUseRelevanceRegions) + msg->SetBit(plNetMessage::kUseRelevanceRegions); + + if (sendFlags & plSynchedObject::kDontPersistOnServer) + msg->SetPersistOnServer(false); + + if (sendFlags & plSynchedObject::kIsAvatarState) + msg->SetIsAvatarState(true); + + if (broadcast && plNetClientApp::GetInstance()) + { + msg->SetPlayerID(plNetClientApp::GetInstance()->GetPlayerID()); + } + + plNetClientApp::GetInstance()->SendMsg(msg); + msg->UnRef(); + fSentOrRecvdState = true; } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp index 2ff72f57..affd3489 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp @@ -437,34 +437,3 @@ int plNetClientMgr::SendMsg(plNetMessage* msg) return ret; } - - -void plNetClientMgr::StoreSDLState(const plStateDataRecord* sdRec, const plUoid& uoid, - uint32_t sendFlags, uint32_t writeOptions) -{ - // send to server - plNetMsgSDLState* msg = sdRec->PrepNetMsg(0, writeOptions); - msg->SetNetProtocol(kNetProtocolCli2Game); - msg->ObjectInfo()->SetUoid(uoid); - - if (sendFlags & plSynchedObject::kNewState) - msg->SetBit(plNetMessage::kNewSDLState); - - if (sendFlags & plSynchedObject::kUseRelevanceRegions) - msg->SetBit(plNetMessage::kUseRelevanceRegions); - - if (sendFlags & plSynchedObject::kDontPersistOnServer) - msg->SetPersistOnServer(false); - - if (sendFlags & plSynchedObject::kIsAvatarState) - msg->SetIsAvatarState(true); - - bool broadcast = (sendFlags & plSynchedObject::kBCastToClients) != 0; - if (broadcast && plNetClientApp::GetInstance()) - { - msg->SetPlayerID(plNetClientApp::GetInstance()->GetPlayerID()); - } - - SendMsg(msg); - delete msg; -}