Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
service:jsondb [2022/11/28 18:06] – Changed section formatting for table of contents; added a Best Practices section Nightfoxservice:jsondb [2022/11/28 18:08] – [Best Practices] Updated the lock/unlock example Nightfox
Line 62: Line 62:
   var JSON_DB_LOCK_WRITE = 2;   var JSON_DB_LOCK_WRITE = 2;
   var jsonClient = new JSONClient("servername", 10088);   var jsonClient = new JSONClient("servername", 10088);
-  jsonClient.lock("json_scope", "my_game.user_scores", JSON_DB_LOCK_WRITE); +  jsonClient.lock("scores", "player1.TestGame", JSON_DB_LOCK_WRITE); 
-  var scoresData = jsonClient.read("json_scope", "my_game.user_scores", JSON_DB_LOCK_READ);+  var scoresData = jsonClient.read("scores", "player1.TestGame", JSON_DB_LOCK_READ);
   // Change scoresData ...   // Change scoresData ...
-  jsonClient.write("json_scope", "my_game.user_scores", scoresData, JSON_DB_LOCK_WRITE); +  jsonClient.write("scores", "player1.TestGame", scoresData, JSON_DB_LOCK_WRITE); 
-  jsonClient.unlock("json_scope", "my_game.user_scores");+  jsonClient.unlock("scores", "player1.TestGame");