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
while ( ! ( jsonMessageIn = websocketGetMessageInbound() ).empty() ) { // TODO Look into pushing these into the SDL event queue.
const std::string action = jsonMessageIn[ "action" ];
switch ( networkStringValues[ action ] ) {
...
case networkActionUpdateUnits: {
std::vector< std::pair< double, double > > units = jsonMessageIn[ "units" ];
for ( const auto& unit : units )
std::cout << unit.first << "x" << unit.second << std::endl;
}
...
}
}
Describe what happens instead. [[98.02922343358784,-71.97847384808085],[-63.31191659209324,-35.374567995631736],[-110.474999892986,-6.113705884129388],[69.75989939459609,67.16343799507328],[2.3197853267517132,81.05544938056028],[40.16905596844069,80.41366385334712],[-87.83292780117719,-7.74048656814756],[-93.33958934205057,-76.02122165690062],[-23.417427851405677,51.76305532126719],[32.21544673426408,83.85006816965088]] [json.exception.type_error.305] cannot use operator[] with a string argument with array
It seems strange to me that I can see the correct response in the error message but not access it like I would any other array.
Describe which system (OS, compiler) you are using. Emscripten v1.39.10/Clang v8.0.0-3
Describe which version of the library you are using (release version, develop branch). Releasev3.7.3
The text was updated successfully, but these errors were encountered:
It was my mistake (I was sending the array directly, not the array as part of a larger object). I was missing about two lines of code. Sorry about that.
Describe what you want to achieve.
Send array of arrays over a network connection.
Describe what you tried.
On the server:
On the client:
[[98.02922343358784,-71.97847384808085],[-63.31191659209324,-35.374567995631736],[-110.474999892986,-6.113705884129388],[69.75989939459609,67.16343799507328],[2.3197853267517132,81.05544938056028],[40.16905596844069,80.41366385334712],[-87.83292780117719,-7.74048656814756],[-93.33958934205057,-76.02122165690062],[-23.417427851405677,51.76305532126719],[32.21544673426408,83.85006816965088]] [json.exception.type_error.305] cannot use operator[] with a string argument with array
It seems strange to me that I can see the correct response in the error message but not access it like I would any other array.
Describe which system (OS, compiler) you are using.
Emscripten v1.39.10
/Clang v8.0.0-3
Describe which version of the library you are using (release version, develop branch).
Release
v3.7.3
The text was updated successfully, but these errors were encountered: