Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Modules/BeatSaberPlus_ChatRequest/CRConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ internal enum EPermission
internal EPermission RemoveCommandPermissions = EPermission.Moderators;
[JsonProperty] internal bool RemoveCommandEnabled = true;
[JsonProperty] internal string RemoveCommand = "remove";
[JsonProperty] internal string RemoveCommand_OK = $"@$UserName (bsr $BSRKey) $SongName / $LevelAuthorName request by @RequesterName is removed from queue!";
[JsonProperty] internal string RemoveCommand_OK = $"@$UserName (bsr $BSRKey) $SongName / $LevelAuthorName request by @$RequesterName is removed from queue!";
[JsonProperty] internal string RemoveCommand_NotFound = $"@$UserName No song in queue found with the key or username \"$Subject\"!";

[JsonProperty, JsonConverter(typeof(StringEnumConverter))]
Expand Down Expand Up @@ -279,6 +279,9 @@ protected override void OnInit(bool p_OnCreation)

if (Commands != null && !Commands.LinkCommand_CurrentSong.Contains("$SongLink"))
Commands.LinkCommand_CurrentSong += " $SongLink";

if (Commands != null && Commands.RemoveCommand_OK.Contains("@RequesterName"))
Commands.RemoveCommand_OK = Commands.RemoveCommand_OK.Replace("@RequesterName", "@$RequesterName");
}
}
}
2 changes: 2 additions & 0 deletions Modules/BeatSaberPlus_ChatRequest/ChatRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ private void OnSceneChange(CP_SDK_BS.Game.Logic.ESceneType p_Scene)
else
m_LastPlayingLevelResponse = $"{l_CurrentMap.songName} by {l_Mapper}";

m_LastPlayingLevelResponseLink = "";

if (CP_SDK_BS.Game.Levels.LevelID_IsCustom(l_CurrentMap.levelID) && CP_SDK_BS.Game.Levels.TryGetHashFromLevelID(l_CurrentMap.levelID, out var l_Hash))
{
var l_CachedEntry = null as Models.SongEntry;
Expand Down
30 changes: 16 additions & 14 deletions Modules/BeatSaberPlus_ChatRequest/ChatRequest_Logic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ public void AddToQueueFromBSRKey(
l_ForceAllow = true;
}

/// Check if already requested
if (!asModAdd && m_RequestedThisSessionID.Contains(bsrKey.ToLower()))
{
callback?.Invoke(new Models.AddToQueueResult(Models.EAddToQueueResult.AlreadyRequestedThisSession, bsrKey));
return;
}

/// Check if allow listed or blocklisted
if (!asModAdd && !l_ForceAllow)
{
Expand Down Expand Up @@ -128,6 +121,13 @@ public void AddToQueueFromBSRKey(
l_RateLimit.CurrentRequestCount = SongQueue.Where(x => x.RequesterName == requester.UserName).Count();
}

/// Check if already requested
if (!asModAdd && m_RequestedThisSessionID.Contains(bsrKey.ToLower()))
{
callback?.Invoke(new Models.AddToQueueResult(Models.EAddToQueueResult.AlreadyRequestedThisSession, bsrKey));
return;
}

/// Handle limits and title prefix
if (requester != null)
{
Expand Down Expand Up @@ -203,13 +203,6 @@ public void AddToQueueFromBeatmapLevel(
l_ForceAllow = true;
}

/// Check if already requested
if (!asModAdd && m_RequestedThisSessionHash.Contains(l_LevelHash))
{
callback?.Invoke(new Models.AddToQueueResult(Models.EAddToQueueResult.AlreadyRequestedThisSession, l_LevelHash));
return;
}

/// Check if allow listed or blocklisted
if (!asModAdd && !l_ForceAllow)
{
Expand Down Expand Up @@ -240,6 +233,13 @@ public void AddToQueueFromBeatmapLevel(
l_RateLimit.CurrentRequestCount = SongQueue.Where(x => x.RequesterName == requester.UserName).Count();
}

/// Check if already requested
if (!asModAdd && m_RequestedThisSessionHash.Contains(l_LevelHash))
{
callback?.Invoke(new Models.AddToQueueResult(Models.EAddToQueueResult.AlreadyRequestedThisSession, l_LevelHash));
return;
}

/// Handle limits and title prefix
if (requester != null)
{
Expand Down Expand Up @@ -576,6 +576,8 @@ public void ToggleQueueStatus()

if (UI.ManagerLeftView.CanBeUpdated)
UI.ManagerLeftView.Instance.UpdateQueueStatus();
if (UI.ManagerMainView.CanBeUpdated)
UI.ManagerMainView.Instance.RebuiltTitle();
});
}
/// <summary>
Expand Down