![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | karismaup |
It appears there is something wrong in converting the dictionary to a JSON string, as the project crashes when trying to convert dictionaries. Converting a string to JSON works fine, as does storing a string to a file.
I get the following error: drivers/unix/net_socket_posix.cpp:190 - Socket error: 10054
- Server disconnected! when converting a Dictionary into a JSON string. The user on the forums gets the following error: drivers/windows/stream_peer_tcp_winstock.cpp:203 - Server disconnected!, which seems like the same issue, just for different operating systems
if( fileChecker( _jsonPath ) )
{
File jsonfile = new File();
jsonfile.Open( _jsonPath , (int)File.ModeFlags.Read );
string jsonString = jsonfile.GetAsText();
JSONParseResult dict = JSON.Parse(jsonString);
jsonfile.Close();
if( dict.Error != 0 )
{
GD.Print( "Error:" , dict.Error );
}else{
Array parsed = dict.Result as Array;
var nodeScene = parsed.GetValue(0) as Dictionary<object , object>;
//Error
}
};