Exemplo n.º 1
0
        static void ClientThread_NodeEvent(object sender, NodeEventArgs e)
        {
            if (e.EventType == NodeEventType.LogOn)
            {
                // Kill other session if the user is a logged in user (ie not a RUNBBS.INI connection) and the user isn't allowed on multiple nodes
                if ((e.NodeInfo.User.UserId > 0) && (!e.NodeInfo.User.AllowMultipleConnections))
                {
                    KillOtherSession(e.NodeInfo.User.Alias, e.NodeInfo.Node);
                }
            }

            NodeEvent?.Invoke(sender, e);
            UpdateWhoIsOnlineFile();
        }
Exemplo n.º 2
0
        private void NodeManager_NodeEvent(object sender, NodeEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate { NodeManager_NodeEvent(sender, e); }));
            }
            else
            {
                if (e.EventType == NodeEventType.LogOff)
                {
                    UpdateButtonsAndTrayIcon();
                }
                else if (e.EventType == NodeEventType.LogOn)
                {
                    UpdateButtonsAndTrayIcon();

                    // Add history item
                    ListViewItem LVIHistory = new ListViewItem(e.NodeInfo.Node.ToString());
                    LVIHistory.SubItems.Add(e.NodeInfo.ConnectionType.ToString());
                    LVIHistory.SubItems.Add(e.NodeInfo.Connection.GetRemoteIP());
                    LVIHistory.SubItems.Add(e.NodeInfo.User.Alias);
                    LVIHistory.SubItems.Add(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString());
                    lvHistory.Items.Insert(0, LVIHistory);

                    // Keep a counter for number of connections
                    switch (e.NodeInfo.ConnectionType)
                    {
                    case ConnectionType.RLogin:
                        lblRLoginCount.Text = (Convert.ToInt32(lblRLoginCount.Text) + 1).ToString();
                        break;

                    case ConnectionType.Telnet:
                        lblTelnetCount.Text = (Convert.ToInt32(lblTelnetCount.Text) + 1).ToString();
                        break;

                    case ConnectionType.WebSocket:
                        lblWebSocketCount.Text = (Convert.ToInt32(lblWebSocketCount.Text) + 1).ToString();
                        break;
                    }
                }

                // Update status
                ListViewItem LVI = lvNodes.Items[e.NodeInfo.Node - Config.Instance.FirstNode];
                LVI.SubItems[1].Text = (e.EventType == NodeEventType.LogOff ? "" : e.NodeInfo.ConnectionType.ToString());
                LVI.SubItems[2].Text = (e.EventType == NodeEventType.LogOff ? "" : e.NodeInfo.Connection.GetRemoteIP());
                LVI.SubItems[3].Text = (e.EventType == NodeEventType.LogOff ? "" : e.NodeInfo.User.Alias);
                LVI.SubItems[4].Text = (e.EventType == NodeEventType.LogOff ? "Waiting for a caller..." : e.Status);
            }
        }
