Still working on my guest mode, i initially started hooking into the crafting menu and essentially cancelling the crafting queue. However... a smarter approach would probably involve making guest players forget all learned blueprints with the exception of the ones i allow.
Then when promoted they would receive the standard bluprints again.
Is there an elegant way to do this?
Learn/forget blueprints?
Discussion in 'Rust Development' started by Kyrah Abattoir, May 3, 2016.
-
I suggest reading existing plugins.
BlueprintManager for Rust | Oxide
Check out the BasePlayer.blueprints field with your decompiler.
BasePlayer.blueprints has the type PlayerBlueprints, which you can use to learn blueprints, for instance via PlayerBlueprints.Learn.
To remove blueprints you have to consider two different lists: Default blueprints and other blueprints.
The default blueprints can be retrieved from ItemManager.defaultBlueprints, see the source code of BlueprintManager on how to handle them.
For other blueprints you have to work with the PersistantPlayer type, which has a blueprints field and can be retrieved using the GetPlayerInfo method of the ServerMgr singleton instance.
You can retrieve the list of non-default blueprints a user with the ID uid has using ServerMgr.Instance.persistance.GetPlayerInfo(uid).blueprints.complete. -
So, do you have to strip all the default blueprints from the game first and then re-add them on a per player basis?
-
I'm gonna leave this on the side since blueprints might just go away.