pardeike / Puppeteer

Puppeteer allows Twitch viewers to control colonists live!
https://puppeteer.rimworld.live
MIT License
6 stars 2 forks source link

Unintentionally Awarding Toolkit Coins #5

Closed SirRandoo closed 3 years ago

SirRandoo commented 3 years ago

Currently Puppeteer's Twitch Toolkit integration calls Viewers.AwardViewersCoins as a means of refreshing Toolkit's viewer list, but Toolkit defaults to awarding coins when the value isn't above 0. As it stands currently, that method is called every time a viewer joins Puppeteer, so every join would give every viewer currently in Toolkit's viewer list extra coins.

If you'd want to manually obtain the viewer list while the game isn't running, you'd have to get the current list of viewers from the chatters api, then stores it inside the jsonallviewers static field in the Viewers class.

pardeike commented 3 years ago

I don’t need the viewers list. I call this method only because not calling it will cause an error when a newly joined twitch viewer interacts with chat commands via the puppeteer website instead of using twitch chat. The purpose of calling the method is purely to make Toolkit load and store the viewer so when I fake send the chat to toolkit it has seen the sender.

pardeike commented 3 years ago

I should instead use this method instead.

SirRandoo commented 3 years ago

If all you want is to insert a Puppeteer viewer inside of Toolkit's viewer cache, you could use GetViewer, or construct a new Viewer. Either option would mimic the results you're getting from the currently used method without the coin side effect.