The data I get back from a game server is Json. e.g. If I send the login message, the responses are things like:
{"message":"loggedIn", "data":{"username":"bob", "balance":100.0, "session":"asdfasd"}}
{"message":"error","data":{"message":"something went wrong"}}
{"message":"tick","data":"{very complex data...
In the websocket->On message I need to be able to do things like
if ($response.message == "loggedIn") then set txt=$response.data.username else if ($response.message == "something_else") then call some function...
and
for each ($respose.data.item) -> do something with ($respose.data.item.name)
Assuming there is a way to parse the websocket.MessageText, how would one do:
on some event: do A
if X do Y else do Z
do B
I have never figured this out in C2. I am guessing also that each layout can only have one event sheet with one WebSocket On Message in, it as, you cant read from a socket twice and get the same message.
Surely abitrary json parsing should be native to C2? Or are there so few games accessing game servers or content from other sources?