The 60 second introduction
In contrast with the other WordPress For Unity Bridge extensions, the Bridge: Serials extension requires almost nothing for you to do in Unity at all and does most of what it does in the WordPress dashboard instead. To get started with the asset just install it into your project and (if you haven't already done so) upload and activate the wub_serials plugin on your WordPress website. (You only need to do this step once)
So what is the Bridge: Serials extension exactly? Simply put, it allows you to pre-generate any number of serials you want and then pair them up with user accounts. Every user on your website has a unique ID and when they register with a valid serial that ID becomes linked to that serial. This means 4 very important things:
► Nobody else can use that serial any more because It is already allocated to someone
► That serial is linked to that specific game for that specific person's account thus spanning all current and future devices, even temporary ones like an internet café or a friend's phone
► A serial only needs to be entered once per user on any one device then never again. At this point it is safe for the user to forget the serial number as he will never need it ever again, not even when contacting customer support
► Sharing the game or selling it second hand makes absolutely no sense. The game cannot be played with a serial and the serial is linked to a user's account. The player would have to give up his entire account in order to allow for piracy. This would give all pirates access to the account username/password/email and all pirates would share a high score/game progress/in-game currency/ in-game purchases... It makes no sense to pirate the game.
If a user ever decides to sell the game second hand they first have to contact you to ask you to remove the serial from their account. Now the person can give his serial to the person he is selling to or if he has forgotten it you can tell it to him before you remove it from his account. Once that serial is linked to a new account the original owner will now be unable to play. All his game data will still be stored on your servers but he will need to buy a new license before he can play again. At that time, as just mentioned, all previous scores/items/loot/whatever will be there, waiting.
Simplicity in Unity
From within Unity, Bridge : Serials only exposes 3 functions to you:
If a customer owns a serial and has not yet registered the game then use this function to send the serial to the server. It will then be linked to the account of the player who sent it
If at any time you wish to check if a game is registered to the logged in player, call this. It takes no parameters and will either return a bool named "valid" with a value of true or it will trigger your error response callback. This is useful at the start of the game or if you just want to inject random checks to minimize any kind of game hacks
Again, this takes no parameters, but be sure the user is logged in before you call this.
NOTE:The serial is NOT needed for anything after registration so the results of this function are purely for you to use in some cosmetic fasion
Dashboard Control panelBridge:Serials comes with a complete dashboard interface for generating and removing serials. You can reserve serials for games being distributed in retail stores and if you have the Bridge: Money plugin installed you can also sell your games directly via your website which results in non-reserved serials being allocated and registered to the buyer automatically upon purchasing your game. This means your customers never have to enter the serial even once, nor even know that they were ever even issued one. Their game will be registered and ready for them to play from the moment your WooCommerce transaction completes.
Also on the dashboard, you can:
- ► view all available serials
- ► delete or add new / more serials
- ► view all allocated serials per game
- ► view all serials belonging to a specific user
- ► assign or revoke a serial to/from a specific user with a single click
Automatic Bridge Login integration
The demo login prefabs installed into your project when you installed the WordPress for Unity Bridge wil automatically detect once the Bridge: Serials expansion is installed into your project and expose a couple of new fields to you
► Bool Check_for_serial
If true, the login process will check to see if that account has a registered serial linked to it and set the static value WULogin.HasSerial accordingly
► Bool Fetch_serial
If true, the registered serial will be returned after login
► Bool Require_serial_for_login
If true, it changes the behavior of the login prefab(s). Instead of closing the prefab so players can start to play, if no valid serial was found it now redirects to a panel where they have to either register with a serial they have in their possession or (optionally) go to your website to buy one.
The PostLoginMenu screen's "Continue playing" button now also does the same test
► String Product_url
Used by the button on the registration panel in case you want to sell your game from your website.
Defaults to your website home screen if not set, otherwise it redirects users to this absolute URL (example use: link directly to your game's product page)
Automatic WooCommerce integration
All WooCommerce integration for all Bridge extensions is enabled by installing the
Bridge : Money plugin on your website.
If you have that plugin installed and enabled then all you need to do to integrate Bridge : Serials into WooCommerce is to create a normal WooCommerce virtual, non-downloadable product and give it an SKU using the format WUSKU_GID_GAME (where GID is the actual Game ID of the game you are selling).
That is all. You are done!
By doing this anyone who buys the game from your website will automatically be allocated a serial and have that serial registered to their account as soon as the transaction state is set to completed. All they need to do is log in and start playing. That simple
Static properties at your disposal
► Bool RequireSerialForLogin
Maps to the private "Check for serial" bool set in the inspector. Poll this to determine if a serial is required to continue past a certain point. Currently in use by the login function and "Resume game" buttons to either enter the game or display the registration panel.
► Bool HasSerial
Returns whether or not a serial is linked to this account. Works with the "Check for Serial" bool
► String SerialNumber
This property holds the player's serial number if "Fetch serial" was set to true
USE CASE SCENARIOS
► Enable Require_serial_for_login to force people to pay for the game before they can play. This means you can make your game available for free download and not have to worry about it.
► Disable Require_serial_for_login and enable Fetch_serial. This will fetch the registered serial (if any) during login. By doing this you can do your serial checks (WULogin.HasSerial) after a few free levels thus turning your complete game into a demo. To get the full game they just have to pay on your website or enter a serial. No extra downloading required.
► Disable Require_serial_for_login and enable Fetch_serial. Use this to determine if a player has paid for your game and instead of locking the game after a few levels, unlock in-game bonus content only to paid up players. Extra characters, unlimited ammo, half price in-game purchases, turn of ads etc. Make the game free and earn your money via advertisements but provide an incentive for players to buy the game also or to disable ads.