Пример #1
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);
    }