Ah sorry I thought you were referring to the Nakama asset in the Unity Asset Store.
Ok, so just I’ve upgraded the Nakama image in Docker Desktop from 3.13.1 to 3.14.0.
Just sent a match state and still notice the data I send with the OpCode from Unity shows up as “[object ArrayBuffer]” in the Docker Desktop.
This is my simple matchLoop function for the Nakama server in the index.js file.
var matchLoop = function (context, logger, nakama, dispatcher, tick, state, messages) {
var gameState = state;
for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) {
var message = messages_1[_i];
logger.info("Sending code: " + message.opCode + " Sending data: " +message.data);
dispatcher.broadcastMessage(message.opCode, message.data, null, message.sender);
}
return gameState.endMatch ? null : { state: gameState };
};
And here is a sample of a code in Unity sending out a match state.
public void Move(Tile targetTile)
{
Vector3 unitPos = transform.position;
Vector3 targetPos = targetTile.transform.position;
long opCode = (long) MultiplayerManager.Code.MoveUnit;
string state = GetJsonPositionAndAbilityInd(unitPos, targetPos,0);
}
public string GetJsonPositionAndAbilityInd (Vector3 selectedUnit, Vector3 targetTile, int abilityIndex)
{
var values = new Dictionary<string, string>
{
{"SelectedUnitPos.x", selectedUnit.x.ToString() },
{"SelectedUnitPos.y", selectedUnit.y.ToString() },
{"SelectedUnitPos.z", selectedUnit.z.ToString() },
{"TargetTilePos.x", targetTile.x.ToString() },
{"TargetTilePos.y", targetTile.y.ToString() },
{"TargetTilePos.z", targetTile.z.ToString() },
{"AbilityIndex", abilityIndex.ToString()}
};
return values.ToJson();
}
Any suggestions in what I may be doing wrong?
Thank you.