public GetOptimalServerCommand(string id, byte[] userName, byte[] password) { _currentVersion = Alachisoft.NCache.Common.ProductVersion.ProductInfo; base.name = "GetOptimalServerCommand"; _getOptimalServerCommand = new Alachisoft.NCache.Common.Protobuf.GetOptimalServerCommand(); _getOptimalServerCommand.cacheId = id; _getOptimalServerCommand.binaryUserId = userName; _getOptimalServerCommand.binaryPassword = password; _getOptimalServerCommand.isDotnetClient = true; _getOptimalServerCommand.requestId = base.RequestId; //Protobuf. Product Version is assigned values if (_getOptimalServerCommand.productVersion == null) { _getOptimalServerCommand.productVersion = new Common.Protobuf.ProductVersion(); } _getOptimalServerCommand.productVersion.AddiotionalData = _currentVersion.AdditionalData; _getOptimalServerCommand.productVersion.EditionID = _currentVersion.EditionID; _getOptimalServerCommand.productVersion.MajorVersion1 = this.ParseToByteArray(_currentVersion.MajorVersion1); _getOptimalServerCommand.productVersion.MajorVersion2 = this.ParseToByteArray(_currentVersion.MajorVersion2); _getOptimalServerCommand.productVersion.MinorVersion1 = this.ParseToByteArray(_currentVersion.MinorVersion1); _getOptimalServerCommand.productVersion.MinorVersion2 = this.ParseToByteArray(_currentVersion.MinorVersion2); _getOptimalServerCommand.productVersion.ProductName = _currentVersion.ProductName; }
public InitCommand(string clientid, string id, string clientLocalIP, IPAddress requestedServerAddress, Runtime.Caching.ClientInfo clientInfo) { _initCommand = new Alachisoft.NCache.Common.Protobuf.InitCommand(); base.name = "InitCommand"; _currentVersion = Alachisoft.NCache.Common.ProductVersion.ProductInfo; _initCommand.cacheId = id; _initCommand.clientId = clientid; _initCommand.isDotnetClient = true; _initCommand.requestId = base.RequestId; _initCommand.clientInfo = new ClientInfo(); _initCommand.clientInfo.machineName = clientInfo.MachineName; _initCommand.clientInfo.processId = clientInfo.ProcessID; _initCommand.clientInfo.appName = clientInfo.AppName; _initCommand.clientInfo.clientId = clientInfo.ClientID; if (_initCommand.productVersion == null) { _initCommand.productVersion = new Common.Protobuf.ProductVersion(); } _initCommand.productVersion.AddiotionalData = _currentVersion.AdditionalData; _initCommand.productVersion.EditionID = _currentVersion.EditionID; _initCommand.productVersion.MajorVersion1 = this.ParseToByteArray(_currentVersion.MajorVersion1); _initCommand.productVersion.MajorVersion2 = this.ParseToByteArray(_currentVersion.MajorVersion2); _initCommand.productVersion.MinorVersion1 = this.ParseToByteArray(_currentVersion.MinorVersion1); _initCommand.productVersion.MinorVersion2 = this.ParseToByteArray(_currentVersion.MinorVersion2); _initCommand.productVersion.ProductName = _currentVersion.ProductName; _initCommand.clientVersion = 4620; }
public override void ExecuteCommand(ClientManager clientManager, Common.Protobuf.Command command) { CommandInfo cmdInfo; try { cmdInfo = ParseCommand(command, clientManager); } catch (Exception exc) { if (!base.immatureId.Equals("-2")) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponseWithType(exc, command.requestID, command.commandID, clientManager.ClientVersion)); } return; } try { Alachisoft.NCache.Common.ProductVersion _currentVersion = Alachisoft.NCache.Common.ProductVersion.ProductInfo; Alachisoft.NCache.Common.Protobuf.GetProductVersionResponse getProductVersionResponse = new Alachisoft.NCache.Common.Protobuf.GetProductVersionResponse(); getProductVersionResponse.productVersion.AddiotionalData = _currentVersion.AdditionalData; getProductVersionResponse.productVersion.EditionID = _currentVersion.EditionID; getProductVersionResponse.productVersion.MajorVersion1 = this.ParseToByteArray(_currentVersion.MajorVersion1); getProductVersionResponse.productVersion.MajorVersion2 = this.ParseToByteArray(_currentVersion.MajorVersion2); getProductVersionResponse.productVersion.MinorVersion1 = this.ParseToByteArray(_currentVersion.MinorVersion1); getProductVersionResponse.productVersion.MinorVersion2 = this.ParseToByteArray(_currentVersion.MinorVersion2); getProductVersionResponse.productVersion.ProductName = _currentVersion.ProductName; if (clientManager.ClientVersion >= 5000) { ResponseHelper.SetResponse(getProductVersionResponse, command.requestID, command.commandID); _serializedResponsePackets.Add(ResponseHelper.SerializeResponse(getProductVersionResponse, Common.Protobuf.Response.Type.GET_PRODUCT_VERSION)); } else { Common.Protobuf.Response response = new Common.Protobuf.Response(); response.getProductVersionResponse = getProductVersionResponse; ResponseHelper.SetResponse(response, command.requestID, command.commandID, Common.Protobuf.Response.Type.GET_PRODUCT_VERSION); _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeResponse(response)); } } catch (Exception exc) { _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeExceptionResponseWithType(exc, command.requestID, command.commandID, clientManager.ClientVersion)); } }
public GetRunningServersCommand(string id) { base.name = "GetRunningServersCommand"; _currentVersion = Alachisoft.NCache.Common.ProductVersion.ProductInfo; _getRunningServersCommand = new Alachisoft.NCache.Common.Protobuf.GetRunningServersCommand(); _getRunningServersCommand.cacheId = id; _getRunningServersCommand.isDotnetClient = true; _getRunningServersCommand.requestId = base.RequestId; if (_getRunningServersCommand.productVersion == null) { _getRunningServersCommand.productVersion = new Common.Protobuf.ProductVersion(); } _getRunningServersCommand.productVersion.AddiotionalData = _currentVersion.AdditionalData; _getRunningServersCommand.productVersion.EditionID = _currentVersion.EditionID; _getRunningServersCommand.productVersion.MajorVersion1 = HelperFxn.ParseToByteArray(_currentVersion.MajorVersion1); _getRunningServersCommand.productVersion.MajorVersion2 = HelperFxn.ParseToByteArray(_currentVersion.MajorVersion2); _getRunningServersCommand.productVersion.MinorVersion1 = HelperFxn.ParseToByteArray(_currentVersion.MinorVersion1); _getRunningServersCommand.productVersion.MinorVersion2 = HelperFxn.ParseToByteArray(_currentVersion.MinorVersion2); _getRunningServersCommand.productVersion.ProductName = _currentVersion.ProductName; }