Skip to content

Fix for NRE on Essentials unload & Removed bad client join tweaks code#191

Merged
Bishbash777 merged 3 commits intoTorchAPI:masterfrom
Casimir255:master
Oct 17, 2021
Merged

Fix for NRE on Essentials unload & Removed bad client join tweaks code#191
Bishbash777 merged 3 commits intoTorchAPI:masterfrom
Casimir255:master

Conversation

@Casimir255
Copy link
Copy Markdown
Collaborator

Only remove events if the server fully started.

@Casimir255
Copy link
Copy Markdown
Collaborator Author

Originally fixed the NRE on essentials logs.

00:04:55.3946 [ERROR] Torch.Session.TorchSessionManager: System.NullReferenceException: Object reference not set to an instance of an object.
at Essentials.EssentialsPlugin.SessionChanged(ITorchSession session, TorchSessionState state) in C:\build\workspace\Torch_Essentials_master\Essentials\EssentialsPlugin.cs:line 146
at Torch.API.Session.TorchSessionStateChangedDel.Invoke(ITorchSession session, TorchSessionState newState)
at Torch.Session.TorchSessionManager.SessionUnloading() in C:\build\workspace\Torch_Torch_master\Torch\Session\TorchSessionManager.cs:line 158
System.NullReferenceException: Object reference not set to an instance of an object.

The above error throws when the game failed to load properly, and essentials tries to unload. This confuses users and blames essentials. Instead, allow essentials to only unload once it was fully initialized. Then the source of the error should still be thrown and investigated further than just the essentials error.

I removed the client join tweaks code. When enabled may be helpful for some, but most use cases just throws an error and then people complain in torch discord why they cant join their server. 9/10 issues in torch is because of this issue... Therefore I removed it.

Instead in its place, I added a client request WorldData cleaner. This removes/purges extra junk the target client doesnt need. Should reduce the sandbox size for sending to the client, and lets the game's code do the rest in parallel due to the recent changes in the client world request area.

@Casimir255 Casimir255 changed the title Fix for NRE on Essentials unload Aug 22, 2021
@dorimanx
Copy link
Copy Markdown

Thank you Casimir255 for this change, i agree with you, Client Tweaks should go, it's no longer used, and when used, only create issues that always resolved by "Disable this! and forget about it"
About reducing the size of sent data, it's can really help, i will do tests and if all looks OK, i will run this on our servers.

@dorimanx
Copy link
Copy Markdown

This change is running on our 6 servers for more than a moth! as it's good! no issues and login to server is improved, please merge this change for all!

@Bishbash777 Bishbash777 merged commit fdbab7b into TorchAPI:master Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants