当前位置: 首页>>代码示例>>C#>>正文


C# Properties.pushData方法代码示例

本文整理汇总了C#中Properties.pushData方法的典型用法代码示例。如果您正苦于以下问题:C# Properties.pushData方法的具体用法?C# Properties.pushData怎么用?C# Properties.pushData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Properties的用法示例。


在下文中一共展示了Properties.pushData方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Load

        public override void Load()
        {
            Name = "TDSMPlugin Example";
            Description = "Plugin Example for TDSM.";
            Author = "DeathCradle";
            Version = "1";
            TDSMBuild = 32; //You put here the release this plugin was made/build for.

            plugin = this;

            string pluginFolder = Statics.PluginPath + Path.DirectorySeparatorChar + "TDSM";
            //Create folder if it doesn't exist
            CreateDirectory(pluginFolder);

            //setup a new properties file
            properties = new Properties(pluginFolder + Path.DirectorySeparatorChar + "tdsmplugin.properties");
            properties.Load();
            properties.pushData(); //Creates default values if needed. [Out-Dated]
            properties.Save();

            //read properties data
            spawningAllowed = properties.SpawningCancelled;
            tileBreakageAllowed = properties.TileBreakage;
            explosivesAllowed = properties.ExplosivesAllowed;
        }
开发者ID:Dyrian,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:25,代码来源:TDSMPlugin.cs

示例2: Load

        public override void Load()
        {
            Name = "TDSMPlugin Example";
            Description = "Plugin Example for TDSM.";
            Author = "DeathCradle";
            Version = "1";
            TDSMBuild = 9;

            string pluginFolder = Statics.getPluginPath + Statics.systemSeperator + "TDSM";
            //Create fodler if it doesn't exist
            if (!Program.createDirectory(pluginFolder, true))
            {
                Program.tConsole.WriteLine("[TSDM Plugin] Failed to create crucial Folder");
                return;
            }

            //setup a new properties file
            properties = new Properties(pluginFolder + Statics.systemSeperator + "tdsmplugin.properties");
            properties.Load();
            properties.pushData(); //Creates default values if needed.
            properties.Save();

            //read properties data
            spawningAllowed = properties.isSpawningCancelled();
            tileBreakageAllowed = properties.getTileBreakage();
            explosivesAllowed = properties.isExplosivesAllowed();

            isEnabled = true;
        }
开发者ID:cwalter5,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:29,代码来源:TDSMPlugin.cs

示例3: Load

        public override void Load()
        {
            Name = "WarpDrive";
            Description = "Warp commands for TDSM";
            Author = "Envoy"; // see credits above, most of this is borrowed
            Version = "1.5.28";
            TDSMBuild = 28;

            Log("version " + base.Version + " Loading...");

            string pluginFolder = Statics.PluginPath + Path.DirectorySeparatorChar + Name;
            CreateDirectory(pluginFolder);

            //setup a new properties file
            properties = new Properties(pluginFolder + Path.DirectorySeparatorChar + "warpdrive.properties");
            properties.Load();
            properties.pushData(); //Creates default values if needed.
            properties.Save();

            //read properties data
            requiresOp = properties.requiresOp();
            globalOwnershipEnforced = properties.globalOwnershipEnforced();
            warpHomeOnDeath = properties.warpHomeOnDeath();

            // spit out useful property info
            Log("Requires Op: " + requiresOp);
            Log("Global Ownership Enforced: " + globalOwnershipEnforced);
            Log("Warp Home on Death: " + warpHomeOnDeath);

            //setup new WarpDriveEngine
            warpDriveEngine = new WarpDriveEngine(this, pluginFolder + Path.DirectorySeparatorChar + "warps.xml");

            isEnabled = true;
        }
开发者ID:FourFourHero,项目名称:TDSM-WarpDrive,代码行数:34,代码来源:WarpDrivePlugin.cs

