Ejemplo n.º 1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="iSettings"></param>
        public UpdateDBTool(Settings iSettings)
        {
            settings  = iSettings;
            fishDB    = new FishDB();
            historyDB = new FishHistoryDB(DUMMY_PLAYER_NAME, DateTime.Today);

            serverName = "http://" + settings.Global.UpdateDB.ServerName;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="iPol"></param>
 /// <param name="iChat"></param>
 /// <param name="iSettings"></param>
 public HarakiriTool(PolTool iPol, ResourceTool iResource, ChatTool iChat, Settings iSettings)
 {
     pol                  = iPol;
     api                  = iPol.EliteAPI;
     chat                 = iChat;
     resource             = iResource;
     settings             = iSettings;
     fishDB               = new FishDB();
     harakiriDB           = new HarakiriDB();
     control              = new EliteAPIControl(pol, resource, chat);
     control.MaxLoopCount = Constants.MAX_LOOP_COUNT;
     control.UseEnternity = settings.UseEnternity;
     control.BaseWait     = settings.Global.WaitBase;
     control.ChatWait     = settings.Global.WaitChat;
     this.RunningStatus   = RunningStatusKind.Stop;
     this.HarakiriStatus  = HarakiriStatusKind.Normal;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="iFFACE"></param>
 /// <param name="iChat"></param>
 /// <param name="iSettings"></param>
 /// <param name="iLogger"></param>
 public HarakiriTool(PolTool iPol, ChatTool iChat, Settings iSettings, LoggerTool iLogger)
 {
     pol = iPol;
     fface = iPol.FFACE;
     chat = iChat;
     settings = iSettings;
     logger = iLogger;
     fishDB = new FishDB(logger);
     harakiriDB = new HarakiriDB(logger);
     control = new FFACEControl(pol, chat, logger);
     control.MaxLoopCount = Constants.MAX_LOOP_COUNT;
     control.UseEnternity = settings.UseEnternity;
     control.BaseWait = settings.Global.WaitBase;
     control.ChatWait = settings.Global.WaitChat;
     this.RunningStatus = RunningStatusKind.Stop;
     this.HarakiriStatus = HarakiriStatusKind.Normal;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// xmlファイルをコンバートする(1.0.0→1.0.5)
        /// </summary>
        private void convert1_0_0to1_0_5(string iXmlFileName, string iRodName)
        {
            FishDBModel1_0_0 fishdb1_0_0 = getFishDB1_0_0(iRodName);
            FishDBModel      fishdb1_0_5 = new FishDBModel();

            fishdb1_0_5.Version = "1.0.5";
            fishdb1_0_5.RodName = fishdb1_0_0.RodName;
            foreach (FishDBFishModel1_0_0 fish1_0_0 in fishdb1_0_0.Fishes)
            {
                FishDBFishModel fish1_0_5 = new FishDBFishModel();
                //FishDBFishTypeKind.Monster→FishDBFishTypeKind.UnknownMonster
                if (fish1_0_0.FishType == FishDBFishTypeKind.Monster)
                {
                    fish1_0_0.FishType = FishDBFishTypeKind.UnknownMonster;
                }
                fish1_0_5.FishType = fish1_0_0.FishType;
                //FishName
                if (fish1_0_0.FishType == FishDBFishTypeKind.UnknownSmallFish ||
                    fish1_0_0.FishType == FishDBFishTypeKind.UnknownLargeFish ||
                    fish1_0_0.FishType == FishDBFishTypeKind.UnknownItem ||
                    fish1_0_0.FishType == FishDBFishTypeKind.UnknownMonster ||
                    fish1_0_0.FishType == FishDBFishTypeKind.Unknown)
                {
                    if (fish1_0_0.IDs.Count > 0)
                    {
                        fish1_0_5.FishName = FishDB.GetTmpFishNameFromFishType(fish1_0_0.FishType, fish1_0_0.IDs[0].ID1, fish1_0_0.IDs[0].ID2, fish1_0_0.IDs[0].ID3, fish1_0_0.IDs[0].ID4);
                    }
                    else
                    {
                        fish1_0_5.FishName = fish1_0_0.FishName;
                    }
                }
                else
                {
                    fish1_0_5.FishName = fish1_0_0.FishName;
                }
                //ID
                foreach (FishDBIdModel1_0_0 id1_0_0 in fish1_0_0.IDs)
                {
                    FishDBIdModel id1_0_5 = new FishDBIdModel();
                    id1_0_5.ID1      = id1_0_0.ID1;
                    id1_0_5.ID2      = id1_0_0.ID2;
                    id1_0_5.ID3      = id1_0_0.ID3;
                    id1_0_5.ID4      = id1_0_0.ID4;
                    id1_0_5.Count    = id1_0_0.Count;
                    id1_0_5.Critical = id1_0_0.Critical;
                    id1_0_5.ItemType = FishDBItemTypeKind.Common;
                    fish1_0_5.IDs.Add(id1_0_5);
                }
                //エリア 初期化する
                fish1_0_5.ZoneNames = new List <string>();
                //エサ
                fish1_0_5.BaitNames = fish1_0_0.BaitNames;

                fishdb1_0_5.Fishes.Add(fish1_0_5);
            }

            //バックアップ
            string backupFileName = iXmlFileName + ".bak";

            if (File.Exists(backupFileName))
            {
                File.Delete(backupFileName);
            }
            File.Copy(iXmlFileName, backupFileName);
            //xml書き込み
            putFishDB(iRodName, fishdb1_0_5);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="iFFACE"></param>
 /// <param name="iChat"></param>
 /// <param name="iSettings"></param>
 /// <param name="iLogger"></param>
 public FishingTool(PolTool iPol, ChatTool iChat, Settings iSettings, LoggerTool iLogger)
 {
     pol = iPol;
     pol.ChangeStatus += new PolTool.ChangeStatusEventHandler(this.PolTool_ChangeStatus);
     fface = iPol.FFACE;
     chat = iChat;
     settings = iSettings;
     logger = iLogger;
     FishDB = new FishDB(logger);
     fishHistoryDB = new FishHistoryDB(this.PlayerName,this.EarthDateTime, logger);
     FishHistoryDBModel history = fishHistoryDB.SelectDayly(this.PlayerName, this.EarthDateTime);
     this.TimeElapsed = history.TimeElapsed;
     control = new FFACEControl(pol, chat, logger);
     control.MaxLoopCount = Constants.MAX_LOOP_COUNT;
     control.UseEnternity = settings.UseEnternity;
     control.BaseWait = settings.Global.WaitBase;
     control.ChatWait = settings.Global.WaitChat;
     this.RunningStatus = RunningStatusKind.Stop;
     this.FishingStatus = FishingStatusKind.Normal;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// コンストラクタ処理部
 /// </summary>
 /// <param name="iPol"></param>
 private void constructor(PolTool iPol)
 {
     //PolTool初期設定
     pol = iPol;
     pol.ChangeStatus += new PolTool.ChangeStatusEventHandler(this.PolTool_ChangeStatus);
     //FFACE初期設定
     fface = iPol.FFACE;
     //LoggerTool初期設定
     logger = new LoggerTool(MiscTool.GetAppAssemblyName(), pol.FFACE.Player.Name);
     logger.Enable = args.LoggerEnable;
     logger.OutputLogLevel = args.LoggerLogLevel;
     logger.EnableVarDump = args.LoggerVarDumpEnable;
     logger.Output(LogLevelKind.INFO, string.Format("===== {0} {1} =====", MiscTool.GetAppAssemblyName(), MiscTool.GetAppVersion()));
     logger.Output(LogLevelKind.INFO, string.Format("デバッグログ:{0} ログレベル:{1} 変数出力:{2}", args.LoggerEnable, args.LoggerLogLevel, args.LoggerVarDumpEnable));
     logger.Output(LogLevelKind.INFO, string.Format("プロセス({0})にアタッチしました", pol.ProcessID));
     //Settings初期設定
     settings = new Settings(iPol.FFACE.Player.Name);
     //ChatTool初期設定
     chat = new ChatTool(iPol.FFACE);
     chat.ReceivedCommand += new ChatTool.ReceivedCommandEventHandler(this.ChatTool_ReceivedCommand);
     logger.Output(LogLevelKind.DEBUG, "ChatTool起動");
     //FishingTool初期設定
     fishing = new FishingTool(iPol, chat, settings, logger);
     fishing.Fished += new FishingTool.FishedEventHandler(this.FishingTool_Fished);
     fishing.ChangeMessage += new FishingTool.ChangeMessageEventHandler(this.FishingTool_ChangeMessage);
     fishing.ChangeStatus += new FishingTool.ChangeStatusEventHandler(this.FishingTool_ChangeStatus);
     fishing.CaughtFishesUpdate += new FishingTool.CaughtFishesUpdateEventHandler(this.FishingTool_CaughtFishesUpdate);
     logger.Output(LogLevelKind.DEBUG, "FishingTool起動");
     //HarakiriTool初期設定
     harakiri = new HarakiriTool(iPol, chat, settings, logger);
     harakiri.HarakiriOnce += new HarakiriTool.HarakiriOnceEventHandler(this.HarakiriTool_HarakiriOnce);
     harakiri.ChangeMessage += new HarakiriTool.ChangeMessageEventHandler(this.HarakiriTool_ChangeMessage);
     harakiri.ChangeStatus += new HarakiriTool.ChangeStatusEventHandler(this.HarakiriTool_ChangeStatus);
     logger.Output(LogLevelKind.DEBUG, "HarakiriTool起動");
     //FFACEControl初期設定
     control = new FFACEControl(pol, chat, logger);
     control.MaxLoopCount = Constants.MAX_LOOP_COUNT;
     control.UseEnternity = settings.UseEnternity;
     control.BaseWait = settings.Global.WaitBase;
     control.ChatWait = settings.Global.WaitChat;
     logger.Output(LogLevelKind.DEBUG, "FFACEControl起動");
     //監視スレッド起動
     thMonitor = new Thread(threadMonitor);
     thMonitor.Start();
     logger.Output(LogLevelKind.DEBUG, "監視スレッド起動");
     //DB
     fishDB = new FishDB(logger);
     fishHistoryDB = new FishHistoryDB(fishing.PlayerName, fishing.EarthDateTime, logger);
     harakiriDB = new HarakiriDB(logger);
     //古いデータをコンバート
     converter();
     //DB更新
     updatedb = new UpdateDBTool(settings, logger);
     updatedb.ReceiveMessage += new UpdateDBTool.ReceiveMessageEventHandler(this.UpdateDBTool_ReceiveMessage);
     updatedb.NewerVersion += new UpdateDBTool.NewerVersionEventHandler(this.UpdateDBTool_NewerVersion);
 }