Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        public string parseSettings(string file)
        {
            List <SettingNode> ex = ServerSettings.All().Where(e => e.Key != null).ToList();

            foreach (SettingNode node in ex)
            {
                Console.WriteLine("ASSIGN: " + node.Key + " TO " + node.Value);
                file = file.Replace("{{{" + node.Key + "}}}", node.Value);
            }

            List <PlayerGroup> groups = PlayerGroup.Groups;

            string json = "[";

            foreach (PlayerGroup g in groups)
            {
                json += "{";
                json += "\"name\":\"" + g.Name + "\",";
                json += "\"permission\":\"" + g.Permission + "\",";
                json += "\"color\":\"" + g.Color + "\",";
                json += "\"maxblockchanges\":\"" + g.MaxBlockChange + "\",";
                json += "\"file\":\"" + g.File + "\"";
                json += "},";
            }

            json  = json.TrimEnd(',');
            json += "]";

            file = file.Replace("{{{GROUP_JSON}}}", json);
            file = file.Replace("{{{XID}}}", this.XID);
            return(file);
        }