示例4: Initialized

        protected override void Initialized(object state)
        {
            if (!Directory.Exists(RegionsFolder))
                Directory.CreateDirectory(RegionsFolder);

            rProperties = new Properties(RegionsFolder + Path.DirectorySeparatorChar + "regions.properties");
            rProperties.Load();

            rProperties.AddHeaderLine("Use 'rectify=false' to ignore world alterations from");
            rProperties.AddHeaderLine("players who are blocked; Possibly saving bandwidth.");

            rProperties.pushData();
            rProperties.Save(false);

            if (rProperties.RectifyChanges)
                WorldAlter = HookResult.RECTIFY;

            SelectorItem = rProperties.SelectionToolID;

            regionManager = new RegionManager(DataFolder);

            selection = new Selection();

            commands = new Commands();
            commands.regionManager = regionManager;
            commands.RegionsPlugin = this;
            commands.selection = selection;

            commands.Node_Create        = Node.FromPath("region.create");
            commands.Node_Here          = Node.FromPath("region.here");
            commands.Node_List          = Node.FromPath("region.list");
            commands.Node_Npcres        = Node.FromPath("region.npcres");
            commands.Node_Opres         = Node.FromPath("region.opres");
            commands.Node_Projectile    = Node.FromPath("region.projectile");
            commands.Node_ProtectAll    = Node.FromPath("region.protectall");
            commands.Node_Select        = Node.FromPath("region.select");
            commands.Node_User          = Node.FromPath("region.user");

            AddCommand("region")
                .WithAccessLevel(AccessLevel.OP)
                .WithHelpText("Usage:    region [select, create, user, list, npcres, opres]")
                .WithDescription("Region Management.")
                .WithPermissionNode("regions")
                .Calls(commands.Region);

            AddCommand("regions")
                .WithAccessLevel(AccessLevel.OP)
                .WithHelpText("Usage:    regions [select, create, user, list, npcres, opres]")
                .WithDescription("Region Management.")
                .WithPermissionNode("regions") //Need another method to split the commands up.
                .Calls(commands.Region);

            ChestBreak      = AddAndCreateNode("region.chestbreak");
            ChestOpen       = AddAndCreateNode("region.chestopen");
            DoorChange      = AddAndCreateNode("region.doorchange");
            LiquidFlow      = AddAndCreateNode("region.liquidflow");
            ProjectileUse   = AddAndCreateNode("region.projectileuse");
            SignEdit        = AddAndCreateNode("region.signedit");
            TileBreak       = AddAndCreateNode("region.tilebreak");
            TilePlace       = AddAndCreateNode("region.tileplace");
        }
开发者ID:emreuyls,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:61,代码来源:Regions.cs

