private static uint XInputSetStateHookFunc(int aGamePadIndex, Vibration aVibrationRef) { try { GHRXInputModPayload This = _instance; // No reason to send duplicate packets. if (This._lastMessage.LeftMotorSpeed == aVibrationRef.LeftMotorSpeed && This._lastMessage.RightMotorSpeed == aVibrationRef.RightMotorSpeed) { return(0); } This._lastMessage = new Vibration { LeftMotorSpeed = aVibrationRef.LeftMotorSpeed, RightMotorSpeed = aVibrationRef.RightMotorSpeed }; lock (This._messageQueue) { This._messageQueue.Enqueue(This._lastMessage); } } catch (Exception e) { _ex = e; } return(0); }
public GHRXInputModPayload( RemoteHooking.IContext aInContext, String aInChannelName) { _interface = RemoteHooking.IpcConnectClient <GHRXInputModInterface.GHRXInputModInterface>(aInChannelName); _instance = this; }
private static uint XInputSetStateHookFunc(int aGamePadIndex, ref Vibration aVibrationRef) { try { // Always send to the controller first, then do what we need to. if (_shouldPassthru) { XInputSetStateShim(aGamePadIndex, aVibrationRef); } GHRXInputModPayload This = _instance; // No reason to send duplicate packets. if (This._lastMessage.LeftMotorSpeed == aVibrationRef.LeftMotorSpeed && This._lastMessage.RightMotorSpeed == aVibrationRef.RightMotorSpeed) { return(0); } This._lastMessage = new Vibration { LeftMotorSpeed = aVibrationRef.LeftMotorSpeed, RightMotorSpeed = aVibrationRef.RightMotorSpeed }; lock (This._messageQueue) { This._messageQueue.Enqueue(This._lastMessage); } } catch (Exception e) { _ex = e; } return(0); }