private void HandleChangeObjectData(TByteBuffer aPayload) { if (OnChangeObjectData == null) return; Int32 action; Int32 objectID; string attribute; aPayload.Read(out action); aPayload.Read(out objectID); aPayload.Read(out attribute); var newValues = aPayload.ReadByteBuffer(); var oldValues = aPayload.ReadByteBuffer(); OnChangeObjectData(this, action, objectID, attribute, newValues, oldValues); }
private void HandleBuffer(Int32 aEventTick, TByteBuffer aPayload) { if (OnBuffer == null) return; var bufferID = aPayload.ReadInt32(); var buffer = aPayload.ReadByteBuffer(); OnBuffer(this, aEventTick, bufferID, buffer); }
private void HandleCommandVariable(TByteBuffer aPayload) { if (FOnVariable == null && FOnStatusUpdate == null) return; var varName = aPayload.ReadString(); // check if it is a status update if (varName.EndsWith(msVarSepChar + ModelStatusVarName, StringComparison.OrdinalIgnoreCase)) { varName.Remove(varName.Length - (msVarSepChar.Length + ModelStatusVarName.Length)); var modelName = varName.Substring(8, varName.Length - 8); var modelUniqueClientID = varName.Substring(0, 8); aPayload.ReadInt32(); var status = aPayload.ReadInt32(-1); var progress = aPayload.ReadInt32(-1); FOnStatusUpdate(this, modelUniqueClientID, modelName, progress, status); } else { var varValue = aPayload.ReadByteBuffer(); var prevValue = new TByteBuffer(); FOnVariable(this, varName, varValue.Buffer, prevValue.Buffer); } }