diff --git a/lib/client/CServerProxy.cpp b/lib/client/CServerProxy.cpp index 920be85d..22db4143 100644 --- a/lib/client/CServerProxy.cpp +++ b/lib/client/CServerProxy.cpp @@ -15,6 +15,7 @@ #include "CServerProxy.h" #include "CProtocolUtil.h" #include "IClient.h" +#include "OptionTypes.h" #include "ProtocolTypes.h" #include "IInputStream.h" #include "IOutputStream.h" @@ -161,6 +162,14 @@ CServerProxy::mainLoop() setClipboard(); } + else if (memcmp(code, kMsgCResetOptions, 4) == 0) { + resetOptions(); + } + + else if (memcmp(code, kMsgDSetOptions, 4) == 0) { + setOptions(); + } + else if (memcmp(code, kMsgCClose, 4) == 0) { // server wants us to hangup LOG((CLOG_DEBUG1 "recv close")); @@ -197,6 +206,7 @@ CServerProxy::mainLoop() else { // unknown message 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; break; } @@ -516,6 +526,28 @@ CServerProxy::screensaver() 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 CServerProxy::queryInfo() { diff --git a/lib/client/CServerProxy.h b/lib/client/CServerProxy.h index f67b72f6..a54ccdff 100644 --- a/lib/client/CServerProxy.h +++ b/lib/client/CServerProxy.h @@ -105,6 +105,8 @@ private: void mouseMove(); void mouseWheel(); void screensaver(); + void resetOptions(); + void setOptions(); void queryInfo(); void infoAcknowledgment();