Exemplo n.º 3
0
        static void GameSrv_LogOnEvent(object sender, NodeEventArgs e)
        {
            if (_FancyOutput)
            {
                _ConnectionCounts[e.NodeInfo.ConnectionType] += 1;

                Crt.FastWrite(StringUtils.PadRight(e.NodeInfo.User.Alias + " (" + e.NodeInfo.Connection.GetRemoteIP() + ":" + e.NodeInfo.Connection.GetRemotePort() + ")", ' ', 65), 8, 1, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(StringUtils.PadRight(DateTime.Now.ToString("dddd MMMM dd, yyyy  " + _TimeFormatFooter), ' ', 65), 8, 2, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(StringUtils.PadRight(e.NodeInfo.ConnectionType.ToString(), ' ', 65), 8, 3, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(_ConnectionCounts[ConnectionType.RLogin].ToString(), 87, 1, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(_ConnectionCounts[ConnectionType.Telnet].ToString(), 87, 2, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(_ConnectionCounts[ConnectionType.WebSocket].ToString(), 87, 3, (Crt.Blue << 4) + Crt.White);
                UpdateTime();
            }
        }
Exemplo n.º 4
0
        static void GameSrv_LogOnEvent(object sender, NodeEventArgs e)
        {
            if (_FancyOutput)
            {
                _ConnectionCounts[e.NodeInfo.ConnectionType] += 1;

                Crt.FastWrite(StringUtils.PadRight(e.NodeInfo.User.Alias + " (" + e.NodeInfo.Connection.GetRemoteIP() + ":" + e.NodeInfo.Connection.GetRemotePort() + ")", ' ', 65), 8, 1, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(StringUtils.PadRight(DateTime.Now.ToString("dddd MMMM dd, yyyy  " + _TimeFormatFooter), ' ', 65), 8, 2, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(StringUtils.PadRight(e.NodeInfo.ConnectionType.ToString(), ' ', 65), 8, 3, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(_ConnectionCounts[ConnectionType.RLogin].ToString(), 87, 1, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(_ConnectionCounts[ConnectionType.Telnet].ToString(), 87, 2, (Crt.Blue << 4) + Crt.White);
                Crt.FastWrite(_ConnectionCounts[ConnectionType.WebSocket].ToString(), 87, 3, (Crt.Blue << 4) + Crt.White);
                UpdateTime();
            }
        }
Exemplo n.º 5
0
 void GameSrv_LogOffEvent(object sender, NodeEventArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new MethodInvoker(delegate { GameSrv_LogOffEvent(sender, e); }));
     }
     else
     {
         ListViewItem LVI = lvNodes.Items[e.NodeInfo.Node - _GameSrv.FirstNode];
         LVI.SubItems[1].Text = "";
         LVI.SubItems[2].Text = "";
         LVI.SubItems[3].Text = "";
         LVI.SubItems[4].Text = "Waiting for a caller...";
     }
 }
Exemplo n.º 6
0
        private void RaiseNodeEvent(object sender, NodeEventArgs nodeEvent)
        {
            EventHandler <NodeEventArgs> Handler = NodeEvent;

            if (Handler != null)
            {
                Handler(sender, nodeEvent);
            }
            if (nodeEvent.NodeInfo.UserLoggedOn)
            {
                RaiseAggregatedStatusMessageEvent(sender, "Node " + nodeEvent.NodeInfo.Node.ToString() + ": " + nodeEvent.NodeInfo.User.Alias + ": " + nodeEvent.Status);
            }
            else
            {
                RaiseAggregatedStatusMessageEvent(sender, "Node " + nodeEvent.NodeInfo.Node.ToString() + ": " + nodeEvent.Status);
            }
        }
Exemplo n.º 7
0
        void GameSrv_NodeEvent(object sender, NodeEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate { GameSrv_NodeEvent(sender, e); }));
            }
            else
            {
                // Skip out of it's not a true status message
                if ((e.Status.StartsWith("ERROR:")) || e.Status.StartsWith("EXCEPTION:") || (e.Status.StartsWith("WARNING:")) || (e.Status.StartsWith("DEBUG:")))
                {
                    return;
                }

                ListViewItem LVI = lvNodes.Items[e.NodeInfo.Node - _GameSrv.FirstNode];
                LVI.SubItems[1].Text = e.NodeInfo.ConnectionType.ToString();
                LVI.SubItems[2].Text = e.NodeInfo.Connection.GetRemoteIP();
                LVI.SubItems[3].Text = e.NodeInfo.User.Alias;
                LVI.SubItems[4].Text = e.Status;
            }
        }
Exemplo n.º 8
0
        private void GameSrv_LogOnEvent(object sender, NodeEventArgs e)
        {
            if (lblLast.InvokeRequired)
            {
                lblLast.Invoke(new MethodInvoker(delegate { GameSrv_LogOnEvent(sender, e); }));
            }
            else
            {
                lblLast.Text = e.NodeInfo.User.Alias + " (" + e.NodeInfo.Connection.GetRemoteIP() + ":" + e.NodeInfo.Connection.GetRemotePort() + ")";
                lblOn.Text   = DateTime.Now.ToString("dddd MMMM dd, yyyy") + "  " + DateTime.Now.ToString(_GameSrv.TimeFormatUI).ToLower();
                lblType.Text = e.NodeInfo.ConnectionType.ToString();

                switch (e.NodeInfo.ConnectionType)
                {
                case ConnectionType.RLogin: lblRLogin.Text = (Convert.ToInt32(lblRLogin.Text) + 1).ToString(); break;

                case ConnectionType.Telnet: lblTelnet.Text = (Convert.ToInt32(lblTelnet.Text) + 1).ToString(); break;

                case ConnectionType.WebSocket: lblWebSocket.Text = (Convert.ToInt32(lblWebSocket.Text) + 1).ToString(); break;
                }
            }
        }
Exemplo n.º 9
0
        void GameSrv_NodeEvent(object sender, NodeEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate { GameSrv_NodeEvent(sender, e); }));
            }
            else
            {
                // Skip out of it's not a true status message
                if ((e.Status.StartsWith("ERROR:")) || e.Status.StartsWith("EXCEPTION:") || (e.Status.StartsWith("WARNING:")) || (e.Status.StartsWith("DEBUG:"))) return;

                ListViewItem LVI = lvNodes.Items[e.NodeInfo.Node - _GameSrv.FirstNode];
                LVI.SubItems[1].Text = e.NodeInfo.ConnectionType.ToString();
                LVI.SubItems[2].Text = e.NodeInfo.Connection.GetRemoteIP();
                LVI.SubItems[3].Text = e.NodeInfo.User.Alias;
                LVI.SubItems[4].Text = e.Status;
            }
        }
Exemplo n.º 10
0
        private void GameSrv_LogOnEvent(object sender, NodeEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate { GameSrv_LogOnEvent(sender, e); }));
            }
            else
            {
                ListViewItem LVINodes = lvNodes.Items[e.NodeInfo.Node - _GameSrv.FirstNode];
                LVINodes.SubItems[1].Text = e.NodeInfo.ConnectionType.ToString();
                LVINodes.SubItems[2].Text = e.NodeInfo.Connection.GetRemoteIP();
                LVINodes.SubItems[3].Text = e.NodeInfo.User.Alias;
                LVINodes.SubItems[4].Text = e.Status;

                ListViewItem LVIHistory = new ListViewItem(e.NodeInfo.Node.ToString());
                LVIHistory.SubItems.Add(e.NodeInfo.ConnectionType.ToString());
                LVIHistory.SubItems.Add(e.NodeInfo.Connection.GetRemoteIP());
                LVIHistory.SubItems.Add(e.NodeInfo.User.Alias);
                LVIHistory.SubItems.Add(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString());
                lvHistory.Items.Insert(0, LVIHistory);

                // Keep a counter for number of connections
                switch (e.NodeInfo.ConnectionType)
                {
                    case ConnectionType.RLogin: lblRLoginCount.Text = (Convert.ToInt32(lblRLoginCount.Text) + 1).ToString(); break;
                    case ConnectionType.Telnet: lblTelnetCount.Text = (Convert.ToInt32(lblTelnetCount.Text) + 1).ToString(); break;
                    case ConnectionType.WebSocket: lblWebSocketCount.Text = (Convert.ToInt32(lblWebSocketCount.Text) + 1).ToString(); break;
                }
            }
        }
