public static bool SavePlayerData(Player player)
        {
            //If using a flat based system ensure the MODE is stored
            string authName = null;
            if (Mode == CharacterMode.AUTH)
            {
                if (!String.IsNullOrEmpty(player.AuthenticatedAs))
                    authName = player.AuthenticatedAs;
            }
            else if (Mode == CharacterMode.UUID)
            {
                if (!String.IsNullOrEmpty(player.ClientUUId))
                    authName = player.ClientUUId + '@' + player.name;
            }

            if (!String.IsNullOrEmpty(authName))
            {
                if (Storage.IsAvailable)
                {
            //                    var create = player.GetPluginData<Boolean>(Key_NewCharacter, false);
                    var existingId = Tables.CharacterTable.GetCharacterId(Mode, player.AuthenticatedAs, player.ClientUUId);
                    if (existingId <= 0)
                    {
                        if (player.ClearPluginData(Key_NewCharacter))
                        {
                            var characterId = Tables.CharacterTable.NewCharacter
                            (
                                Mode,
                                player.AuthenticatedAs,
                                player.ClientUUId,
                                player.statLife,
                                player.statLifeMax,
                                player.statMana,
                                player.statManaMax,
                                player.SpawnX,
                                player.SpawnY,
                                player.hair,
                                player.hairDye,
                                player.hideVisual,
                                player.difficulty,
                                player.hairColor,
                                player.skinColor,
                                player.eyeColor,
                                player.shirtColor,
                                player.underShirtColor,
                                player.pantsColor,
                                player.shoeColor,
                                player.anglerQuestsFinished
                            );

                            if (characterId > 0)
                            {

                            }
                        }
                        else
                        {
                            ProgramLog.Error.Log("Failed to save SSC for player: {0}", player.Name);
                        }
                    }
                    else
                    {
                        Tables.CharacterTable.UpdateCharacter
                        (
                            Mode,
                            player.AuthenticatedAs,
                            player.ClientUUId,
                            player.statLife,
                            player.statLifeMax,
                            player.statMana,
                            player.statManaMax,
                            player.SpawnX,
                            player.SpawnY,
                            player.hair,
                            player.hairDye,
                            player.hideVisual,
                            player.difficulty,
                            player.hairColor,
                            player.skinColor,
                            player.eyeColor,
                            player.shirtColor,
                            player.underShirtColor,
                            player.pantsColor,
                            player.shoeColor,
                            player.anglerQuestsFinished
                        );

                        var characterId = Tables.CharacterTable.GetCharacterId(Mode, player.AuthenticatedAs, player.ClientUUId);
                        if (characterId > 0)
                        {

                        }
                    }
                }
                else
                {
                    var dir = Path.Combine(Globals.CharacterDataPath, Mode.ToString());
                    if (!Directory.Exists(dir))
                        Directory.CreateDirectory(dir);

                    var file = Path.Combine(dir, authName + ".ssc");
                    var data = new ServerCharacter(player);

            //                    if (data.Buffs != null && data.BuffTime != null)
            //                    {
            //                        var max = Math.Min(data.Buffs.Length, data.BuffTime.Length);
            //                        for (var x = 0; x < max; x++)
            //                        {
            //                            if (data.Buffs[x] > 0)
            //                            {
            //                                var time = data.BuffTime[x] * 60;
            //
            //                                ProgramLog.Plugin.Log("Saving buff {0} for {1}/{2}", data.Buffs[x], time, data.BuffTime[x]);
            //                            }
            //                        }
            //                    }

                    var json = Newtonsoft.Json.JsonConvert.SerializeObject(data);
                    System.IO.File.WriteAllText(file, json);
                    return true;
                }
            }
            return false;
        }