Added code to process set/reset options messages from server.

This commit is contained in:
crs 2002-12-23 14:47:44 +00:00
parent 3fc1ddf6ce
commit 78538da754
2 changed files with 34 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#include "CServerProxy.h" #include "CServerProxy.h"
#include "CProtocolUtil.h" #include "CProtocolUtil.h"
#include "IClient.h" #include "IClient.h"
#include "OptionTypes.h"
#include "ProtocolTypes.h" #include "ProtocolTypes.h"
#include "IInputStream.h" #include "IInputStream.h"
#include "IOutputStream.h" #include "IOutputStream.h"
@ -161,6 +162,14 @@ CServerProxy::mainLoop()
setClipboard(); setClipboard();
} }
else if (memcmp(code, kMsgCResetOptions, 4) == 0) {
resetOptions();
}
else if (memcmp(code, kMsgDSetOptions, 4) == 0) {
setOptions();
}
else if (memcmp(code, kMsgCClose, 4) == 0) { else if (memcmp(code, kMsgCClose, 4) == 0) {
// server wants us to hangup // server wants us to hangup
LOG((CLOG_DEBUG1 "recv close")); LOG((CLOG_DEBUG1 "recv close"));
@ -197,6 +206,7 @@ CServerProxy::mainLoop()
else { else {
// unknown message // unknown message
LOG((CLOG_ERR "unknown message from server")); LOG((CLOG_ERR "unknown message from server"));
LOG((CLOG_ERR "unknown message: %d %d %d %d [%c%c%c%c]", code[0], code[1], code[2], code[3], code[0], code[1], code[2], code[3]));
failedToConnect = true; failedToConnect = true;
break; break;
} }
@ -516,6 +526,28 @@ CServerProxy::screensaver()
getClient()->screensaver(on != 0); getClient()->screensaver(on != 0);
} }
void
CServerProxy::resetOptions()
{
// parse
LOG((CLOG_DEBUG1 "recv reset options"));
// forward
getClient()->resetOptions();
}
void
CServerProxy::setOptions()
{
// parse
COptionsList options;
CProtocolUtil::readf(getInputStream(), kMsgDSetOptions + 4, &options);
LOG((CLOG_DEBUG1 "recv set options size=%d", options.size()));
// forward
getClient()->setOptions(options);
}
void void
CServerProxy::queryInfo() CServerProxy::queryInfo()
{ {

View File

@ -105,6 +105,8 @@ private:
void mouseMove(); void mouseMove();
void mouseWheel(); void mouseWheel();
void screensaver(); void screensaver();
void resetOptions();
void setOptions();
void queryInfo(); void queryInfo();
void infoAcknowledgment(); void infoAcknowledgment();