As far as I can tell I cannot send an array of Room Variables directly with an extension request, adding it to the message object like when I use a SetRoomVariablesRequest directly. Am I correct in this assumption?
To get around this I was working with the ToSFSArray method on my room variables to send them to the server. Here is my client code:
Code: Select all
public static void SendRoomVarUpdateRequest(String roomName, List<RoomVariable> roomVariables)
{
SFSArray roomVariablesArray = new SFSArray();
foreach (RoomVariable rmVar in roomVariables) {
roomVariablesArray.AddSFSArray(rmVar.ToSFSArray());
}
ISFSObject msgObj = new SFSObject();
msgObj.PutUtfString("room", roomName);
msgObj.PutSFSArray("rmVars", roomVariablesArray);
ExtensionRequest request = new ExtensionRequest("rmVar", msgObj);
CommunicationManager.SendMsg(request);
}
Is this the best approach to solve this problem? Or is there a way to more directly send a room variable to the server?
If this is the best way I was having trouble finding any documentation on what the output of ToSFSArray() actually corresponds to to recreate the room variable on the server side. How can I regenerate the RoomVariable from an SFSArray?
Thanks for the help!