Fougerite Official

Fougerite Official 1.9.7

No permission to download
  • Fixed Loom variable being Null (Fougerite.dll)
  • Rust++ Shutdown fixes, and some additions.
  • Fougerite Code fixes.
  • Updated Fougerite.dll, ensuring unthreaded save at shutdown.
  • Fixed NullReference Error at RPCFix method
  • Added Threading to Server's AutoSave to @PearlJ 's request. The server will not show the message of the saved objects, It will be in the log files, but there won't be a 3 seconds lagg atleast on large servers
  • Rust++ Code fixes
  • Fougerite Code fixes
  • Forgot to update all Module Dlls
  • Like
Reactions: -iZy- # Hard
  • Like
Reactions: -iZy- # Hard
  • Added new LootHook
  • Some Code fixes, will add examples soon.
  • Little Code fixes in Rust++ and Fougerite
  • Recompiled Fougerite.dll and Rust++.dll
  • Patcher Updated, Re-patch, or use the pre-patched dlls!
  • Rust++ Now uses a lot more gentle way to shutdown the server, instead of killing the process
  • Fixed Chat Event Cancelling, other plugins shouldn't conflict It once It was cancelled
  • Added Server Console Cancel Methods (Server Class)
  • Added a Steam Server Update parameter to the hooks (It may need a timer though to display the cracked users, lets just test It as It is now)
  • RPC Errors shall be handled by Fougerite now, It should be able to find the bugging player, and disconnect It (Keep Checking the logs for [Fougerite uLink] Please, and feedback about It.
  • This should fix the Loom Error causes, maybe?!
https://github.com/Notulp/Fougerite/commit/6dc14fa9c640dfda7d4dda8d0c287cbe38ff3720

https://github.com/Notulp/Fougerite/commit/176a41d5d48dd1a2328d1621d557eaf76da938c1
Introducing the Loom class, that is able to call unsafe methods from sub threads, on the main thread.

This update should clear out most of the dangerous crash messages, mostly caused by Player.Disconnect()

Testing with a C# timer, the log comes up with:

Code:
[5/13/2016 1:32:57 PM] [Error] Same? 6 - 1
[5/13/2016 1:32:57 PM] [Error] Nope, invoking
[5/13/2016 1:32:57 PM] [Error] Same? 1 - 1
The log shows that after detecting that the call is being made from a different thread, It starts doing It from the main one.

Testing with new Thread() at Connection event:

Code:
[5/13/2016 1:39:43 PM] [Error] Same? 6 - 1
[5/13/2016 1:39:43 PM] [Error] Nope, invoking
[5/13/2016 1:39:43 PM] [Error] Same? 1 - 1
Same results.

Code that was used to test this:

C#:
public void Disconnect()
        {
            if (this.IsOnline)
            {
                Logger.LogError("Same? " + Thread.CurrentThread.ManagedThreadId + " - " +  Bootstrap.CurrentThread.ManagedThreadId);
                if (Thread.CurrentThread.ManagedThreadId != Bootstrap.CurrentThread.ManagedThreadId)
                {
                    Logger.LogError("Nope, invoking");
                    Loom.QueueOnMainThread(() => {
                        Disconnect();
                    });
                    return;
                }
                Server.GetServer().RemovePlayer(uid);
                this.ourPlayer.netUser.Kick(NetError.Facepunch_Kick_RCON, false);
            }
        }
I added support for the Interpreters to use the Loom class, but I can't come up with an example for them yet...

Any other stuff that can cause the server to crash popup by using UnityEngine.Object.FindobjectsOfType... method should be calling the Loom class to avoid them.

I made some other changes that you can check out here:

https://github.com/Notulp/Fougerite/commit/45615eefd9d49033ff725d225c324e749c4911bd#diff-0f20521893282f654a5ce046948d2842L436

The loom class:

https://github.com/Notulp/Fougerite/blob/master/Fougerite/Fougerite/Loom.cs

When calling loom class, there is like a 0,1 second delay before performing the method, but It doesn't cause lagg.

Some thread API for the "Script" plugins:

https://github.com/Notulp/Fougerite/blob/master/Fougerite/Fougerite/Util.cs#L711