Sagi-shi contains various logic that needs to be protected on the server, like checking if the player owns equipment before equipping it. The Nakama Server allows developers to write custom logic and expose it to the client as RPCs. See the writing to the Storage Engine authoritatively recipe. Nakama Storage Engine operations can be protected on the server to protect data the player shouldn’t be able to modify (i.e. ![]() Protecting storage operations on the server list_storage_objects_async ( session, "", limit, object_list. Read the storage objects and parse the JSON data: Sagi-shi players can unlock or purchase many items, which are stored in the Storage Engine. The Storage Engine gives you more control over how data can be accessed and structured in collections.Ĭollections are named, and store JSON data under a unique key and the user id.īy default, the player has full permission to create, read, update and delete their own storage objects. The Nakama Storage Engine is a distributed and scalable document-based storage solution for your game. See the In-app Purchase Validation documentation for examples. Sagi-shi players can purchase the virtual in-game currency through in-app purchases that are authorized and validated to be legitimate on the server. See the user account virtual wallet documentation for an example. Wallets can only be updated on the server. wallet ) for currency in wallet Print ( " %s, %s " %. get_account_async ( session ), "completed" ) var wallet = JSON. When using only device authentication, you don’t need a login UI as the player can automatically authenticate when the game launches.Īuthentication is an example of a Nakama feature accessed from a Nakama Client instance. Nakama Device Authentication uses the physical device’s unique identifier to easily authenticate a user and create an account if one does not exist. Login screen and Authentication options Device authentication Sagi-shi will use device and Facebook authentication, linked to the same user account so that players can play from multiple devices. Nakama has many authentication methods and supports creating custom authentication on the server. is_exception (): print ( "An error occurred: %s " % connected ) return print ( "Socket connected." ) connect_async ( session ), "completed" ) if connected. create_socket_from ( client ) func _ready (): var connected : NakamaAsyncResult = yield ( socket. # Make this a node variable or it will disconnect when the function that creates it returns onready var socket : = Nakama. ![]() Sagi-shi calls async methods using the yield operator to not block the calling thread so that the game is responsive and efficient. Many of the Nakama APIs are asynchronous and non-blocking and are available in the Godot SDK as async methods. New versions of the Nakama Unity Client and the corresponding improvements are documented in the Changelog. Sagi-shi gameplay PrerequisitesĪfter downloading the client archive extract its contents into your Godot project folder.įrom the Project -> Project Settings -> Autoload menu add the Nakama.gd singleton (found in addons//).Ĭreate a client object to interact with the server. This client library guide will show you how to use the core Nakama features in Godot by showing you how to develop the Nakama specific parts (without full game logic or UI) of an Among Us (external) inspired game called Sagi-shi (Japanese for “Imposter”).
0 Comments
Leave a Reply. |