public IEnumerator ReleaseModule(string player, string userNickName)
 {
     if (!UserAccess.HasAccess(userNickName, AccessLevel.Mod, true))
     {
         yield return(new WaitForSeconds(TwitchPlaySettings.data.ClaimCooldownTime));
     }
     ClaimedList.Remove(player);
 }
Exemplo n.º 2
0
        public ClaimedList Save(ClaimedList entity)
        {
            var objectGuid = Guid.Parse(entity.Id);
            var metadata   = Metadata(objectGuid);

            _repo.MetadataSet(objectGuid, metadata.Guid, metadata.MetadataSchemaGuid, metadata.LanguageCode, metadata.RevisionID, entity.ToXml(), metadata.EditingUserGuid);

            return(entity);
        }
        private static ClaimedList Make_ClaimedList()
        {
            var xml =
                XDocument.Parse(
                    "<Experiments><Item Id='00000000-0000-0000-0000-000000000001' ClaimedOnDate='' /><Item Id='00000000-0000-0000-0000-000000000002' ClaimedOnDate='' /></Experiments>");
            var claimedList = new ClaimedList("00000000-0000-0000-0000-000000000001", xml);

            return(claimedList);
        }
 public void OnPass()
 {
     canvasGroupMultiDecker.alpha = 0.0f;
     Solved = true;
     if (playerName != null)
     {
         ClaimedList.Remove(playerName);
     }
     if (TakeInProgress != null)
     {
         StopCoroutine(TakeInProgress);
         TakeInProgress = null;
     }
 }
 public string ClaimModule(string userNickName, string targetModule)
 {
     if (playerName != null)
     {
         return(string.Format(TwitchPlaySettings.data.ModulePlayer, targetModule, playerName, headerText.text));
     }
     if (ClaimedList.Count(nick => nick.Equals(userNickName)) >= TwitchPlaySettings.data.ModuleClaimLimit && !Solved)
     {
         return(string.Format(TwitchPlaySettings.data.TooManyClaimed, userNickName, TwitchPlaySettings.data.ModuleClaimLimit));
     }
     else
     {
         ClaimedList.Add(userNickName);
         SetBannerColor(claimedBackgroundColour);
         playerName = userNickName;
         return(string.Format(TwitchPlaySettings.data.ModuleClaimed, targetModule, playerName, headerText.text));
     }
 }
    public IEnumerator TakeModule(string userNickName, string targetModule)
    {
        if (takeModuleSound != null)
        {
            takeModuleSound.time = 0.0f;
            takeModuleSound.Play();
        }
        yield return(new WaitForSecondsRealtime(60.0f));

        SetBannerColor(unclaimedBackgroundColor);
        if (playerName != null)
        {
            ircConnection.SendMessage(TwitchPlaySettings.data.ModuleAbandoned, targetModule, playerName, headerText.text);
            ClaimedList.Remove(playerName);
            playerName     = null;
            TakeInProgress = null;
        }
    }