You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A possible solution for this could be to add another parameter to fireEventToScript indicating that data contains a serialized JSON object:
voidServerImpl::fireEventToScript(cocos2d::network::SIOClient* _client, const std::string& event, const std::string& data, constbool containsJson)
{
if (containsJson) {
// I know that I might use rapidjson here
} else {
// It's not safe to use rapidjson on data
}
}
NOTE: As soon as we implement #14619, we should support JSON objects there too!
The text was updated successfully, but these errors were encountered:
This issue is very similar to #14623, but can be solved independently.
Currently it's impossible for the
SIODelegate
to distinguish if the client has sent a plain string or a serialized (JSON) object.As a example I'm sending this with the official JS client:
And with a delegate like:
The log will contain:
A possible solution for this could be to add another parameter to
fireEventToScript
indicating thatdata
contains a serialized JSON object:NOTE: As soon as we implement #14619, we should support JSON objects there too!
The text was updated successfully, but these errors were encountered: