Fougerite Official

Fougerite Official 1.9.2

No permission to download
  • 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
Forgot to update Rust++ dll. Its updated.

FallDamageEvent:


JavaScript:
function On_FallDamage(FallDamageEvent) {
    FallDamageEvent.Cancel();
}
Code:
function On_FallDamage(FallDamageEvent)
    FallDamageEvent:Cancel()
end
Python:
def On_FallDamage(self, FallDamageEvent):
    FallDamageEvent.Cancel()
C#:
public void FallDamage(FallDamageEvent fde) {
    fde.Cancel();
}
ItemPickupEvent:

Python:
def On_ItemPickup(self, ItemPickupEvent):
    ItemPickupEvent.Cancel()
JavaScript:
function On_ItemPickup(ItemPickupEvent) {
    ItemPickupEvent.Cancel();
}
Code:
function On_ItemPickup(ItemPickupEvent)
    ItemPickupEvent:Cancel()
end
C#:
public void ItemPickup(ItemPickupEvent ipe) {
    ipe.Cancel();
}

  • Rust++ God uses falldamage hook now
  • Little Fougerite modifications
Don't expect major updates until next week. Wish me luck for my exams instead :D
FallDamageEvent:

JavaScript:
function On_FallDamage(FallDamageEvent) {
    FallDamageEvent.Cancel();
}
Code:
function On_FallDamage(FallDamageEvent)
    FallDamageEvent:Cancel()
end
Python:
def On_FallDamage(self, FallDamageEvent):
    FallDamageEvent.Cancel()
C#:
public void FallDamage(FallDamageEvent fde) {
    fde.Cancel();
}
ItemPickupEvent:

Python:
def On_ItemPickup(self, ItemPickupEvent):
    ItemPickupEvent.Cancel()
JavaScript:
function On_ItemPickup(ItemPickupEvent) {
    ItemPickupEvent.Cancel();
}
Code:
function On_ItemPickup(ItemPickupEvent)
    ItemPickupEvent:Cancel()
end
C#:
public void ItemPickup(ItemPickupEvent ipe) {
    ipe.Cancel();
}
  • Rust++ God uses falldamage hook now
  • Little Fougerite modifications
Don't expect major updates until next week. Wish me luck for my exams instead :D
  • Like
Reactions: MasterPeace
  • Like
Reactions: MasterPeace
  • Lua Module Updated
  • Jint Module Updated
  • Magma Module Updated
  • Python Module Updated
  • Fougerite Core Updated

  • Modules are now Displaying the Author, Version, and About on load. You just need to define some stuffs at the top of the plugin and you are good to go (If these are missing the Author will be Unknown and the version will be 1.0):
Python:
__author__ = "DreTaX"
__version__ = "1.0"
__about__ = "Awesome plugin"
JavaScript:
var Author = "DreTaX";
var Version = "1.0";
var About = "Awesome Plugin";
Code:
local Author = "DreTaX"
local Version = "1.0"
local About = "Awesome Plugin"
  • All the plugins are now collected to a Global Class which is available from all the modules by simply accessing: PluginCollector.XYZ()
  • net.disconnect doesn't work if the player is not loaded yet, reverted, added new method.