Changeset 39:44eda5bbbdfb in xplra


Ignore:
Timestamp:
02/14/13 16:09:27 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
Message:

Implemented a plugin reload command

Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • misc/client.py

    r38 r39  
    429429        self._writeString(message)
    430430        self._writeFloat(duration)
     431        self._flush()
     432
     433        result = self._readU8()
     434        if result!=0:
     435            print >> sys.stderr, "Error code:", result
     436
     437    def do_reload(self, args):
     438        self._writeU8(0x32)
    431439        self._flush()
    432440
  • src/plugin/src/xplra/Makefile.am

    r38 r39  
    1717        GetMultiDataRefRequest.cc       \
    1818        SetMultiDataRefRequest.cc       \
     19        ReloadPluginsRequest.cc         \
    1920        MessageWindow.cc                \
    2021        MessageRequest.cc
     
    3435        GetMultiDataRefRequest.h        \
    3536        SetMultiDataRefRequest.h        \
     37        ReloadPluginsRequest.h          \
    3638        MessageWindow.h                 \
    3739        MessageRequest.h
  • src/plugin/src/xplra/Protocol.h

    r38 r39  
    9797
    9898    /**
     99     * Command: reload the plugins
     100     */
     101    static const uint8_t COMMAND_RELOAD_PLUGINS = 0x32;
     102
     103    /**
    99104     * Command: show a message in the message window.
    100105     */
  • src/plugin/src/xplra/ServerThread.cc

    r38 r39  
    3939#include "GetMultiDataRefRequest.h"
    4040#include "SetMultiDataRefRequest.h"
     41#include "ReloadPluginsRequest.h"
    4142#include "MessageRequest.h"
    4243
     
    153154        } else if (command==Protocol::COMMAND_GET_VERSIONS) {
    154155            if (!handleGetVersions()) break;
     156        } else if (command==Protocol::COMMAND_RELOAD_PLUGINS) {
     157            if (!handleReloadPlugins()) break;
    155158        } else if (command==Protocol::COMMAND_SHOW_MESSAGE) {
    156159            if (!handleShowMessage()) break;
     
    409412//------------------------------------------------------------------------------
    410413
     414bool ServerThread::handleReloadPlugins()
     415{
     416    ReloadPluginsRequest request;
     417    if (!requestQueue.execute(&request)) return false;
     418
     419    stream.writeU8(Protocol::RESULT_OK);
     420
     421    return true;
     422}
     423
     424//------------------------------------------------------------------------------
     425
    411426bool ServerThread::handleShowMessage()
    412427{
  • src/plugin/src/xplra/ServerThread.h

    r38 r39  
    243243
    244244    /**
     245     * Handle the COMMAND_RELOAD_PLUGINS command.
     246     *
     247     * @return true, if we can continue, false if the thread should quit
     248     */
     249    bool handleReloadPlugins();
     250
     251    /**
    245252     * Handle the COMMAND_SHOW_MESSAGE command
    246253     *
Note: See TracChangeset for help on using the changeset viewer.