コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: blue3k/StormForge
        void RefreshChannelList()
        {
            var logServerAddress = txtLogServerAddress.Text;

            if (string.IsNullOrEmpty(logServerAddress))
            {
                return;
            }

            SavedValueRegistry.SaveValue("LogServerAddress", logServerAddress);


            if (m_StreamDirectory == null || m_StreamDirectory.ServerAddress != logServerAddress)
            {
                if (m_StreamDirectory != null)
                {
                    m_StreamDirectory.Dispose();
                }

                m_StreamDirectory = new StreamDBDirectory(StreamDBDirectory.DirectoryMode.Broker);
                m_StreamDirectory.Initialize(logServerAddress);
            }

            m_StreamDirectory.RequestStreamList();
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: blue3k/StormForge
        public MainWindow()
        {
            var logServerAddress = SavedValueRegistry.ReadValue("LogServerAddress", "");

            var processName = SavedValueRegistry.ReadValue("ProcessName", "SFLogViewer");

            SavedValueRegistry.SaveValue("ProcessName", processName);

            InitializeComponent();

            txtLogServerAddress.Text = logServerAddress;

            var backLog = SavedValueRegistry.ReadValue("InitialBacklog", "100");

            textBacklog.Text = backLog;

            GlobalEngine.Start("SFLogViewer", logServerAddress);

            RefreshChannelList();

            m_TickTimer          = new DispatcherTimer();
            m_TickTimer.Tick    += new EventHandler(Timer_Tick);
            m_TickTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            m_TickTimer.Start();
        }
コード例 #3
0
        private void OnLoginClicked(object sender, RoutedEventArgs e)
        {
            var userId = txtLoginName.Text;

            if (string.IsNullOrEmpty(userId))
            {
                return;
            }

            if (m_OnlineClient == null)
            {
                m_OnlineClient = new OnlineClient(m_MessageRouter);
            }

            listCharacter.Items.Clear();
            listZone.Items.Clear();

            SavedValueRegistry.SaveValue("LoginName", userId);

            var loginAddress = txtLoginServer.Text;

            SavedValueRegistry.SaveValue("LoginServer", loginAddress);

            var logServer = txtLogServer.Text;

            SavedValueRegistry.SaveValue("LogServer", logServer);

            var result = m_OnlineClient.StartConnection(1, "FishingOnline", loginAddress, userId, userId);

            if (result.IsSucceeded)
            {
            }
            UpdateButtonState();
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: blue3k/StormForge
        private void OnChannel_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            var logServerAddress = txtLogServerAddress.Text;

            if (string.IsNullOrEmpty(logServerAddress))
            {
                return;
            }

            var selectedChannelItem = listLogChannels.SelectedItem;

            if (selectedChannelItem == null || string.IsNullOrEmpty(selectedChannelItem.ToString()))
            {
                return;
            }

            UInt32 InitialBackLog = 100;

            if (UInt32.TryParse(textBacklog.Text, out InitialBackLog))
            {
                SavedValueRegistry.SaveValue("InitialBacklog", InitialBackLog.ToString());
            }

            var logChannel = selectedChannelItem.ToString();

            var logView = new View.LogViewer(logServerAddress, logChannel, (int)InitialBackLog);

            logView.Show();
        }
コード例 #5
0
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            SavedValueRegistry.SaveValue("LoginName", txtLoginName.Text);
            SavedValueRegistry.SaveValue("LoginServer", txtLoginServer.Text);
            SavedValueRegistry.SaveValue("LogServer", txtLogServer.Text);
            SavedValueRegistry.SaveValue("ProcessName", txtLogId.Text);

            m_TickTimer.Stop();
            m_TickTimer = null;


            if (m_OnlineClient != null)
            {
                m_OnlineClient.DisconnectAll();
                m_OnlineClient.Dispose();
                m_OnlineClient = null;
            }

            if (m_MessageRouter != null)
            {
                m_MessageRouter.Dispose();
                m_MessageRouter = null;
            }

            GlobalEngine.Stop();
        }