Skip to content

Add removeElementData client side - #4745

Open
ArranTuna wants to merge 13 commits into
multitheftauto:masterfrom
ArranTuna:removeElementData
Open

ArranTuna wants to merge 13 commits into
multitheftauto:masterfrom
ArranTuna:removeElementData

Conversation

@ArranTuna

@ArranTuna ArranTuna commented Mar 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #594

removeElementData can now be called on the client which actually deletes (rather than just sets to nil or false) an element data. It also sends a new packet type to the server and syncs it with clients.

Motivation

To actually delete element data so that nil or false isn't being unnecessarily synced to future clients.

Test plan

Although I didn't test with 2 PCs I used it on an object then reconnected to verify that new clients are no longer being synced a removed element data.

Edit: tested with 2 PCs and the remote players have the element data removed correctly.

removeElementData can now be called on the client which actually deletes (rather than just sets to nil or false) an element data. It also sends a new packet type to the server and syncs it with clients.
@ArranTuna
ArranTuna requested a review from a team as a code owner March 7, 2026 11:24
@FileEX FileEX added the enhancement New feature or request label Mar 9, 2026
@ArranTuna

ArranTuna commented Mar 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Tested everything with 2 PCs, fixed that client variable wasn't being sent to onElementDataChange when a client used removeElementData.

Comment thread Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp Outdated
Comment thread Server/mods/deathmatch/logic/CRPCFunctions.cpp Outdated
Comment thread Server/mods/deathmatch/logic/CRPCFunctions.cpp Outdated
Comment thread Server/mods/deathmatch/logic/CRPCFunctions.cpp Outdated
Comment thread Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp Outdated
Comment thread Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp Outdated
@ArranTuna

Copy link
Copy Markdown
Collaborator Author

I've made the requested changes and re-tested it.

Comment thread Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp Outdated
FileEX
FileEX previously approved these changes Apr 9, 2026
Comment thread Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp Outdated
Comment thread Server/mods/deathmatch/logic/CRPCFunctions.cpp Outdated
Comment thread Server/mods/deathmatch/logic/CRPCFunctions.cpp Outdated
Comment thread Server/mods/deathmatch/logic/CRPCFunctions.cpp Outdated
@ArranTuna

Copy link
Copy Markdown
Collaborator Author

Requested changes have been added and re-tested.

tederis
tederis previously approved these changes Apr 9, 2026
FileEX
FileEX previously approved these changes Apr 9, 2026
Comment thread Client/mods/deathmatch/logic/CNetAPI.h
Comment thread Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp Outdated

@qaisjp qaisjp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some feedback about how we can preserve ordering + reuse the same packet, instead of using a new packet.

@qaisjp

qaisjp commented May 11, 2026

Copy link
Copy Markdown
Member

Sorry! I know it can be frustrating to go through multiple rounds of review :(

@ArranTuna
ArranTuna dismissed stale reviews from tederis and FileEX via bca549b May 11, 2026 21:21
@ArranTuna

Copy link
Copy Markdown
Collaborator Author

Made it so the new RPC isn't needed, checked for compliance with coding guidelines, and re-tested.

@ArranTuna
ArranTuna requested a review from qaisjp May 11, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client-side removeElementData

4 participants