Skip to content
dunkfordyce edited this page Nov 22, 2020 · 2 revisions

read a game KV

assuming you have setup a game key in the BackOffice/Status/KeyValue Storage named contest containing final quest

server side code

function __currentcontest(params, customData, mod) {
	"use strict;"
	// don't edit above this line // must be on line 3
  return this.gamevfs.read(this.game.getPrivateDomain(), "contest")
  .then (function (gamevfs) {      
      return { "contest" : gamevfs.contest };
  });
}

the call to getPrivateDomain could be replaced by the name of a shared domain.

client invocation

CHJSON config;
config.Put("name", "currentcontest");
CHJSON params;
CUserManager::Instance()->Batch(MakeResultHandler(this, &Handle), &config, &params);

results

{
"contest" :  "final quest";
...
}

Clone this wiki locally