Fougerite Official

Fougerite Official 1.9.8

No permission to download
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.
  • Updating HurtEvent properties
  • New properties
  • Core Update
  • Patcher Update. Re-patch!
  • This update has little modifications, and I repatched the on connection event to a different place. Maybe this will solve the disconnect crashes, where the player is not connected fully yet, but disconnects.
  • Magma and Jint update
  • Jint Engine got the ini file methods that It was missing for some reason..
  • Magma Engine Fixes
  • Jint Engine Fixes
  • The above engines wont call the method in a plugin if it doesn't exist
  • Rust++ Got some extra stuffs such as /instakoall Flag: CanInstaKOAll (Don't forget to put instakoall=true in the config!)
  • Rust++ got some Addflag/Removeflag/Kill/Reload Command fixes
  • Fougerite code fixes
  • Like
Reactions: Demo and PearlJ
  • Like
Reactions: Demo and PearlJ
  • RustPPExtension received some more API
  • Little fixes, maybe about mute too?
  • Github updated