Provides data for the IConnectionProvider.ConnectionMade event.
Наследование: System.EventArgs
Пример #1
0
        protected override void OnConnectionMade(object sender, ConnectionMadeEventArgs e)
        {
            lock (this.connections)
                this.connections.Add(e.Connection);

            base.OnConnectionMade(sender, e);
        }
Пример #2
0
        protected virtual void OnConnectionMadeGlobal(object sender, ConnectionMadeEventArgs e)
        {
            if (e.Rejected)
            {
                return;
            }

            lock (this.connections)
                this.connections.Add(e.Connection, ExecutionMode.GlobalOrder);

            e.Connection.MessageReceived += OnGlobalMessageReceived;
            e.Connection.Disconnected    += OnConnectionDisconnectedGlobal;

            var cmade = ConnectionMade;

            if (cmade != null)
            {
                cmade(this, e);
            }
        }
Пример #3
0
        protected override void OnConnectionMadeGlobal(object sender, ConnectionMadeEventArgs e)
        {
            Synchronization.EnterWriteLock();
            this.connections.Add (e.Connection);
            Synchronization.ExitWriteLock();

            base.OnConnectionMadeGlobal (sender, e);
        }
Пример #4
0
        protected override void OnConnectionMadeGlobal(object sender, ConnectionMadeEventArgs e)
        {
            lock (this.syncRoot)
                this.connections.Add (e.Connection);

            // TODO
            //foreach (BanInfo ban in this.authProvider.GetBans().Where (b => b.IPMask != null))
            //{
            //    string[] parts = ban.IPMask.Split ('.');
            //    string[] addressParts = e.Connection.IPAddress.ToString().Split ('.');
            //    for (int i = 0; i < parts.Length; ++i)
            //    {
            //        if (i + 1 == parts.Length || parts[i] == "*")
            //        {
            //            e.Rejected = true;
            //            return;
            //        }

            //        if (addressParts[i] != parts[i])
            //            break;
            //    }
            //}

            base.OnConnectionMadeGlobal (sender, e);
        }
Пример #5
0
 private void OnConnectionMadeGlobalEvent(object sender, ConnectionMadeEventArgs e)
 {
     this.mqueue.Enqueue (e);
     this.wait.Set();
 }
Пример #6
0
        protected virtual void OnConnectionMadeGlobal(object sender, ConnectionMadeEventArgs e)
        {
            if (e.Rejected)
                return;

            lock (this.connections)
                this.connections.Add (e.Connection, ExecutionMode.GlobalOrder);

            e.Connection.MessageReceived += OnGlobalMessageReceived;
            e.Connection.Disconnected += OnConnectionDisconnectedGlobal;

            var cmade = ConnectionMade;
            if (cmade != null)
                cmade (this, e);
        }
Пример #7
0
 private void OnConnectionMadeGlobalEvent(object sender, ConnectionMadeEventArgs e)
 {
     this.mqueue.Enqueue(e);
     this.wait.Set();
 }
Пример #8
0
        protected override void OnConnectionMade(object sender, ConnectionMadeEventArgs e)
        {
            var cincoUser = new CincoUser
            {
                Connection = e.Connection,
                IsActive = true,
                TickRate = options.TickRate,
                UpdateRate = options.UpdateRate
            };

            lock (userLock)
                this.users.Add (e.Connection, cincoUser);

            SendServerInformation (cincoUser);
            base.OnConnectionMade (sender, e);
        }