private void ReplayActions(string hexStrings) { string[] lines = hexStrings.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); foreach (string line in lines) { string hex = line.Replace(" ", string.Empty); if (hex.Length % 2 == 0) { byte[] buffer = new byte[hex.Length / 2]; bool isValidBuffer = true; for (int i = 0; i < buffer.Length; i++) { byte b; if (byte.TryParse(hex.Substring(i * 2, 2), NumberStyles.HexNumber, null, out b)) { buffer[i] = b; } else { isValidBuffer = false; break; } } if (isValidBuffer && buffer.Length == 8) { ActionInfo actionInfo = new ActionInfo(); actionInfo.Action.Value = BitConverter.ToInt64(buffer, 0); LogAction(buffer, ref actionInfo); QueueAction(actionInfo); } } } }
private void LogAction(ActionInfo actionInfo) { LogAction(BitConverter.GetBytes(actionInfo.Action.Value), ref actionInfo); }
public bool SetCurrentAction(ActionInfo actionInfo) { actionInfo.Type = DoActionType.Overwrite; return(DoAction(actionInfo)); }
public bool ForceAction(ActionInfo actionInfo, int count) { actionInfo.Type = DoActionType.Forced; actionInfo.CustomData = count; return(DoAction(actionInfo)); }
public bool ForceAction(ActionInfo actionInfo) { return(ForceAction(actionInfo, 1)); }
public bool InjectAction(ActionInfo actionInfo, int index) { actionInfo.Type = DoActionType.Inject; actionInfo.CustomData = index; return(DoAction(actionInfo)); }
private bool QueueAction(ActionInfo actionInfo) { actionInfo.Type = DoActionType.Queue; return(DoAction(actionInfo)); }
private bool DoAction(ActionInfo actionInfo) { return(CallNativeScriptFunctionWithStruct("DoAction", actionInfo) == CallNativeFunctionResult.Success); }