Beispiel #1
0
        public new static void PrintNotifyAction(NotifyAction msg, object tag)
        {
            MessagePrinter.PrintNotifyAction(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            MongoDBConnect.connection.InsertNotifyAction(msg, fc.gameState.mmoChannel.ChannelID, fc.gameState.townID);
        }
Beispiel #2
0
        public new static void PrintChannelServerAddress(ChannelServerAddress msg, object tag)
        {
            MessagePrinter.PrintChannelServerAddress(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            fc.gameState.mmoChannel = msg;
        }
Beispiel #3
0
        public new static void PrintCharacterListMessage(CharacterListMessage msg, object tag)
        {
            MessagePrinter.PrintCharacterListMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            fc.gameState.characterList = msg.Characters;
            fc.SetCID();
        }
Beispiel #4
0
        public new static void PrintMailListMessage(MailListMessage msg, object tag)
        {
            MessagePrinter.PrintMailListMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            if (fc.State == LoginState.WaitMailList)
            {
                fc.State = LoginState.EnterChannel;
            }
        }
Beispiel #5
0
        public new static void PrintHasSecondPasswordMessage(HasSecondPasswordMessage msg, object tag)
        {
            MessagePrinter.PrintHasSecondPasswordMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            if (fc.State == LoginState.WaitHasSecondPassword)
            {
                fc.State = LoginState.QueryCashShopBalance;
            }
        }
Beispiel #6
0
        public new static void PrintSyncFeatureMatrixMessage(SyncFeatureMatrixMessage msg, object tag)
        {
            MessagePrinter.PrintSyncFeatureMatrixMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            if (fc.State == LoginState.WaitSyncFeatureMatrix)
            {
                fc.State = LoginState.SendUserLoginMessage;
            }
        }
Beispiel #7
0
        public new static void PrintRankAlarmInfoMessage(RankAlarmInfoMessage msg, object tag)
        {
            MessagePrinter.PrintRankAlarmInfoMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            if (fc.State == LoginState.WaitRankAlarmInfo)
            {
                fc.State = LoginState.QueryInnTalk;
            }
        }
Beispiel #8
0
        public static void Main(string[] args)
        {
            string mongoUri = Environment.GetEnvironmentVariable("MONGO_URI");

            SQLiteConnect.SetupDicts();
            MongoDBConnect.SetupConnect(mongoUri);
            Properties.Settings settings = Properties.Settings.Default;
            FrontendConnect     c        = new FrontendConnect(settings.username, settings.pin.ToString(), 1);

            c.Login();
            c.jp.Join();
        }
Beispiel #9
0
        public new static void PrintLoginOkMessage(LoginOkMessage msg, object tag)
        {
            MessagePrinter.PrintLoginOkMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            if (fc.State == LoginState.WaitLoginOk)
            {
                fc.State = LoginState.EnterRegion;
            }
            else
            {
                throw new Exception("Received login ok at wrong time");
            }
        }
Beispiel #10
0
        public new static void PrintAskSecondPasswordMessage(AskSecondPasswordMessage msg, object tag)
        {
            MessagePrinter.PrintAskSecondPasswordMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            if (fc.State == LoginState.WaitAskSecondPassword)
            {
                fc.State = LoginState.WaitHasSecondPassword;
            }
            else
            {
                throw new Exception("Asked for second password at wrong time");
            }
        }
Beispiel #11
0
        /*
         * public new static void PrintUpdateBattleInventoryInTownMessage(UpdateBattleInventoryInTownMessage msg, object tag) {
         *  MessagePrinter.PrintUpdateBattleInventoryInTownMessage(msg, tag);
         *  FrontendConnect fc = (FrontendConnect)tag;
         *  if (fc.State == LoginState.WaitUpdateBattleInventoryInTown) {
         *      fc.State = LoginState.SendHotSpringRequestInfo;
         *  }
         * }
         * public new static void PrintHotSpringRequestInfoResultMessage(HotSpringRequestInfoResultMessage msg, object tag) {
         *  MessagePrinter.PrintHotSpringRequestInfoResultMessage(msg, tag);
         *  FrontendConnect fc = (FrontendConnect)tag;
         *  if (fc.State == LoginState.WaitHotSpringRequestInfoResult) {
         *      fc.State = LoginState.MovePartition;
         *  }
         * }
         */
        public new static void PrintNpcTalkMessage(NpcTalkMessage msg, object tag)
        {
            MessagePrinter.PrintNpcTalkMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            if (fc.State == LoginState.WaitNpcTalkTrade)
            {
                fc.State = LoginState.ContinueSearch;
            }
            else if (fc.State == LoginState.WaitNpcInnTalk)
            {
                fc.State = LoginState.QueryNpcTalkTrade;
            }
        }
Beispiel #12
0
        public new static void PrintSecondPasswordResultMessage(SecondPasswordResultMessage msg, object tag)
        {
            MessagePrinter.PrintSecondPasswordResultMessage(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            if (!msg.Passed)
            {
                Console.WriteLine("Wrong second password entered, exiting");
                throw new Exception("Wrong second password");
            }
            if (fc.State == LoginState.WaitSecondPasswordResult)
            {
                fc.State = LoginState.SelectCharacter;
            }
        }
Beispiel #13
0
        public new static void PrintTradeSearchResult(TradeSearchResult msg, object tag)
        {
            MessagePrinter.PrintTradeSearchResult(msg, tag);
            FrontendConnect fc = (FrontendConnect)tag;

            Console.WriteLine("Inserting trade item info");
            MongoDBConnect.connection.InsertTradeItemInfoList(msg.TradeItemList);
            if (msg.TradeItemList != null)
            {
                fc.searchState.seenNumber += msg.TradeItemList.Count;
            }

            fc.searchState.NextSearch(msg.IsMoreResult);
            Console.WriteLine("Trade state: {0}", fc.State);
            Console.WriteLine("Found {0} items", fc.searchState.seenNumber);
            if (fc.State == LoginState.WaitSearch)
            {
                fc.State = LoginState.ContinueSearch;
            }
        }