SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
86 stars 18 forks source link

[Feature Request] Client and Server side connection Modhook/Component #2344

Closed DerpyHoowes closed 3 years ago

DerpyHoowes commented 3 years ago

A modhook, which will enable some prefab in the Clip prefab on server, perhaps the one that has some receiver modhook attached to it, and the same thing but to make the client-side prefab receive input from server-side prefab. Currently there are only two ways to establish a connection between Client and Server: Collision Hook + effect spawner, spawning an effect with collider tagged and layered Player for Server -> Client connection, and ClientTextChatMessenger hook + TextChatEventHook for Client -> Server connection. Both aren't good enough, because first one wont work if you're trying to use it with vehicles, because effect always stays in place and overall its too dependent on the position of certain prefabs. Second is very bulky, because you cant just hide the text that modhook sends to the server (unless people use the glitch that Alex found, but which always leaves errors in the server console, and no server owner would like that). Also its unreliable because if the player knows the codephrase you're using with this method, he can abuse the system. And you cant really replace it with the first method, because effect spawner on the client side wont spawn the effect on the server.

For the vehicles we could at least get server-side input for sirens, and that would be more than enough. And I know, Nelson, you'll probably reply with it being low priority and to-be-added to Unturned II, but we still have to play Unturned 3.0 here, and making at least a bit original and advanced mods is very hard due to this lack of tools that we're having here, especially for the vehicles (even though in fact they're the most customizable objects in Unturned when it comes to their movement). People are trying to turn unturned workshop into a place with interesting content, instead of a place full of hundreds of similar gun mods and I believe that its very important. You said you're afraid of the way people use new features, like the CollisionHook, well, you cant blame us for trying to make the game more advanced and add something new to it...

SDGNelson commented 3 years ago

This is the sort of thing that will become possible after the netcode rewrites this year. Currently modhooks have no way to communicate between client and server, but that will change. There was already some discussion on one of Alex's issues before about improving the collision trigger that way.

You said you're afraid of the way people use new features, like the CollisionHook

My concern was about people using it in unintended ways which will break in the future. The modhooks will have to be backwards compatible for many years, so I am cautious.