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 } }
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 } }