コード例 #1
0
    public override void Process()
    {
        LoadMultipleObjects(new uint[] { Player, HackableObject });
        int[] connectionToAdd = JsonConvert.DeserializeObject <int[]>(JsonData);

        var playerScript = NetworkObjects[0].GetComponent <PlayerScript>();
        var hackObject   = NetworkObjects[1];
        HackingProcessBase hackingProcess = hackObject.GetComponent <HackingProcessBase>();

        if (hackingProcess.ServerPlayerCanAddConnection(playerScript, connectionToAdd))
        {
            hackingProcess.AddNodeConnection(connectionToAdd);
            HackingNodeConnectionList.Send(NetworkObjects[0], hackObject, hackingProcess.GetNodeConnectionList());
        }
    }
コード例 #2
0
        public override void Process(NetMessage msg)
        {
            LoadMultipleObjects(new uint[] { msg.Player, msg.HackableObject });
            int[] connectionToRemove = JsonConvert.DeserializeObject <int[]>(msg.JsonData);

            var playerScript = NetworkObjects[0].GetComponent <PlayerScript>();
            var hackObject   = NetworkObjects[1];
            HackingProcessBase hackingProcess = hackObject.GetComponent <HackingProcessBase>();

            if (hackingProcess.ServerPlayerCanRemoveConnection(playerScript, connectionToRemove))
            {
                hackingProcess.ServerPlayerRemoveConnection(playerScript, connectionToRemove);
                HackingNodeConnectionList.Send(NetworkObjects[0], hackObject, hackingProcess.GetNodeConnectionList());
            }
        }
コード例 #3
0
    public override void Process()
    {
        LoadMultipleObjects(new uint[] { Player, HackableObject, HackingDevice });

        var                playerScript   = NetworkObjects[0].GetComponent <PlayerScript>();
        var                hackObject     = NetworkObjects[1];
        HackingDevice      hackDevice     = NetworkObjects[2].GetComponent <HackingDevice>();
        HackingProcessBase hackingProcess = hackObject.GetComponent <HackingProcessBase>();

        if (hackingProcess.ServerPlayerCanAddDevice(playerScript, hackDevice))
        {
            hackingProcess.AddHackingDevice(hackDevice);
            hackingProcess.ServerStoreHackingDevice(hackDevice);
            HackingNodeConnectionList.Send(NetworkObjects[0], hackObject, hackingProcess.GetNodeConnectionList());
        }
    }
コード例 #4
0
    public override void Process()
    {
        LoadMultipleObjects(new uint[] { Player, HackableObject });
        int[] connectionToAdd = JsonConvert.DeserializeObject <int[]>(JsonData);

        var playerScript = NetworkObjects[0].GetComponent <PlayerScript>();
        var hackObject   = NetworkObjects[1];
        HackingProcessBase hackingProcess = hackObject.GetComponent <HackingProcessBase>();

        if (hackingProcess.ServerPlayerCanAddConnection(playerScript, connectionToAdd))
        {
            SoundManager.PlayNetworkedAtPos(SingletonSOSounds.Instance.WireMend, playerScript.WorldPos);
            hackingProcess.AddNodeConnection(connectionToAdd);
            HackingNodeConnectionList.Send(NetworkObjects[0], hackObject, hackingProcess.GetNodeConnectionList());
        }
    }
コード例 #5
0
        public override void Process(NetMessage msg)
        {
            LoadMultipleObjects(new uint[] { msg.Player, msg.HackableObject });

            var playerScript = NetworkObjects[0].GetComponent <PlayerScript>();
            var hackObject   = NetworkObjects[1];

            if (playerScript.IsGameObjectReachable(hackObject, true, context: hackObject))
            {
                HackingProcessBase hackProcess    = hackObject.GetComponent <HackingProcessBase>();
                List <int[]>       connectionList = hackProcess.GetNodeConnectionList();
                if (connectionList != null)
                {
                    SendDataToClient(NetworkObjects[0], hackObject, connectionList);
                    return;
                }
            }
        }