From ca1aa0f4025096b2f7778f6e95c2a1e2bd0d54a2 Mon Sep 17 00:00:00 2001 From: 5jiji Date: Sun, 10 Mar 2024 13:32:34 +0100 Subject: [PATCH] Fix Bugs - Players who didn't get in the tile would get their tickets refunded. --- Assets/Scripts/BidHandler.cs | 15 +++++++++------ Assets/Scripts/Networking/TwitchClient.cs | 4 ++-- Assets/StreamingAssets/PlayerProfiles.db | Bin 12288 -> 12288 bytes 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/BidHandler.cs b/Assets/Scripts/BidHandler.cs index a5d0078e..500b41d9 100644 --- a/Assets/Scripts/BidHandler.cs +++ b/Assets/Scripts/BidHandler.cs @@ -371,7 +371,7 @@ public void ReleasePlayersIntoTile(GameTile gt, Vector3 beltWayPointPos) UpdateBiddingQ(); } - public void ClearFromQ(PlayerHandler ph, bool updateQ) + public void ClearFromQ(PlayerHandler ph, bool updateQ, bool unbid = false) { ph.ResetBid(); @@ -385,7 +385,7 @@ public void ClearFromQ(PlayerHandler ph, bool updateQ) if (ph.pb != null) ph.pb.ExplodeBall(); - CancelTicketsUsed(ph); + CancelTicketsUsed(ph, unbid); if (updateQ) UpdateBiddingQ(); @@ -593,12 +593,15 @@ private void SetBasePrizeByRarity(RarityType rarity) UpdateBiddingQ(); } - private async void CancelTicketsUsed(PlayerHandler ph) + private async void CancelTicketsUsed(PlayerHandler ph, bool unbid) { - foreach (var rewardID in ph.redemptionsIds.Keys) + if (unbid) { - List redemptionsIds = ph.redemptionsIds[rewardID]; - await TwitchApi.RejectRewardRedemption(rewardID, redemptionsIds); + foreach (var rewardID in ph.redemptionsIds.Keys) + { + List redemptionsIds = ph.redemptionsIds[rewardID]; + await TwitchApi.RejectRewardRedemption(rewardID, redemptionsIds); + } } ph.redemptionsIds.Clear(); diff --git a/Assets/Scripts/Networking/TwitchClient.cs b/Assets/Scripts/Networking/TwitchClient.cs index 01f163f4..890f9588 100644 --- a/Assets/Scripts/Networking/TwitchClient.cs +++ b/Assets/Scripts/Networking/TwitchClient.cs @@ -362,7 +362,7 @@ private void ProcessGlobalCommands(string messageId, PlayerHandler ph, string ms else if (commandKey.StartsWith("!cancelbid") || commandKey.StartsWith("!unbid")) { - _bidHandler.ClearFromQ(ph, updateQ:true); + _bidHandler.ClearFromQ(ph, updateQ:true, unbid:true); } else if (commandKey.StartsWith("!song")) @@ -687,4 +687,4 @@ private string RemoveTwitchEmotes(string rawMsg, List emotes) return noEmotesSb.ToString(); } -} \ No newline at end of file +} diff --git a/Assets/StreamingAssets/PlayerProfiles.db b/Assets/StreamingAssets/PlayerProfiles.db index e038ff61943a5fff773272980b4319a5f946fd4f..32ed52c826a0e9f50f7aa0de7e2e55f22458cb26 100644 GIT binary patch literal 12288 zcmeI0QEVJX8OL|e_WADYyNOe~NoyzB+@wj)RMF1N?(A+UklnpKHl7^c_EQn+6wv*QCEP35Gqoj5^Z@2JU~&T7O5bRcnDxsDx|6i2~w*HDiu+7 z=j_&#Ox2gZAni(b<8QwC&o}e?zL~r8>}RIKZlEl*qb0wq5NVqv%hF**ktB)4ufF)T z`N;7f{hLPICiaItL^|}jyNlp$DN}qvDn0;y@nM40pAtw3qy$m|DS?zgN+2bW5=aT8 z1pW^Roc*FaxT8{$A6e=8bIsu1roS3Q_eSl7uo-lCE91_1cHL9zwlnQ1W!_m<4i?Jw zhr;gs;*n}uIq669i+-dmN8yqmttuyiRi)MLDy@}fQ@MR}&!>tTo9F&u+B^o_J=r-E2p91*bTL8?_&5 z-7rr*^26p-ir8CxUJ#j@;^U-i=^R*xVb z5uEBg*o;$q%wOrYnSG3}p<{@*li&5ZASI9z_(%!R$+3}-#UEnhY}Q;(&LvNl;F+LN4gIBd zt1;ub1VhzRiCV+Cb$hV-OZPCX2z8pu=`{1X70>hT4ml`OV7|3U!3%NmS@Lx?_1g-P*n%(y~}*a`A`>byK%> ztGCYEMDZ%|adGO9oj`b95c`O56SMeV6E%P>1>aVG30jVYL^pT6^KwbX2HAJQoym zQL$lE**e{GUtO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