Comments (5)
Damage Handler is located on the client side and this is where the onClientPedDamage event is sent and, depending on its status, the handler returns the result.
The server-side event works based on the synchronization packet, where the amount of HP is compared between packets. I think a reasonable solution would be to set the HP amount to something like "current HP + loss" if the event was canceled.
However, I don't know what happens when the ped/player dies? Then, despite the event being canceled, onPedWasted will be sent + the invicible bug will probably appear (#414 )
from mtasa-blue.
The sync packet covers a lot of information, not just health, so you can't just cancel it
mtasa-blue/Server/mods/deathmatch/logic/CPedSync.cpp
Lines 245 to 264 in 1f2c6e7
from mtasa-blue.
Damage Handler is located on the client side and this is where the onClientPedDamage event is sent and, depending on its status, the handler returns the result.
The server-side event works based on the synchronization packet, where the amount of HP is compared between packets. I think a reasonable solution would be to set the HP amount to something like "current HP + loss" if the event was canceled.
if the server sends packets to the client about ped damage then cancelEvent
should not send any synchronization packets and ignore everything. At least thats how I would see it to be the most reasonable and performant solution
However, I don't know what happens when the ped/player dies? Then, despite the event being canceled, onPedWasted will be sent + the invicible bug will probably appear (#414 )
Yeah we would need to check if loss >= currentHP and not run onPedWasted if the event was cancelled and ped died
I tried to implement it but its a lot of complicated work
from mtasa-blue.
if the server sends packets to the client about ped damage then
cancelEvent
should not send any synchronization packets and ignore everything. At least thats how I would see it to be the most reasonable and performant solution
We can't stop sending the sync packet and ignore everything. These packets concern general data synchronization between clients and the server, not just health. Canceling the sending of synchronization packets after canceling the event will cause desynchronization bugs
from mtasa-blue.
if the server sends packets to the client about ped damage then
cancelEvent
should not send any synchronization packets and ignore everything. At least thats how I would see it to be the most reasonable and performant solutionWe can't stop sending the sync packet and ignore everything. These packets concern general data synchronization between clients and the server, not just health. Canceling the sending of synchronization packets after canceling the event will cause desynchronization bugs
If its about health only then how would that cause desync with other players? For other ped related packets, sure. However if we are cancelling the damage event then only the packets responsible for ped's health should be ignored
from mtasa-blue.
Related Issues (20)
- MTA Session ID HOT 5
- mtasa.com wrong default version HOT 1
- Created markers has a mismatch collision HOT 1
- onClientDebugMessage/onDebugMessage recognize level 4 as 0 HOT 1
- isVehicleRespawnable & getVehicleRespawnDelay & getVehicleIdleRespawnDelay HOT 3
- Allow differentiating custom-level debug messages HOT 1
- Allow comma separated list for scriptdebugloglevel HOT 1
- Memory disconnection
- Ability to customize cullzone HOT 2
- dxDrawMaterialLine3D renders through buildings when heat haze is enabled and some other conditions are met HOT 8
- debugscript doesn't display outputDebugString level 4 at server-side
- Can't walk through dead ped's body on created object HOT 3
- The getPedAnimation function doesn't work in IFP.
- Server-side outputDebugString level 4 colors are broken
- addVehicleSirens not working correctly
- setPedEnterVehicle dimension issues HOT 3
- engineRestoreModelPhysicalPropertiesGroup restores wrong physical group
- Importing custom fonts does not work in Wine HOT 1
- Vehicles falling out of map becoming useless without syncer caused by new vehicle_contact_sync_radius HOT 2
- outputDebugString level 4 colors not working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mtasa-blue.