Ejemplo n.º 1
0
 public Threat(int id, StaticDb.ThreatType threatType, float deployTime, StaticDb.ThreatAttacker threatAttacker, StaticDb.ThreatDanger threatDanger, StaticDb.ThreatAttack threatAttack, float moneyLossPerMinute, bool fromCreateRemote)
 {
     this.id                 = id;
     this.threatType         = threatType;
     this.deployTime         = deployTime;
     this.threatAttacker     = threatAttacker;
     this.threatDanger       = threatDanger;
     this.threatAttack       = threatAttack;
     this.moneyLossPerMinute = moneyLossPerMinute;
     this.fromCreateRemote   = fromCreateRemote;
 }
Ejemplo n.º 2
0
    private Vector3Int CreateObjective(StaticDb.ThreatAttack threatAttack)
    {
        Vector3Int destination;

        switch (threatAttack)
        {
        case StaticDb.ThreatAttack.dos:
            destination = StaticDb.serverInDest;
            break;

        case StaticDb.ThreatAttack.phishing:
            destination = StaticDb.pcDest;
            break;

        case StaticDb.ThreatAttack.replay:
            destination = StaticDb.pcDest;
            break;

        case StaticDb.ThreatAttack.mitm:
            destination = StaticDb.pcDest;
            break;

        case StaticDb.ThreatAttack.stuxnet:
            destination = StaticDb.serverInDest;
            break;

        case StaticDb.ThreatAttack.dragonfly:
            destination = StaticDb.serverInDest;
            break;

        case StaticDb.ThreatAttack.malware:
            destination = Random.Range(0, 2) == 0 ? StaticDb.serverInDest : StaticDb.pcDest;
            break;

        case StaticDb.ThreatAttack.createRemote:
            destination = Random.Range(0, 2) == 0 ? StaticDb.serverInDest : StaticDb.pcDest;
            break;

        case StaticDb.ThreatAttack.timeEvent:
            destination = Random.Range(0, 2) == 0 ? StaticDb.serverInDest : StaticDb.pcDest;
            break;

        case StaticDb.ThreatAttack.fakeLocal:
            destination = Random.Range(0, 2) == 0 ? StaticDb.serverInDest : StaticDb.pcDest;
            break;

        default:
            throw new ArgumentOutOfRangeException("threatAttack", threatAttack, null);
        }

        return(destination);
    }
Ejemplo n.º 3
0
    public Threat NewFakeLocalThreat()
    {
        int id = ++manager.GetGameData().lastThreatId;

        StaticDb.ThreatType threatType = StaticDb.ThreatType.fakeLocal;

        float deployTime = Random.Range(2f, 6f);

        StaticDb.ThreatAttacker threatAttacker = StaticDb.ThreatAttacker.intern;

        StaticDb.ThreatAttack threatAttack = StaticDb.ThreatAttack.fakeLocal;

        StaticDb.ThreatDanger threatDanger = StaticDb.ThreatDanger.fakeLocal;

        float moneyLossPerMinute = Random.Range(3f, 3.5f);

        Threat threat = new Threat(id, threatType, deployTime, threatAttacker, threatDanger, threatAttack, moneyLossPerMinute, false);

        //Debug.Log(threat);

        return(threat);
    }
Ejemplo n.º 4
0
    public static Threat GetThreatFromThreatAttack(StaticDb.ThreatAttack attack)
    {
        StaticDb.ThreatType type;
        switch (attack)
        {
        case StaticDb.ThreatAttack.dos:
        case StaticDb.ThreatAttack.phishing:
        case StaticDb.ThreatAttack.replay:
            type = StaticDb.ThreatType.remote;
            break;

        case StaticDb.ThreatAttack.malware:
        case StaticDb.ThreatAttack.createRemote:
            type = StaticDb.ThreatType.local;
            break;

        case StaticDb.ThreatAttack.mitm:
        case StaticDb.ThreatAttack.stuxnet:
        case StaticDb.ThreatAttack.dragonfly:
            type = StaticDb.ThreatType.hybrid;
            break;

        case StaticDb.ThreatAttack.fakeLocal:
            type = StaticDb.ThreatType.fakeLocal;
            break;

        case StaticDb.ThreatAttack.timeEvent:
            type = StaticDb.ThreatType.timeEvent;
            break;

        default:
            throw new ArgumentOutOfRangeException(nameof(attack), attack, null);
        }

        return(new Threat(-1, type, -1, StaticDb.ThreatAttacker.timeEvent, StaticDb.ThreatDanger.timeEvent, attack, 0, false));
    }