- Published on
Devlog #13 - Authentication & Character Creation
Devlog #13... I should have known this week would be cursed. I started off trying to get https://supertokens.com/ running on Amazon AWS Lambda. It was broken and a nightmare. Now I've switch to using https://vercel.com/ and I have auth up and running already. YES!
Google, Apple, Discord, Email/Password, and it all just... works. I like this web dev future we're living in wow. But now I have to integrate it with Patreon and the actual game. This might be tricky.
Patreon's API is kind of a nightmare at times but I finally found a combination that gets me the user's pledge history. I'm now logging that pledge history when you visit the https://fantasyonline2.com/ in order to give out rewards later. The website is also now displaying more accurate reward values. Check it out and report any bugs you find on our Discord server https://discord.gg/fantasyonline2!
With that tested and working, thanks to members on the discord, I switched back to the ReactJS SuperTokens app and added the same Patreon processing that I just added to the main website's php index file. Now we have a ReactJS website that can authenticate with a SuperTokens instance which then authenticates with Patreon and links it all together. Now all we need to do is pass some of the data we have about the user to the game server and have the game server do one final authentication pass. To do that I will just redirect to another url where the BabylonJS project is hosted or I will embed the BabylonJS project into the ReactJS app. I'm leaning towards redirect as then the two projects stay separate and I don't have ReactJS or a million other NodeJS packages seeping into the actual game.
After a lot of soul searching I decided to put character selection and choosing a character name in the main website and not in the game for now as both those things are very suited to a webpage.
There will be 4 character slots total for each account starting on July 7th, 2023. Before 7/7 we are going to allow the number of characters and names to be created equal to the number of Alpha Halos you've earned. If you have more than or equal to 4 halos then you get all 4 characters very soon. On my Gamer tier test account I have 3 as seen above. This will be going into effect in about a week.
The "Create a character" buttons are up and clicking and now we'll setup the choose a name screen. But before I do that, let's set up a git repo for what appears to be the next fantasyonline2.com. Wouldn't want to lose work. Ahh that feels better!
Updated the new website with a temp logo as the React logo was getting old. Then I moved on to actually writing the code for character creation. It required new MySQL tables for Characters, CharacterNames, and CharacterInfo. I created a few api endpoints for checking a valid name, creating a character, and getting all characters associated with the account.
After the endpoints I went ahead and setup the frontend with a character name input screen.
The choose a name screen calls the backend to insert all the rows into the tables listed above and voila we've got character selection, creation, and naming!
Now we just need to style it a bit and have people on Discord test it before I launch it to fantasyonline2.com!
Looks decent. I'll have Lighterthief make it prettier but everything is working smoothly!
After a bit of styling and a few more bug fixes, I think we've got a winner. Apple sign in takes some time to be activated so I'll come back to that later.
Thanks to everyone on Discord who helped with testing as it seems to be mostly bug free for now. That is except for the Alpha Halo count which is currently bugged by Patreon upgrade events having weird data. I will send a message to the Patreon devs and get that resolved soon.
With that being said, head on over to https://fantasyonline2.com/ and transfer over your reserved character name or make a new one if you haven't reserved one yet. I'll make an announcement post when more character slots are unlocked.
That's it for this week. I have been dreading auth since the beginning of this project and I'm really excited to be mostly done with it now. Next week I'll thankfully head back to game development where I'll be continuing work on quests and skills.
See you next Friday!
Have Fun & Keep Gaming!