Пример #1
0
        public override void Initialize()
        {
            tPulse = (TPulse)PlugInHandler.GetPluginByType(typeof(TPulse));

            //Loading Friends DB
            if (File.Exists(FriendsDB.DefaultFile))
            {
                FriendsList = FriendsDB.Load(FriendsDB.DefaultFile);
            }
            else
            {
                FriendsList.Save(FriendsDB.DefaultFile);
            }


            //Adding commands

            tPulse.Commands.ChatCommands.Add(new Command("", FriendCommand, "friend"));
            tPulse.Commands.ChatCommands.Add(new Command("", MessageCommand, "fmsg"));
            tPulse.Commands.ChatCommands.Add(new Command("", MessageAllCommand, "fall"));
            //Commands.ChatCommands.Add(new Command("", MessageCommand, "sendcoord"));
            tPulse.Commands.OnPlayerLogin += new PlayerLoginHandler(PlayerLogin);
            //Hooks.WorldHooks.SaveWorld += new Hooks.WorldHooks.SaveWorldD(WorldHooks_SaveWorld);
            tPulse.OnWorldSaved += new WorldSavedHandler(OnWorldSaved);
        }
Пример #2
0
        public static FriendsDB Load(string path)
        {
            FriendsDB db = new FriendsDB();

            bf.AssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
            FileStream fin = File.OpenRead(path);

            db = (FriendsDB)bf.Deserialize(fin);

            fin.Close();

            return db;
        }
Пример #3
0
        public static FriendsDB Load(string path)
        {
            FriendsDB db = new FriendsDB();

            bf.AssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
            FileStream fin = File.OpenRead(path);

            db = (FriendsDB)bf.Deserialize(fin);

            fin.Close();

            return(db);
        }
Пример #4
0
        public override void Initialize()
        {
            tPulse = (TPulse)PlugInHandler.GetPluginByType(typeof(TPulse));

            //Loading Friends DB
            if (File.Exists(FriendsDB.DefaultFile))
            {
                FriendsList = FriendsDB.Load(FriendsDB.DefaultFile);
            }
            else
            {
                FriendsList.Save(FriendsDB.DefaultFile);
            }

               //Adding commands

            tPulse.Commands.ChatCommands.Add(new Command("", FriendCommand, "friend"));
            tPulse.Commands.ChatCommands.Add(new Command("", MessageCommand, "fmsg"));
            tPulse.Commands.ChatCommands.Add(new Command("", MessageAllCommand, "fall"));
            //Commands.ChatCommands.Add(new Command("", MessageCommand, "sendcoord"));
            tPulse.Commands.OnPlayerLogin += new PlayerLoginHandler(PlayerLogin);
            //Hooks.WorldHooks.SaveWorld += new Hooks.WorldHooks.SaveWorldD(WorldHooks_SaveWorld);
            tPulse.OnWorldSaved += new WorldSavedHandler(OnWorldSaved);
        }