Fougerite Official

Fougerite Official 1.8.3C

No permission to download
  • HurtEvent weapon fixes.
  • GlitchFix should detect Small loot stacks in the pillars.

Player property got some new stuffs:
C#:
        public bool HasBlueprint(BlueprintDataBlock dataBlock)
        {
            if (this.IsOnline)
            {
                PlayerInventory invent = this.Inventory.InternalInventory as PlayerInventory;
                if (invent.KnowsBP(dataBlock))
                {
                    return true;
                }
            }
            return false;
        }

        public bool HasBlueprint(string name)
        {
            if (this.IsOnline)
            {
                foreach (BlueprintDataBlock blueprintDataBlock in this.Blueprints())
                {
                    if (name.ToLower().Equals(blueprintDataBlock.name.ToLower()))
                    {
                        return true;
                    }
                }
            }
            return false;
        }

        public ICollection<BlueprintDataBlock> Blueprints()
        {
            if (!this.IsOnline)
            {
                return null;
            }
            PlayerInventory invent = this.Inventory.InternalInventory as PlayerInventory;
            ICollection<BlueprintDataBlock> collection = new List<BlueprintDataBlock>();
            foreach (BlueprintDataBlock blueprintDataBlock in invent.GetBoundBPs())
            {
                collection.Add(blueprintDataBlock);
            }
            return collection;
        }
  • HurtEvent weapon fixes.
  • GlitchFix should detect Small loot stacks in the pillars.

Player property got some new stuffs:
C#:
        public bool HasBlueprint(BlueprintDataBlock dataBlock)
        {
            if (this.IsOnline)
            {
                PlayerInventory invent = this.Inventory.InternalInventory as PlayerInventory;
                if (invent.KnowsBP(dataBlock))
                {
                    return true;
                }
            }
            return false;
        }

        public bool HasBlueprint(string name)
        {
            if (this.IsOnline)
            {
                foreach (BlueprintDataBlock blueprintDataBlock in this.Blueprints())
                {
                    if (name.ToLower().Equals(blueprintDataBlock.name.ToLower()))
                    {
                        return true;
                    }
                }
            }
            return false;
        }

        public ICollection<BlueprintDataBlock> Blueprints()
        {
            if (!this.IsOnline)
            {
                return null;
            }
            PlayerInventory invent = this.Inventory.InternalInventory as PlayerInventory;
            ICollection<BlueprintDataBlock> collection = new List<BlueprintDataBlock>();
            foreach (BlueprintDataBlock blueprintDataBlock in invent.GetBoundBPs())
            {
                collection.Add(blueprintDataBlock);
            }
            return collection;
        }
  • Alright guys. For the first time i was able to catch the problem. OnDisconnected event didn't get executed sometimes. Since It had try catch It didn't print anything. I added a log debug message just for safety there. To fix this problem I had to modify Rust++, since that caused the error. OnDisconnect event now uses Server.Cache to avoid null exception errors. Update RustPP.dll and Fougerite.dll
  • As far as I have seen the players who had stranger names no longer have it. Turned out mike's player property updater works weird. I don't use that ,instead of that I now remove and re-add the player on connection to the cache. Should be working alright.
