FromFile() public static method

Loads a configuration file and deserializes it from JSON
public static FromFile ( string Path ) : Config
Path string
return Config
Beispiel #1
0
        public int LoadSEconomy()
        {
            if (IsNet45OrNewer() == false)
            {
                TShock.Log.ConsoleError("SEconomy requires Microsoft .NET framework 4.5 or later.");
                TShock.Log.ConsoleError("SEconomy will not run.");
                return(-1);
            }

            try {
                this.Configuration = Config.FromFile(Config.BaseDirectory + System.IO.Path.DirectorySeparatorChar + "SEconomy.config.json");
                if (LoadJournal() == false)
                {
                    return(-1);
                }
                this.WorldEc          = new WorldEconomy(this);
                this.EventHandlers    = new EventHandlers(this);
                this.ChatCommands     = new ChatCommands(this);
                this.TransactionCache = new Journal.JournalTransactionCache();
            } catch (Exception) {
                return(-1);
            }

            return(0);
        }