01-05-2011, 02:39 PM
OK, the new additions to allow you to send over environmental variable runtime values is in place in 3.4.11 that was just posted. Here are the changes for the protocol version 3.
Most likely the best strategy for the medium term would be, if there is no environmental variables info to send, just report yourself as a V2 client and send the old login. Else report yourself as a V3 client and send the new login.
Code:
namespace kCQCRemVComm
{
// -----------------------------------------------------------------------
// There is only one new opcode for V3 clients, which is a new version of
// the login response. This one allows the client to send along the values
// of the environmentally driven runtime values. If a client reports that
// it is a V3 client, it must send this version of the response, not the
// original one.
// -----------------------------------------------------------------------
const tCIDLib::TCard1 c1OpCode_LoginResponse2 = 105;
};
namespace tCQCRemVComm
{
// -----------------------------------------------------------------------
// c1OpCode_LoginResponse2
//
// This is the same as the original login response, except that there is
// now a mask that indicates the optional presence of environmental
// variable values after the structure, in the standard text sort of
// way. The mask indicates which of them are present, so that extra
// bytes aren't required to just send empty values, and most of the time
// most of them will be empty.
//
// So bit 0 indicates that Env01 is present, bit 1 indicates that Env02
// is present and so on. So, for each of the set bits 0 through 8 in the
// environment mask, there should be a string following this structure
// with the value of that environmental variable.
//
// If no values are present, the mask is zero and only the basic
// structure itself must be sent. If, say, only variable 5 were set by
// the user, then the mask would be 0x0010 and there would be one string
// following the structure.
//
// The server will go through the mask and for each of the bits, it will
// extract a string and store it as that corresponding variable for this
// client's session.
// -----------------------------------------------------------------------
struct TLoginResponse2
{
THeader hdrInfo;
tCIDLib::TCard1 ac1Response[16];
tCIDLib::TCard2 c2EnvMask;
};
}
Most likely the best strategy for the medium term would be, if there is no environmental variables info to send, just report yourself as a V2 client and send the old login. Else report yourself as a V3 client and send the new login.
Dean Roddey
Explorans limites defectum
Explorans limites defectum