Esempio n. 1
0
 public static void CancelTake(TwitchModule module, string user, bool isWhisper)
 {
     // cancel the takeover attempt if there is one
     if (module.TakeInProgress != null)
     {
         IRCConnection.SendMessage(
             $"The takeover attempt on module {module.Code} ({module.HeaderText}) was manually cancelled by {user}");
         module.StopCoroutine(module.TakeInProgress);
         module.TakeInProgress = null;
     }
     else
     {
         IRCConnection.SendMessage("There are no takeover attempts on this module", user, !isWhisper);
     }
 }
Esempio n. 2
0
    public static void Assign(TwitchModule module, string user, [Group(1)] string targetUser)
    {
        if (TwitchPlaySettings.data.AnarchyMode)
        {
            IRCConnection.SendMessageFormat("Sorry {0}, assigning modules is not allowed in anarchy mode.", user);
            return;
        }

        if (module.TakeInProgress != null)
        {
            module.StopCoroutine(module.TakeInProgress);
            module.TakeInProgress = null;
        }

        module.PlayerName = targetUser;
        module.RemoveFromClaimQueue(user);
        module.CanClaimNow(user, true, true);
        module.SetBannerColor(module.ClaimedBackgroundColour);
        IRCConnection.SendMessageFormat(TwitchPlaySettings.data.AssignModule, module.Code, module.PlayerName, user, module.HeaderText);
    }