EngineStandalone::~EngineStandalone() { // It's important to clean up the sprites before the services go away clearAllSprites(); // Important to do this here before the work manager is destructed. mData.clearServices(); }
void EngineClient::receiveCommand(ds::DataBuffer& data) { char cmd; while (data.canRead<char>() && (cmd=data.read<char>()) != ds::TERMINATOR_CHAR) { if (cmd == CMD_SERVER_SEND_WORLD) { DS_LOG_INFO_M("Receive world, sessionid=" << mSessionId, ds::IO_LOG); //std::cout << "Command server send world, clearing sprites" << std::endl; clearAllSprites(false); if (mSessionId < 1) { setState(mClientStartedState); } else { // Make sure the rest of the blobs are handled mReceiver.setHeaderAndCommandOnly(false); setState(mRunningState); } } else if (cmd == CMD_CLIENT_STARTED_REPLY) { DS_LOG_INFO_M("Receive ClientStartedReply", ds::IO_LOG); onClientStartedReplyCommand(data); } } }