Changeset 38:128b9ced9779 in xplra for src/plugin/src/xplra/ServerThread.cc
- Timestamp:
- 02/14/13 16:02:05 (11 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/plugin/src/xplra/ServerThread.cc
r36 r38 39 39 #include "GetMultiDataRefRequest.h" 40 40 #include "SetMultiDataRefRequest.h" 41 #include "MessageRequest.h" 41 42 42 43 #include <hu/varadiistvan/xplcommon/Util.h> … … 152 153 } else if (command==Protocol::COMMAND_GET_VERSIONS) { 153 154 if (!handleGetVersions()) break; 155 } else if (command==Protocol::COMMAND_SHOW_MESSAGE) { 156 if (!handleShowMessage()) break; 154 157 } else { 155 158 stream.writeU8(Protocol::RESULT_INVALID_COMMAND); … … 400 403 stream.writeS32(xplmVersion); 401 404 stream.writeS32(Protocol::version); 405 406 return true; 407 } 408 409 //------------------------------------------------------------------------------ 410 411 bool ServerThread::handleShowMessage() 412 { 413 string message = stream.readString(); 414 float duration = stream.readFloat(); 415 if (!stream) return false; 416 417 if (duration>Protocol::MAX_MESSAGE_DURATION) { 418 stream.writeU8(Protocol::RESULT_INVALID_DURATION); 419 } else { 420 MessageRequest request(listenThread.getMessageWindow(), message, duration); 421 if (!requestQueue.execute(&request)) return false; 422 423 stream.writeU8(Protocol::RESULT_OK); 424 } 402 425 403 426 return true;
Note:
See TracChangeset
for help on using the changeset viewer.