Boss persist after server restart?Suggestion
Is there any way to make the boss persist after the server restarts?  I've got it working where the boss can disconnect, but I'd like to find some way to make it persist until taken away by another player.
In response to shitgibbon ():
Is there any way to make the boss persist after the server restarts?  I've got it working where the...
I'll take a look at it all.
If you could send me your little snippet of code to make it work after disconnect, I can figure something out.

The bit for the disconnect is just one of the variables in the config file, "AllowBossDisconnect:" true.  I've included that here, and as near as I can tell, below that is the section of the .cs that makes that work.  I could be mistaken, though, so please consume with salt.

{
  "AllowBossDisconnect": true,
  "AutoBossPromoteDelay": 300,
  "AutoBossPromoteMinPlayers": 3,
  "BossPositionNotifierEnabled": true,
  "BossPositionNotifierInterval": 120,
  "DecoyPrice_Item": "metal.refined",
  "DecoyPrice_Quantity": 50,
  "EvadePrice_Item": "leather",
  "EvadePrice_Quantity": 1000,
  "FallbackWorldSize": 3000,
  "HeliStrikePrice_Item": "metal.refined",
  "HeliStrikePrice_Quantity": 100,
  "HelpNotifierEnabled": true,
  "HelpNotifierInverval": 300,
  "MaxHelis": 2
}



        void OnPlayerDisconnected(BasePlayer player, string reason)
        {
            if(player == State.Boss && !GameConfig.AllowBossDisconnect)
            {
                PrintToChat("The Boss has been sacked for sleeping on the job, feel free to /claim it");
                State.SetBoss(null);
            }
        }

        #region Integration Point
        public BasePlayer Boss
        {
            get { return State.Boss; }
        }
        #endregion
    }
}

namespace DevilsIsland
{    
    public class DevilsIslandState : IGameState
    {
        public DevilsIslandState()
        {
            Outlaws = new Outlaws();
            Henchmen = new Henchmen();
            PendingRequest = new List<BasePlayer>();
        }
        
        public void AttachConfig(IGameConfig configFile)
        {
            this.config = (DevilsIslandConfig)configFile;
        }

        private DevilsIslandConfig config = null;
        
        private BasePlayer currentBoss = null;
        internal DateTime noBossSince = DateTime.Now;

        private float taxRate = 0.1f;
        private Dictionary<ItemDefinition, float> coffers = new Dictionary<ItemDefinition, float>();

        // Some of the method here might seem redundant (i.e. IsBoss, IsNotBoss), but their
        // purpose is to make the code more readable.

        #region Boss

        public bool NoBoss()
        {
            return currentBoss == null;
        }

        public bool BossExists()
        {
            return currentBoss != null;
        }

        public bool IsBoss(BasePlayer player)
        {
            return player == currentBoss;
        }

        public bool IsNotBoss(BasePlayer player)
        {
            return player != currentBoss;
        }

        public BasePlayer Boss { get { return currentBoss; } }

        public string BossName { get { return currentBoss == null ? "no boss" : currentBoss.displayName;  } }

        public void SetBoss(BasePlayer newBoss)
        {
            if(currentBoss != newBoss)
            {
                currentBoss = newBoss;
                if (currentBoss == null)
                    noBossSince = DateTime.Now;
                Outlaws.Clear();

                PendingRequest.Clear();

                foreach (Henchman hench in Henchmen.All())
                    hench.Player.inventory.Strip();

                Henchmen.Clear();
                LootContainer = null;
            }
        }

        public bool TryForceNewBoss()
        {
            if (BossExists() || BasePlayer.activePlayerList.Count() < config.AutoBossPromoteMinPlayers)
                return false;

            if(DateTime.Now > noBossSince.AddSeconds(config.AutoBossPromoteDelay))
            {                
                int newBossIndex = Oxide.Core.Random.Range(BasePlayer.activePlayerList.Count());
                SetBoss(BasePlayer.activePlayerList.Skip(newBossIndex).First());
                return true;
            }

            return false;
        }

        #endregion
In response to Default ():
I'll take a look at it all.
If you could send me your little snippet of code to make it work af...
I totally forgot to tag you in my original reply. Code's just above here.
In response to shitgibbon ():
I totally forgot to tag you in my original reply. Code's just above here.
Users get replies (automatically watch) for threads they've replied in (as long as they didn't unwatch it), so mentions or quotes aren't always necessary.
In response to shitgibbon ():
I totally forgot to tag you in my original reply. Code's just above here.
All good, I've been super busy lately.
Just upgraded my PC, and had to reformat all my hard drives, so I don't have the tools to start developing plugins at the current moment.
But I am looking to start work on everything in the very short future.
In response to shitgibbon ():
I totally forgot to tag you in my original reply. Code's just above here.
Hi, sorry it took so long for me to respond.
Over the next upcoming days I'll take a look at this.
My computer keeps on deleting a file required to boot Windows, so I keep having to reinstall windows and it's been one hell of a time.
Thanks you for that little snippet that you provided, and I'll work on what you would like to see.
I had a somewhat completed version available for people, but wasn't able to publish it before I wiped my computer a month or two ago.
Just finished our first full wipe with the plugin in its current state.  Players love the added depth of play, but no one really fights over the boss title, because it's impossible to hold it beyond the daily update. Definitely looking forward to where this goes.  :)  Thank you so much for your time, your effort, and looking into this.  If I can be of service in any way, definitely let me know!
In response to shitgibbon ():
Just finished our first full wipe with the plugin in its current state.  Players love the added dept...
Hopefully once I iron out a few things, the boss title will be much more rewarding, causing players to really fight over it more.
If you have any suggestions please let me know!
Actually, one thing that would be pretty neat would be if the Boss position added/removed a player from a permission group. That would give neat things like the Boss getting access to particular kits, access to the Lifestealer plugin, and so on. With it being linked to a permission, that might also resolve the persistance over server restart issues, too!
In response to shitgibbon ():
Actually, one thing that would be pretty neat would be if the Boss position added/removed a player f...
I can do something like that.
I'm actually sitting in my coding class with another plugin open right now.
I'll work on it right now.