Ignore:
Timestamp:
05/12/13 05:16:48 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added a command to save the current situation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/plugin/src/xplra/ServerThread.cc

    r46 r81  
    4040#include "SetMultiDataRefRequest.h"
    4141#include "ReloadPluginsRequest.h"
     42#ifdef XPLM200
     43#include "SaveSituationRequest.h"
     44#endif
    4245#include "MessageRequest.h"
    4346#include "Globals.h"
     
    170173        } else if (command==Protocol::COMMAND_RELOAD_PLUGINS) {
    171174            if (!handleReloadPlugins()) break;
     175#ifdef XPLM200
     176        } else if (command==Protocol::COMMAND_SAVE_SITUATION) {
     177            if (!handleSaveSituation()) break;
     178#endif
    172179        } else if (command==Protocol::COMMAND_SHOW_MESSAGE) {
    173180            if (!handleShowMessage()) break;
     
    446453//------------------------------------------------------------------------------
    447454
     455#ifdef XPLM200
     456
     457bool ServerThread::handleSaveSituation()
     458{
     459    string path = stream.readString();
     460    SaveSituationRequest request(path);
     461    if (!requestQueue.execute(&request)) return false;
     462
     463    stream.writeU8(request.getSuccess() ? Protocol::RESULT_OK :
     464                   Protocol::RESULT_OTHER_ERROR);
     465
     466    return true;
     467}
     468
     469#endif
     470
     471//------------------------------------------------------------------------------
     472
    448473bool ServerThread::handleShowMessage()
    449474{
Note: See TracChangeset for help on using the changeset viewer.