Esempio n. 1
0
 /// <summary>
 /// Configures the ID card with the specified settings
 /// </summary>
 /// <param name="idCardType">type of card</param>
 /// <param name="jobType">job on the card</param>
 /// <param name="allowedAccess">what the card can access</param>
 /// <param name="name">name listed on card</param>
 public void Initialize(IDCardType idCardType, JobType jobType, List <Access> allowedAccess, string name)
 {
     //Set all the synced properties for the card
     RegisteredName = name;
     jobTypeInt     = (int)jobType;
     idCardTypeInt  = (int)idCardType;
     AddAccessList(allowedAccess);
 }
Esempio n. 2
0
 /// <summary>
 /// Configures the ID card with the specified settings
 /// </summary>
 /// <param name="idCardType">type of card</param>
 /// <param name="jobType">job on the card</param>
 /// <param name="allowedAccess">what the card can access</param>
 /// <param name="name">name listed on card</param>
 private void Initialize(IDCardType idCardType, JobType jobType, List <Access> allowedAccess, string name)
 {
     //Set all the synced properties for the card
     SyncName(registeredName, name);
     this.jobType = jobType;
     SyncIDCardType(idCardType, idCardType);
     ServerAddAccess(allowedAccess);
 }
Esempio n. 3
0
    private IDCardType GetIDCard(bool sts)
    {
        IDCardType       card = new IDCardType();
        AuthenticityType auth = new AuthenticityType();
        IDCardDataType   data = new IDCardDataType();

        card.Authenticity = auth;
        card.IDCardData   = data;

        data.IDCardType    = "IdCardSignature";
        data.IDCardVersion = "1.1";

        // Issuer
        card.Issuer = "SEI Client";

        // Subject
//		auth.NameID = "1111111118";
        auth.NameID = "2207712801";
        //			card.NameIDFormat            = FormatIds.cprnumber;
        auth.MakeCertificate = new CertificateMaker(GetCertificate);

        // Conditions
        //			card.CardLifeTime            = CardLifeTimeType.Hours8;

        // Authentication (STS)
        if (sts)
        {
            card.STS = new STSType();
            card.STS.IssuerAddress      = "SOSI-STS";
            card.STS.Endpoint           = "http://pan.certifikat.dk/sts/services/SecurityTokenService";
            card.STS.CertificatePointer = "?";
        }

        // Attributes
        data.IDCardType          = "user";
        data.AuthenticationLevel = 3;
//		data.UserCivilRegistrationNumber = "1111111118";
        data.UserCivilRegistrationNumber = "2207712801";
        data.UserGivenName    = "Bent";
        data.UserSurName      = "Hansen";
        data.UserEmailAddress = "*****@*****.**";
        data.UserRole         = "SEI User";
        data.UserOccupation   = "?";

        // System log
        data.ITSystemName         = "SEI Client";
        data.CareProviderID       = "12070918";
        data.CareProviderIDFormat = "medcom:cvrnumber";
        data.CareProviderName     = "SST";

        return(card);
    }
Esempio n. 4
0
    /* Example Spawn:
     *
     * //Only client side spawn, not network. For things that are just eye candy like bullets, sparks etc
     * public void SpawnSomeItem(float ItemStatAmt, Vector2 position){
     *
     *  GameObject itemObj = PoolManager.PoolClientInstantiate(Instance.someItem, position, Quaternion.identity);
     *  ItemThingy iT = itemObj.GetComponent<ItemThingy>();
     *  iT.DoStuff(ItemStatAmt);
     * }
     *
     * Example of a network pool spawn:
     * GameObject networkedObj = PoolManager.PoolNetworkInstantiate(prefabObj, Vector2.zero, Quaternion.identity);
     */

    /// <summary>
    ///     For spawning new ID cards, mostly used on new player spawn
    /// </summary>
    public GameObject SpawnIDCard(IDCardType idCardType, JobType jobType, List <Access> allowedAccess, string name)
    {
        //No need to pool it but doesn't hurt (and requires less lines)
        GameObject idObj = PoolManager.Instance.PoolNetworkInstantiate(idCard, Vector2.zero, Quaternion.identity);
        IDCard     ID    = idObj.GetComponent <IDCard>();

        //Set all the synced properties for the card
        ID.RegisteredName = name;
        ID.jobTypeInt     = (int)jobType;
        ID.idCardTypeInt  = (int)idCardType;
        ID.AddAccessList(allowedAccess);
        return(idObj);
    }
