예제 #1
0
        //
        //
        //

        public bool IsClientLocal(ushort id)
        {
            if (isServer && isClient)
            {
                NetConnection clientConnection = clientObject.GetConnection();
                NetConnection serverConnection = serverObject.GetConnection(id);
                IPEndPoint    ipep             = clientConnection.RemoteEndPoint;
                return(ipep.Port == serverPort && ipep.Address.Equals(IPAddress.Loopback) && serverConnection.RemoteEndPoint.Port == clientConnection.Peer.Port);
            }

            return(false);
        }
예제 #2
0
        public void OnClientConnected(LidgrenClient client)
        {
            OnZoneClientConnect();
            ZcRegisterWorld msg = new ZcRegisterWorld(worldZoneId, UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex, GetMachineStaticIP(), client.GetConnection().Peer.Port);

            client.Send(msg, Lidgren.Network.NetDeliveryMethod.ReliableOrdered);
        }