Sleeper object:
C#:
        public DeployableObject Object
        {
            get { return this._sleeper; }
        }

        public string OwnerID
        {
            get { return Object.ownerID.ToString(); }
        }

        public string OwnerName
        {
            get { return Object.ownerName; }
        }

        public Vector3 Location
        {
            get { return Object.transform.position; }
        }

        public float X
        {
            get { return Object.transform.position.x; }
        }

        public float Y
        {
            get { return Object.transform.position.y; }
        }

        public float Z
        {
            get { return Object.transform.position.z; }
        }

        public int InstanceID
        {
            get
            {
                return Object.GetInstanceID();
            }
        }
  • Fixed onconnection bugs
  • Added Mike's invention. Player.Cache. But instead of adding It to the player class I added It to Server class. Server.Cache is a Dictionary and gets updated on every connection, and stores players.
    C#:
    public static IDictionary<ulong, Fougerite.Player> Cache = new Dictionary<ulong, Fougerite.Player>();
    This Dictionary stores every player with his SteamID. Doing
    Code:
    Server.Cache[Player.UID]
    
    //OR
    
    Server.Cache[long(Player.SteamID)]
    Will return you the Player class. From that, you can access the Player's Structures, and all his entities. This method allows you to access player properties even if he is offline. Using this will not only make your code faster, but also ensures that you will not get null player properties back. However, you can't do a lot of things if the Player is offline, Fougerite won't let you send him anything due to the last update's IsOnline check, which hopefully bypasses RPC errors. Using the following properties are safe at any time:
    Code:
    Player.UID
    Player.GameID
    Player.SteamID
    Player.IP
    Player.Name
    Player.Sleeper
    Player.AtHome
    Player.Structures
    Player.Deployables
    Player.Shelters
    Player.Storage
    Player.Sleeper.Location
    Player.Fires
    I plan to create a class for the Sleeper myself which will handle most of the properties for the Player.Sleeper. But for now It stays Entity.
  • I modified the Timer Elapsed Event. I saw that FAC no longer causes RPC crash logs, but still causes Timer crash logs. I made a try catch, and the timer will log the error, and also tries to restart the timer if there was any error. Please test this. Keep looking at the logs.
  • Player properties were modified and Player.Sleeper added
  • @MasterPeace I'm now logging the player IP on connection.
I think That's what I did. More to come later.
  • IronPython module put in by myself, should have everything working in It even if It wasn't before. Plugin.Log now logs seconds too
  • Sqlite is for the next turn guys, since at this time me @DreTaX did the update and not mikec, probably when mikec comes back he will finalize It.
  • Turns out World.Spawn had no problems at all. Just incase I put It in try-catch. It returns an object, so you need to convert It to an entity by yourself. It means you would have to do:
Python:
__author__ = 'DreTaX'
__version__ = '1.0'
import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite
from Fougerite import Entity

class Blabla:

    def somemethod(self):
        spawnentity = World.Spawn(string prefab, Vector3 location, Quaternion rotation, int rep)
        entity = Entity(spawnentity)
In JavaScript It would look like this (I think, lel)
JavaScript:
function blabla() {
    var EntityClass = Util.TryFindReturnType("Entity");
    var spawnentity = World.Spawn(string prefab, Vector3 location, Quaternion rotation, int rep);
    var Entity = EntityClass(spawnentity);
}
  • I modified some stuffs in Zone3D, but I will still have to test that.
  • Player class got the implamantation that mikec planned for the next version. At every function, Fougerite will check if the player is online. If It isn't It won't do anything. THIS SHOULD avoid RPC errors. (Player.IsOnline property) (Mike's invention)
  • Player.Damage(float dmg) has been re-added.
  • Player.Health Setter is now back
  • Entity.Health Setter is now back
  • HurtEvent had LOTS OF MODIFICATIONS. I have to say I reverted to a before version and I remade most of the points. Hunting Bow should never appear as Unknown now. Da innovation comes now. All the other objects should be fine too. Notify me if It isn't.
  • Sleepers are now detected on hurtevent. Which means sleeper log will work now. I converted It to a Fougerite Entity, BUT BE WARNED. SleepingAvatar doesn't have a lot of properties. What I know for sure, Is that you can get the OwnerID of It. If you would like to know more, you should decompile the assembly and look at the properties. Calling: Entity.Object will return you the SleepingAvatar object. NOTE: Sleepers are detected On_PlayerHurtEvent
  • HurtEvent.Sleeper was added. It returns True if the victim is a Sleeper.
  • DamageLog was disabled on HurtEvent. No more log spamming.
  • WildLifeManager Error flood patcher inclused in the fougerite patcher.
Sorry about that. Got carried away.
  • Just uploaded the zip to the fougerite servers. Nothing new yet.