Skip to main content

I updated to TwiWorks 2.X and everything broke!

danger

Before continuing, please ensure you have a backup of your project available. We can provide an older version of TwiWorks if required, and should anything go wrong while upgrading, you probably wouldn't want to loose your project.

Whoops! Unfortunately, the Unreal Engine Marketplace does not have a reliable way of warning users about updates/breaking changes. With TwiWorks 2.0, we reworked a lot of the core functionality to make it more reliable and to add support for a bunch of new features (such as announcements, enhanced channel points support, new follower events and more!). While we tried to keep everything as backwards-compatible as posible, we removed a small number of nodes/events that have been deprecated for a while (e.g. the OnRitual event). We also addressed a few typos in node names and removed the mandatory OnMessage/OnCheer events from the Connect to Twitch node.

Finally, in light of the changes under the hood, TwiWorks requires some new OAuth scopes for things to work the way they should. Whenever a scope is missing, it will print a warning to your Output Log with the scope that is required, but a brief overview of the scopes the new system requires has been provided below:

  • user:read:chat
  • user:write:chat
  • moderator:read:chatters
  • user:read:subscriptions
  • moderator:read:followers
  • moderator:manage:announcements
  • user:manage:whispers
  • moderator:manage:banned_users
  • channel:manage:redemptions
  • moderator:manage:chat_settings
  • channel:moderate

Now that we know what happened, how do we go about upgrading/fixing these issues? There are two parts to this: the login system and your Blueprints. See the sections below for guidance on each topic.

Login System

As mentioned above, the latest version of TwiWorks uses different (and some new) OAuth scopes. Furthermore, for the Apache/Docker backend, the Refresh Token request has changed to patch a potential security vulnerability. Instructions on how to update each of the three supported login methods can be found below:

Apache/Docker Backend.

If you're using the Apache/Docker backend, you'll need to download the latest version and replace your existing files. In case of the Apache backend, you'll also need to re-run the setup.php script as this will set up the OAuth scopes (scopes can now be changed through the config.ini file). For the Docker backend, please ensure you use the latest config.ini file from DockerResources as this includes the OAuth scopes.

In essence, you'll be running through a new installation of the backend, but for the Apache version you can still use the same database/table. For the latest version of the files and setup instructions, please refer to the TwiWorks Login Backend page.

Local Login

Updating the Local Login is easy - simply open up your TwiWorks settings and look for the Local Login Scopes setting (under the Local Login category). Remove all the scopes from this list, and re-create them based on the OAuth scopes listed in the introduction of this section. If you choose to omit certain scopes, please disable the corresponding features in the TwiWorks settings.

Hard-coded tokens

Please create a new token with the relevant credentials. If you're using a bot token, you may need additional scopes and authorizations from the channel you're trying to moderate. More info TBA.

Troubleshooting

If things aren't working the way you expect them to, please take a look at your Output Log. The output log will print out a list of OAuth scopes your token has access to when it's connecting to Twitch, and operations that require OAuth scopes that your token doesn't have access to will log a warning. If you encounter this problem, please manually ensure your config.ini file, Local Login Scopes section or token generator settings have the relevant scopes.

Blueprint Code

Your best bet at tackling the changes is by following the following steps for each TwiWorks-related Blueprint that you have in your project. Start by opening up the Blueprint and try to compiling it - this will likely give you a couple of errors. Go to each of these errors, and solve them using the steps below:

The Connect to Twitch node

If you're having trouble with the Connect to Twitch node, and it's missing OnMessage/OnCheer pins, right-click on the pins and press the remove button. This will get rid of the old connections, but to keep things working the way they should, you'll still need to bind to the events. To do this, connect the Bind to OnMessage / Bind to OnCheer node to the OnSuccess pin of the Connect to Twitch node. Drag in your chat and the original event, and there you go, your Connect to Twitch node is ready to go! For more information on the event system, take a look at the Additional Events page.

The OnRitual event

This event was removed in version 2.0 of TwiWorks. If you rely on this node for your project, please reach out to us via email for further guidance or an older copy of TwiWorks. Please include proof-of-purchase if you're interested in reveting to the previous version.

This node no longer exists

This was likely one of the nodes that was renamed due to a typo. To solve the problem, simply re-create the node by placing the new node (with the typo fixed; look for twitch to list all TwiWorks nodes), move your connections over and finally remove the old node.

Another Compilation Error

If you've run into an issue that isn't listed here, please reach out to us and we'll see what we can do to help you out.

Closing Remarks

If you've run into an issue that isn't listed here, please reach out to us and we'll see what we can do to help you out. If you're interested in reverting to the previous version of TwiWorks, please include proof-of-purchase with your request.

If you need to revert urgently, please refer to the changelog page to figure out what the most recent version of the engine is that had an update that is not this version. Use the launcher build of that engine version to download the plugin, and copy it from Engine/Plugins/Marketplace/TwitchWorks to YOURPROJECT/TwitchWorks. Create a C++ class if not present, rebuild (ignoring the incompatible engine version warning; suppress it by updating the version in TwitchWorks.uplugin) and you're back to the old version.