Пример #1
0
        public static async Task RefreshStatus()
        {
            InteropRequest request = new InteropRequest();

            request.header.RequestType = InteropRequestType.GetGameInformation;
            var response = await TASInterop.MakeRequestAsync(request);

            Status = new TASStatus();
            if (response?.header.ResponseType == InteropResponseType.Success)
            {
                Status.Connected = true;

                GetGameInformationResponse responseData = new GetGameInformationResponse();
                TASInterop.MarshalArrayToObject(ref responseData, response?.responseData);
                Status.H1DLLLoaded    = responseData.Halo1Loaded;
                Status.H2DLLLoaded    = responseData.Halo2Loaded;
                Status.H3DLLLoaded    = responseData.Halo3Loaded;
                Status.ODSTDLLLoaded  = responseData.ODSTLoaded;
                Status.ReachDLLLoaded = responseData.ReachLoaded;
                Status.H4DLLLoaded    = responseData.Halo4Loaded;

                if (Status.H1DLLLoaded)
                {
                    Status.Halo1.CheatsEnabled = responseData.Halo1.CheatsEnabled;
                }
            }
            else
            {
                Status.Connected = false;
            }
        }
Пример #2
0
        public static async Task SetSkullEnabled(Halo2Skull skull, bool enabled)
        {
            InteropRequest request = new InteropRequest();

            request.header.RequestType        = InteropRequestType.Halo2SetCheatEnabled;
            request.header.RequestPayloadSize = Marshal.SizeOf(typeof(Halo2SetSkullEnabledRequest));

            var payload = new Halo2SetSkullEnabledRequest();

            payload.Skull       = (int)skull;
            payload.Enabled     = enabled;
            request.requestData = TASInterop.MarshalObjectToArray(payload);

            var response = await TASInterop.MakeRequestAsync(request);

            if (response?.header.ResponseType != InteropResponseType.Success)
            {
                // Something went wrong
            }
        }
Пример #3
0
        public static async Task ExecuteCommand(string command)
        {
            if (string.IsNullOrWhiteSpace(command))
            {
                return;
            }

            InteropRequest request = new InteropRequest();

            request.header.RequestType        = InteropRequestType.ExecuteCommand;
            request.header.RequestPayloadSize = Marshal.SizeOf(typeof(ExecuteCommandRequest));

            var payload = new ExecuteCommandRequest();

            payload.Command     = command;
            request.requestData = TASInterop.MarshalObjectToArray(payload);

            var response = await TASInterop.MakeRequestAsync(request);

            if (response?.header.ResponseType != InteropResponseType.Success)
            {
                // Something went wrong
            }
        }