Does anyone have any good resources/reading for implementing a web service layer between the client and database?

Hey there,

I’m looking for any Resources or Reading Links on implementing a Web Service Layer between the Client and Database. I’ve scoured the Unity forums, which have had a wealth of information and direction on best practices and approaches, but I’m trying to find a tutorial/walkthrough on how to actually implement it full circle - from Client Request to Client Update Receipt.

My thought process was initially to roll with a SP game, serialize the Player’s save file, and if the Player manipulated the values so be it (who cares) but then I realized I wanted to have IAP’s in my game… so that forced me to think about a C → WSL → DB interface.

Basic Structure:

  • Client Side - Sends methods for interacting with Server to WSL. Receives dynamic updates from Server.
  • Web Service Layer - Gatekeeper
  • Database (Firebase) - Storage for all Field Values (i.e. coins, resources, IAPs, etc.)

Primary Concerns:

  • IAP manipulation (Partial Solution: Receipt Validation, however how do I implement within this cycle?)
  • User Field Value manipulation: Users changing coins, skills, and other values.

Gray Areas:

  • I’m not sure what info I should have in my Unity3D code as games are not compilable and Players can easily read game code.
  • I’m not sure how what needs to be in the Webservice Layer script.
  • Unity recently partnered with GameSparks, a BaaS for game devs, would a WSL be needed for something like that?
  • Mental-map-wise I’m not clear on the communication cycle of Client → WSL → DB → Client? (or WSL → Client?)

Threads I’ve read in their entirety (including links posted within)

https://forum.unity3d.com/threads/starting-my-mmo-with-sql-server-in-javascript.77447/

Thanks in advance.

Hi @LeAristocrat

With regards to your question: Unity recently partnered with GameSparks, a BaaS for game devs, would a WSL be needed for something like that?

A Web-service layer isn’t really necessary for using GameSparks as we have Cloud Code to do all the intermediary data control, however, it is possible to use our Node JS SDK to act as a middle-man between the server (GameSparks) and your client. The client would send the request to the Node JS Web server, there it would decide whether or not to make calls to GameSparks.

As for your primary concerns, you may find this documentation useful: https://docs.gamesparks.com/documentation/configurator/virtual-goods.html

If you have any other questions regarding GameSparks, please do not hesitate to get in touch with our support team via https://support.gamesparks.net/ - we’d be happy to assist!

Thanks,
Clare