Exemplo n.º 11
0
 void GameSrv_LogOffEvent(object sender, NodeEventArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new MethodInvoker(delegate { GameSrv_LogOffEvent(sender, e); }));
     }
     else
     {
         ListViewItem LVI = lvNodes.Items[e.NodeInfo.Node - _GameSrv.FirstNode];
         LVI.SubItems[1].Text = "";
         LVI.SubItems[2].Text = "";
         LVI.SubItems[3].Text = "";
         LVI.SubItems[4].Text = "Waiting for a caller...";
     }
 }
Exemplo n.º 12
0
 void NodeManager_NodeEvent(object sender, NodeEventArgs e)
 {
     RaiseNodeEvent(sender, e);
 }
Exemplo n.º 13
0
 void NodeManager_LogOffEvent(object sender, NodeEventArgs e)
 {
     RaiseLogOffEvent(sender, e);
 }
Exemplo n.º 14
0
 void ClientThread_NodeEvent(object sender, NodeEventArgs e)
 {
     RaiseNodeEvent(sender, e);
     UpdateWhoIsOnlineFile();
 }
Exemplo n.º 15
0
        private void GameSrv_LogOnEvent(object sender, NodeEventArgs e)
        {
            if (lblLast.InvokeRequired)
            {
                lblLast.Invoke(new MethodInvoker(delegate { GameSrv_LogOnEvent(sender, e); }));
            }
            else
            {
                lblLast.Text = e.NodeInfo.User.Alias + " (" + e.NodeInfo.Connection.GetRemoteIP() + ":" + e.NodeInfo.Connection.GetRemotePort() + ")";
                lblOn.Text = DateTime.Now.ToString("dddd MMMM dd, yyyy") + "  " + DateTime.Now.ToString(_GameSrv.TimeFormatUI).ToLower();
                lblType.Text = e.NodeInfo.ConnectionType.ToString();

                switch (e.NodeInfo.ConnectionType)
                {
                    case ConnectionType.RLogin: lblRLogin.Text = (Convert.ToInt32(lblRLogin.Text) + 1).ToString(); break;
                    case ConnectionType.Telnet: lblTelnet.Text = (Convert.ToInt32(lblTelnet.Text) + 1).ToString(); break;
                    case ConnectionType.WebSocket: lblWebSocket.Text = (Convert.ToInt32(lblWebSocket.Text) + 1).ToString(); break;
                }
            }
        }
Exemplo n.º 16
0
 void ClientThread_NodeEvent(object sender, NodeEventArgs e)
 {
     RaiseNodeEvent(sender, e);
 }