Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serverside objects move events #3379

Closed

Conversation

FileEX
Copy link
Contributor

@FileEX FileEX commented May 1, 2024

We have onClientObjectMoveStart and onClientObjectMoveStop events - This PR adds these events also for the server side.

The stoppedByScript parameter determines whether the object has been stopped using stopObject or has reached its destination

@FileEX
Copy link
Contributor Author

FileEX commented May 2, 2024

I had to change the way the onObjectStop event was triggered. This must be synchronized via a packet on the client side because on the server side StopMovement is not called when the object reaches its destination as this happens on the client side.

I also added the stoppedByScript parameter for the onClientObjectMoveStop event on the client side.

Copy link
Contributor

@TracerDS TracerDS left a comment

Choose a reason for hiding this comment

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

Good job

Client/mods/deathmatch/logic/CClientGame.cpp Outdated Show resolved Hide resolved
Client/mods/deathmatch/logic/CDeathmatchObject.cpp Outdated Show resolved Hide resolved
Client/mods/deathmatch/logic/CDeathmatchObject.cpp Outdated Show resolved Hide resolved
Server/mods/deathmatch/logic/CGame.cpp Outdated Show resolved Hide resolved
@FileEX FileEX requested review from tederis May 5, 2024 02:08
@TheNormalnij
Copy link
Contributor

TheNormalnij commented May 11, 2024

A packet from a client to notify server about this event is overkill.
onObjectMoveStart and onObjectMoveStop are pointless on server, because server has full control over created objects in scripts, and setTimer replaces onObjectMoveStop.
This realization still request setTimer, because onObjectMoveStop doesn't work on empty server. This can cause frustrating behavior and strange bugs in server scripts

@FileEX
Copy link
Contributor Author

FileEX commented May 12, 2024

So how to improve it?

@FileEX FileEX closed this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants