Longship icon indicating copy to clipboard operation
Longship copied to clipboard

[Feature Request] Auto delete spawned in items/objects if not in adminlist

Open b3ck opened this issue 5 years ago • 5 comments

Just looking for a little Anti-Cheat, right now as it stands anyone can spawn in any item/object into any server. The fix? well it's just an idea really, basically the server knows when a user spawns in an item/object, solution? check to see if that user is in the adminlist, and if not immediately delete said item/object.

I had someone look into this but they were unable to remove an object after spawning it into the world.. they said if the server could remove it then it would probably work.

Things they tried as a player:

call .DEtostry() on said object.

ZNetScene.instance.Destroy(base.gameObject);

Again they were unsuccessful but maybe the server doing it would work?

Kind Regards, -b3ck

b3ck avatar Feb 22 '21 10:02 b3ck

I actually have a crude way of doing this but I've only ever done it on my own player's inventory, never tried it on another player.

Player.m_localPlayer.GetInventory().RemoveItem(theItem)

Hi-ImKyle avatar Feb 22 '21 16:02 Hi-ImKyle

yeah it seems it would have to be done server-side, since when you spawn items/objects it first goes into the world.

b3ck avatar Feb 22 '21 19:02 b3ck

Hello, The problem here is that the server is absolutely not Authorative. That means that it turst every inputs that the player will give. Inventories seems to be managed on the client-side, so if a client can manipulate its own inventory, it can add any item to its inventory and drop them in the server.

There is no easy fix for that, I can't do anything about it right now without a massive amount of work (and it's clearly not the role of Longship to act as an anti-cheat), let's hope that the devs will rework their network system, because it is really not great right now ! (to be fair, all the game is really badly coded, that complicates my task to develop most systems I want to add to Longship)

AlexMog avatar Feb 22 '21 19:02 AlexMog

I've precised here #19 how the server handle player's inventory

AlexMog avatar Feb 23 '21 01:02 AlexMog

I guess I should have worded this differently, at this point I could careless about items, it's more about objects placed in the world that cannot be destroyed, if somehow there is a way to prevent this,: awesome! If not not worries just a thought I was having 🤔

b3ck avatar Feb 23 '21 01:02 b3ck