Esempio n. 5
0
    /* Example Spawn:
     *
     * //Only client side spawn, not network. For things that are just eye candy like bullets, sparks etc
     * public void SpawnSomeItem(float ItemStatAmt, Vector2 position){
     *
     *  GameObject itemObj = PoolManager.PoolClientInstantiate(Instance.someItem, position, Quaternion.identity);
     *  ItemThingy iT = itemObj.GetComponent<ItemThingy>();
     *  iT.DoStuff(ItemStatAmt);
     * }
     *
     * Example of a network pool spawn:
     * GameObject networkedObj = PoolManager.PoolNetworkInstantiate(prefabObj, Vector2.zero, Quaternion.identity);
     */

    /// <summary>
    ///     For spawning new ID cards, mostly used on new player spawn
    /// </summary>
    public GameObject SpawnIDCard(IDCardType idCardType, JobType jobType, List <Access> allowedAccess, string name, Transform parent)
    {
        //No need to pool it but doesn't hurt (and requires less lines)
        GameObject idObj = SpawnItem(idCard, parent);
        IDCard     ID    = idObj.GetComponent <IDCard>();

        //Set all the synced properties for the card
        ID.RegisteredName = name;
        ID.jobTypeInt     = (int)jobType;
        ID.idCardTypeInt  = (int)idCardType;
        ID.AddAccessList(allowedAccess);
        return(idObj);
    }
Esempio n. 6
0
 public void SyncIDCardType(IDCardType oldCardType, IDCardType cardType)
 {
     idCardType = cardType;
     if (idCardType == IDCardType.standard)
     {
         spriteRenderer.sprite = standardSprite;
     }
     else if (idCardType == IDCardType.command)
     {
         spriteRenderer.sprite = commandSprite;
     }
     else if (idCardType == IDCardType.captain)
     {
         spriteRenderer.sprite = captainSprite;
     }
     pickupable.RefreshUISlotImage();
 }
Esempio n. 7
0
        private IDCardType GetIDCard()
        {
            IDCardType       card = new IDCardType();
            AuthenticityType auth = new AuthenticityType();
            IDCardDataType   data = new IDCardDataType();

            card.Authenticity = auth;
            card.IDCardData   = data;

            data.IDCardType    = "IdCardSignature";
            data.IDCardVersion = "1.1";

            // Issuer
            card.Issuer = "SEI Client";

            // Subject
            auth.NameID = "1111111118";
//			card.NameIDFormat            = FormatIds.cprnumber;
            auth.MakeCertificate = new CertificateMaker(GetCertificate);

            // Conditions
//			card.CardLifeTime            = CardLifeTimeType.Hours8;

            // Authentication (STS)

            // Attributes
            data.IDCardType                  = "user";
            data.AuthenticationLevel         = 3;
            data.UserCivilRegistrationNumber = "1111111118";
            data.UserGivenName               = "Bent";
            data.UserSurName                 = "Hansen";
            data.UserEmailAddress            = "*****@*****.**";
            data.UserRole       = "SEI User";
            data.UserOccupation = "?";

            // System log
            data.ITSystemName         = "SEI Client";
            data.CareProviderID       = "12070918";
            data.CareProviderIDFormat = "medcom:cvrnumber";
            data.CareProviderName     = "SST";

            return(card);
        }
Esempio n. 8
0
    private void InitCard()
    {
        if (isInit)
        {
            return;
        }

        isInit = true;
        accessSyncList.Callback += SyncAccess;

        //This will add the access from ManuallyAddedAccess list
        if (isServer)
        {
            if (manuallyAddedAccess.Count > 0)
            {
                ServerAddAccess(manuallyAddedAccess);
                idCardType = manuallyAssignCardType;
            }
        }
    }
Esempio n. 9
0
    public void SyncIDCardType(int cardType)
    {
        idCardTypeInt = cardType;
        IDCardType cType = GetIdCardType;

        switch (cType)
        {
        case IDCardType.standard:
            spriteRenderer.sprite = standardSprite;
            break;

        case IDCardType.command:
            spriteRenderer.sprite = commandSprite;
            break;

        case IDCardType.captain:
            spriteRenderer.sprite = captainSprite;
            break;
        }
    }
Esempio n. 10
0
    public void SyncIDCardType(IDCardType cardType)
    {
        idCardType = cardType;
        IDCardType cType = IDCardType;

        switch (cType)
        {
        case IDCardType.standard:
            spriteRenderer.sprite = standardSprite;
            break;

        case IDCardType.command:
            spriteRenderer.sprite = commandSprite;
            break;

        case IDCardType.captain:
            spriteRenderer.sprite = captainSprite;
            break;
        }

        pickupable.RefreshUISlotImage();
    }