示例5: Initialized

        protected override void Initialized(object state)
        {
            if (!Directory.Exists(RegionsFolder))
                Directory.CreateDirectory(RegionsFolder);

            rProperties = new Properties(RegionsFolder + Path.DirectorySeparatorChar + "regions.properties");
            rProperties.Load();

            rProperties.AddHeaderLine("Use 'rectify=false' to ignore world alterations from");
            rProperties.AddHeaderLine("players who are blocked; Possibly saving bandwidth.");

            rProperties.pushData();
            rProperties.Save(false);

            if (rProperties.RectifyChanges)
                WorldAlter = HookResult.RECTIFY;

            SelectorItem = rProperties.SelectionToolID;
            #region set up mysql properties

            string pluginFolder = Statics.PluginPath + Path.DirectorySeparatorChar + "mysql";
            if (!Directory.Exists(pluginFolder))
            {
                Directory.CreateDirectory(pluginFolder);
            }

            mysql = new PropertiesFile(pluginFolder + Path.DirectorySeparatorChar + "mysql.properties");
            mysql.Load();
            var dummy1 = mysqlenabled;
            var dummy2 = mysqlserver;
            var dummy3 = mysqldatabase;
            var dummy4 = mysqluser;
            var dummy5 = mysqlpassword;
            var dummy6 = imported;
            mysql.Save(false);

            #endregion

            #region check if mysql table exists
            if (mysqlenabled)
            {
                try
                {
                    checkTable(connectionString, "terraria_regions");
                }
                catch (MySqlException e)
                {
                    if (e.Number == 1042)
                    {
                        ProgramLog.Error.Log("[Regions] Could not connect to mysql server. Falling back to using regions files");
                        mysql.setValue("mysql-enabled", "False");
                        mysql.Save();
                    }
                    else
                    {
                        ProgramLog.Error.Log("[Regions] MYSQL ERROR CODE: " + e.Number);
                        ProgramLog.Error.Log(e.StackTrace);
                    }
                }
            }
            #endregion

            regionManager = new RegionManager(DataFolder);
            selection = new Selection();

            commands = new Commands();
            commands.regionManager = regionManager;
            commands.RegionsPlugin = this;
            commands.selection = selection;

            commands.Node_Create        = Node.FromPath("region.create");
            commands.Node_Here          = Node.FromPath("region.here");
            commands.Node_List          = Node.FromPath("region.list");
            commands.Node_Npcres        = Node.FromPath("region.npcres");
            commands.Node_Opres         = Node.FromPath("region.opres");
            commands.Node_Projectile    = Node.FromPath("region.projectile");
            commands.Node_ProtectAll    = Node.FromPath("region.protectall");
            commands.Node_Select        = Node.FromPath("region.select");
            commands.Node_User          = Node.FromPath("region.user");

            AddCommand("region")
                .WithAccessLevel(AccessLevel.OP)
                .WithHelpText("Usage:    region [select, create, user, list, npcres, opres]")
                .WithDescription("Region Management.")
                .WithPermissionNode("regions")
                .Calls(commands.Region);

            AddCommand("regions")
                .WithAccessLevel(AccessLevel.OP)
                .WithHelpText("Usage:    regions [select, create, user, list, npcres, opres]")
                .WithDescription("Region Management.")
                .WithPermissionNode("regions") //Need another method to split the commands up.
                .Calls(commands.Region);

            ChestBreak      = AddAndCreateNode("region.chestbreak");
            ChestOpen       = AddAndCreateNode("region.chestopen");
            DoorChange      = AddAndCreateNode("region.doorchange");
            LiquidFlow      = AddAndCreateNode("region.liquidflow");
            ProjectileUse   = AddAndCreateNode("region.projectileuse");
            SignEdit        = AddAndCreateNode("region.signedit");
//.........这里部分代码省略.........
开发者ID:zealic,项目名称:TDSM,代码行数:101,代码来源:Regions.cs

示例6: Initialized

        protected override void Initialized(object state)
        {
            Name = "Essentials";
            Description = "Essential commands for TDSM.";
            Author = "Luke";
            Version = "0.6";
            TDSMBuild = 29;

            string pluginFolder = Statics.PluginPath + Path.DirectorySeparatorChar + "Essentials";
            string kitsFile = pluginFolder + Path.DirectorySeparatorChar + "kits.xml";
            string propertiesFile = pluginFolder + Path.DirectorySeparatorChar + "essentials.properties";

            lastEventByPlayer = new Dictionary<String, String>();
            essentialsPlayerList = new Dictionary<int, bool>();

            if (!Directory.Exists(pluginFolder))
                CreateDirectory(pluginFolder); //Touch Directory, We need this.

            //We do not want to delete records!
            if (!File.Exists(kitsFile))
                File.Create(kitsFile).Close();

            if (!File.Exists(propertiesFile))
                File.Create(propertiesFile).Close();

            properties = new Properties(pluginFolder + Path.DirectorySeparatorChar + "essentials.properties");
            properties.Load();
            properties.pushData();
            properties.Save();

            Log("Loading Kits...");
            kitManager = new KitManager(kitsFile);

            LOADKITS:
            try
            {
                    kitManager.LoadKits();
            }
            catch (Exception)
            {
                Console.Write("Create a parsable file? [Y/n]: ");
                if (Console.ReadLine().ToLower() == "y")
                {
                    kitManager.CreateTemplate();
                    goto LOADKITS; //Go back to reload data ;)...I'm lazy I KNOW
                }
            }
            Log("Complete, Loaded " + kitManager.KitList.Count + " Kit(s)");
        }
开发者ID:Stickiler,项目名称:Essentials-TDSM,代码行数:49,代码来源:Essentials.cs

示例7: Initialized

        protected override void Initialized(object state)
        {
            if (!Directory.Exists(RegionsFolder))
                Directory.CreateDirectory(RegionsFolder);

            rProperties = new Properties(RegionsFolder + Path.DirectorySeparatorChar + "regions.properties");
            rProperties.Load();

            rProperties.AddHeaderLine("Use 'rectify=false' to ignore world alterations from");
            rProperties.AddHeaderLine("players who are blocked; Possibly saving bandwidth.");

            rProperties.pushData();
            rProperties.Save();

            if (rProperties.RectifyChanges)
                WorldAlter = HookResult.RECTIFY;

            SelectorItem = rProperties.SelectionToolID;

            regionManager = new RegionManager(DataFolder);

            selection = new Selection();

            commands = new Commands();
            commands.regionManager = regionManager;
            commands.RegionsPlugin = this;
            commands.selection = selection;

            AddCommand("region")
                .WithAccessLevel(AccessLevel.OP)
                .WithHelpText("Usage:    region [select, create, user, list, npcres, opres]")
                .WithDescription("Region Management.")
                .WithPermissionNode("regions")
                .Calls(commands.Region);

            AddCommand("regions")
                .WithAccessLevel(AccessLevel.OP)
                .WithHelpText("Usage:    regions [select, create, user, list, npcres, opres]")
                .WithDescription("Region Management.")
                .WithPermissionNode("regions") //Need another method to split the commands up.
                .Calls(commands.Region);

            Hook(HookPoints.PlayerWorldAlteration,  OnPlayerWorldAlteration);
            Hook(HookPoints.LiquidFlowReceived,     OnLiquidFlowReceived);
            Hook(HookPoints.ProjectileReceived,     OnProjectileReceived);
            Hook(HookPoints.PlayerEnteredGame,      OnPlayerEnteredGame);
            Hook(HookPoints.ServerStateChange,      OnServerStateChange);
            Hook(HookPoints.DoorStateChanged,       OnDoorStateChange);
            Hook(HookPoints.ChestBreakReceived,     OnChestBreak);
            Hook(HookPoints.SignTextSet,            OnSignEdit);

            UsingPermissions = isRunningPermissions();
            if (UsingPermissions)
                Log("Using Permissions.");
            else
                Log("No Permissions Found\nUsing Internal User System");
        }
开发者ID:Skiles,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:57,代码来源:Regions.cs

示例8: Load

        public override void Load()
        {
            base.Name = "Regions";
            base.Description = "A region plguin for TDSM";
            base.Author = "DeathCradle";
            base.Version = "0.1";
            base.TDSMBuild = 32;

            if (!Directory.Exists(RegionsFolder))
                Directory.CreateDirectory(RegionsFolder);

            rProperties = new Properties(RegionsFolder + Path.DirectorySeparatorChar + "regions.properties");
            rProperties.Load();
            rProperties.pushData();
            rProperties.Save();

            regionManager = new RegionManager(DataFolder);

            AddCommand("region")
                .WithAccessLevel(AccessLevel.OP)
                .WithHelpText("Usage:    region select")
                .WithDescription("Region Management.")
                .Calls(Commands.Region);

            registerHook(Hooks.PLAYER_TILECHANGE);
            registerHook(Hooks.PLAYER_FLOWLIQUID);
            registerHook(Hooks.PLAYER_PROJECTILE);
            registerHook(Hooks.DOOR_STATECHANGE);

            UsingPermissions = isRunningPermissions();
            if (UsingPermissions)
                Log("Using Permissions.");
        }
开发者ID:Dyrian,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:33,代码来源:Regions.cs

示例9: setupProperties

        //
        // PRIVATE
        //
        private void setupProperties()
        {
            string pluginFolder = PLUGIN_FOLDER;
            createDirectory(pluginFolder);

            properties = new Properties(pluginFolder + Path.DirectorySeparatorChar + "passport.properties");
            properties.Load();
            properties.pushData(); //Creates default values if needed.
            properties.Save();

            //read properties data
            saveTimeMillis = properties.saveTimeMillis();
        }
开发者ID:FourFourHero,项目名称:TDSM-Passport,代码行数:16,代码来源:PassportPlugin.cs

示例10: Initialized

        protected override void Initialized(object state)
        {
            Languages = new Languages();
            Languages.LoadLanguages(this);

            string pluginFolder = Statics.PluginPath + Path.DirectorySeparatorChar + "TDSM";
            //Create folder if it doesn't exist
            CreateDirectory(pluginFolder);

            //setup a new properties file
            properties = new Properties(pluginFolder + Path.DirectorySeparatorChar + "tdsmplugin.properties");
            properties.Load();
            properties.pushData(); //Creates default values if needed. [Out-Dated]
            properties.Save();

            //read properties data
            spawningAllowed = properties.SpawningCancelled;
            tileBreakageAllowed = properties.TileBreakage;
            explosivesAllowed = properties.ExplosivesAllowed;
        }
开发者ID:emreuyls,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:20,代码来源:TDSM_Plugin.cs


注:本文中的Properties.pushData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。