Example #1
0
        public bool RequestPeerConnection(string VirtualIP, decimal ConnectionId)
        {
            lock (client.PeerConnections)
            {
                RootPeer peer = client.onGetNewPeerObject();
                peer.VirtualIP    = VirtualIP;
                peer.ConnectionId = ConnectionId;
                peer._client      = client;
                peer.FromClient   = client;

                if (client.PeerConnections.ContainsKey(ConnectionId))
                {
                    client.Disconnect(); //should never happen!
                }
                bool HasPermission = client.onPeerConnectionRequest(peer);

                if (HasPermission)
                {
                    client.PeerConnections.Add(ConnectionId, peer);
                }
                else
                {
                    peer = null;
                }
                return(HasPermission);
            }
        }
Example #2
0
        public override void ProcessPayload(IClient client, Plugin.IPlugin plugin = null)
        {
            SSPClient c = client as SSPClient;

            if (c != null)
            {
                c.ConnectionClosedNormal = true;
                if (!client.Connection.InvokedOnDisconnect)
                {
                    client.Connection.InvokedOnDisconnect = true;
                    c.Disconnect(Reason);
                }
            }
            base.ProcessPayload(client, plugin);
        }