.UnlockAll() works bad (freezing server for 15000 ms), i finded a way to make it smarter
It takes only 15-70 ms, x1000 faster, enjoy ^^Code:private List<int> bplist = new List<int>(); private void OnServerInitialized() { foreach (var item in ItemManager.bpList) { bplist.Add(item.targetItem.itemid); } } private void UnlockAll(BasePlayer player) // From rust code { var playerInfo = SingletonComponent<ServerMgr>.Instance.persistance.GetPlayerInfo(player.userID); playerInfo.unlockedItems = bplist; SingletonComponent<ServerMgr>.Instance.persistance.SetPlayerInfo(player.userID, playerInfo); player.SendNetworkUpdate(); }
Solved Giving all blueprints (15ms)
Discussion in 'Rust Development' started by Garbage Collector, Aug 6, 2018.
-
How do I use this? Sorry im not a programmer
I've been looking to fix the BlueprintManager lag for ages and I hope this will but im not sure what I do, do i save this as BlueprintManager.cs and overwrite or what should I do with this? -
how do u apply this code and where in the bp manager file?
-
am i correct @Garbage Collector just throw this into notepad and save as whatever.cs and it will autoload? if not you might want to just upload a .cs file to make it easier for everyone that keeps asking for this solution so that we don't have multiple threads
-
[DOUBLEPOST=1534179600][/DOUBLEPOST] -
-