-
Notifications
You must be signed in to change notification settings - Fork 17
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
ClearUtils.clearProjectiles(client); #51
Comments
That seems like a good addition. It seems like a client-state synchronisation issue similar to #41. Is it better to send the server the information on the projectile upon switching or is it better to attempt to remove it? |
Transferring the projectiles over is nearly impossible: Even if the client is able to keep the owner+ident combo of the projectiles, the chances that the global(server) projectile id is unused in the new dimension are pretty slim. |
I don't think that's how it works from what I remember. The client decides on an id, and that is bound with their player id (what you said about owner+ident) to identify projectiles, the server will search through its array until it finds that combination for any projectile updates, I don't remember any server-side projectile id. I don't know how that interacts with the client when their player id changes though. Buff-based projectiles may be respawned, but do you get things like the Solar Flare shield getting reset? That might be problematic. |
Also each client knows about the projectiles of other players. And when you jump dimensions those "other" projectiles will just lay dormant in the client memory. (That is if the client doesn't have one global 1000 projectiles array and instead keeps arrays for each player... Which I doubt) |
Solar Flare isn't a projectile but rather client-side Dust(s). Works directly off of Buffs (type 170, 171, 172). |
How about minions? Does that reset the minions spawned? |
Minions are projectiles, so yes. And might be for the better since the new dimension might have different inventory/permissions. |
Yes but I don't believe that should be the responsibility of Dimensions. The server itself could easily remove them on the case that it doesn't want them. It would be especially annoying in the case that no SSC is involved, and the user is constantly getting their minions removed. |
Constantly? I guess there's a use case involving a LOT of dimension shifts. |
I'm just not sure how the server will react to new projectiles a mile away from where the player appears or even off the map if the world size is different. |
Would it be possible to add a config option for the switcher to either push the projectiles over or to kill them? If the target dimension is SSC and the transferred projectiles don't line up with their SSC inventory it could trigger an anti-cheat. |
Well a config option might work, because that way the host can choose which one fits what they're doing best. May also be possible to give the option to clear "always" or "ssc", so that they can enable it for SSC only? Since that sounds like the biggest reason to use clearing. |
Great idea since you can detect if the target dimension is in SSC mode 👍 |
I assume that you're not up for programming it, so I self assigned it but if I am wrong then I'd be welcoming to a PR that adds it, since I don't have a lot of time to work on it. |
I've never used typescript/javascript so you clearly have more expertise in this. |
I know it's been a while and I've not worked on it yet, I'm hoping that I can get around to it soon once I have time off. |
You can test the build using the zip at #56 and let me know if that does what you want yet. It keeps track of client projectiles and will send destroy projectile for each active projectile to the client when receiving world info while switching. |
Oh and I forgot to mention that you need to add the following to the config:
|
The problem with "keep" is that you can't guarantee that the target dimension will have free/enough projectile slots. They are hardcoded to 1000 slots and run out very quickly with a couple of players. Mostly only possible for small minigame-like dimensions. |
Is it possible to add such function and call it at around https://github.com/popstarfreas/Dimensions/blob/dev/node_modules/dimensions/clientcommandhandler.ts#L51 ?
Known bad situation:
Thank you.
The text was updated successfully, but these errors were encountered: