How to fill CustomGameProperties parameter properly for createRoom?

Options
We're porting our game to HTML5 and we got a problem when trying to create room. In Unity we can submit custom properties as hashtable however with Javascript SDK, we're unable to do that. For example these line of code
var opt; opt.push("Hello", "World"); this.createRoom(null, { customGameProperties: opt });
on server customGameProperties should be a Hashtable with one element with key "Hello" and Value is "World" (if we create the room using Unity version) but instead we got a HashTable with 2 elements {"0": "Hello"} and {"1": "World"}. How can we fix the above code so we get the outcome like Unity version?

Comments

  • vadim
    Options
    It should be var opt = {"Hello": "World"}
    Javascript object is hashtable. When using 'push', you create array instead.
  • no1no
    Options
    Thanks, It's working now. In case anyone wondering, if you have more than one key value pair then simply add it like this
    var opt = {"Hello": "World", "Hey": "You"}