Beispiel #1
0
        private void PollInjection()
        {
            if (m_LastPingTime == Interceptor.LastPingTime)
            {
                try
                {
                    Interceptor.StopInjection();
                    Interceptor.Inject();

                    // Invoke success callback
                    OnInjectionSuccess?.Invoke();
                }
                catch
                {
                    // Invoke failure callback
                    OnInjectionFailure?.Invoke();
                }
            }

            m_LastPingTime = Interceptor.LastPingTime;
        }
Beispiel #2
0
        public void OnReadFile(string filename, ref byte[] inputReport)
        {
            //Console.WriteLine("OnReadFile {0}", filename);

            // Expect inputReport to be modified
            if (Interceptor.Callback != null)
            {
                // Parse the state
                var state = DualShockState.ParseFromDualshockRaw(inputReport);

                // Skip if state is invalid
                if (state == null)
                {
                    return;
                }

                // Expect it to be modified
                Interceptor.Callback(ref state);

                // Convert it back
                state.ConvertToDualshockRaw(ref inputReport);
            }
        }