diff --git a/src/BD.WTTS.Client.Plugins.Accelerator/XunYouSDK/Methods/20.接口 xunyou_testspeed_ex.cs b/src/BD.WTTS.Client.Plugins.Accelerator/XunYouSDK/Methods/20.接口 xunyou_testspeed_ex.cs index 8a2bbe1e8..3a908c359 100644 --- a/src/BD.WTTS.Client.Plugins.Accelerator/XunYouSDK/Methods/20.接口 xunyou_testspeed_ex.cs +++ b/src/BD.WTTS.Client.Plugins.Accelerator/XunYouSDK/Methods/20.接口 xunyou_testspeed_ex.cs @@ -16,11 +16,6 @@ partial class XunYouSDK // 20.接口 xunyou_testspeed_ex int server, TestSpeedCallback callback) { - if (server == 0) - { - return TestSpeed(gameid, area, callback); - } - int testSpeedCode = int.MinValue; unsafe { @@ -38,7 +33,7 @@ partial class XunYouSDK // 20.接口 xunyou_testspeed_ex return result; } var xunyou_callback = (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(testSpeedCallback = TestSpeedCallback_Wrapper); - testSpeedCode = xunyou_testspeed(gameid, area, xunyou_callback); + testSpeedCode = xunyou_testspeed_ex(gameid, area, server, xunyou_callback); } return (XunYouTestSpeedCode)testSpeedCode; diff --git a/src/BD.WTTS.Client.Plugins.Accelerator/XunYouSDK/Methods/7.接口 xunyou_testspeed.cs b/src/BD.WTTS.Client.Plugins.Accelerator/XunYouSDK/Methods/7.接口 xunyou_testspeed.cs index 365a2c39a..33f5a9b0a 100644 --- a/src/BD.WTTS.Client.Plugins.Accelerator/XunYouSDK/Methods/7.接口 xunyou_testspeed.cs +++ b/src/BD.WTTS.Client.Plugins.Accelerator/XunYouSDK/Methods/7.接口 xunyou_testspeed.cs @@ -14,60 +14,60 @@ partial class XunYouSDK // 7.接口 xunyou_testspeed /// public delegate int TestSpeedCallback(SpeedCallbackWrapper m); - /// - /// 获取指定游戏某分区的测速。 - /// - /// 游戏 id,由迅游给出明确值。 - /// 游戏分区 id ,由游戏给出区服名和 id 对照表。 - /// 测速回调函数。 - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static XunYouTestSpeedCode TestSpeed(int gameid, - int area, - TestSpeedCallback callback) - { - int testSpeedCode = int.MinValue; - unsafe - { - [UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])] - int TestSpeedCallback_Wrapper(XunYouSpeedNotifyState state, SpeedCallbackInfo* info) - { - var info_ = Marshal.PtrToStructure((nint)info); - var result = callback(new SpeedCallbackWrapper - { - Struct = info_, - State = state, - Code = (XunYouTestSpeedCode)testSpeedCode, - ErrorDesc = info_.GetErrorDescString(), - }); - return result; - } - var xunyou_callback = (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(testSpeedCallback = TestSpeedCallback_Wrapper); - testSpeedCode = xunyou_testspeed(gameid, area, xunyou_callback); - } + ///// + ///// 获取指定游戏某分区的测速。 + ///// + ///// 游戏 id,由迅游给出明确值。 + ///// 游戏分区 id ,由游戏给出区服名和 id 对照表。 + ///// 测速回调函数。 + ///// + //[MethodImpl(MethodImplOptions.AggressiveInlining)] + //public static XunYouTestSpeedCode TestSpeed(int gameid, + // int area, + // TestSpeedCallback callback) + //{ + // int testSpeedCode = int.MinValue; + // unsafe + // { + // [UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])] + // int TestSpeedCallback_Wrapper(XunYouSpeedNotifyState state, SpeedCallbackInfo* info) + // { + // var info_ = Marshal.PtrToStructure((nint)info); + // var result = callback(new SpeedCallbackWrapper + // { + // Struct = info_, + // State = state, + // Code = (XunYouTestSpeedCode)testSpeedCode, + // ErrorDesc = info_.GetErrorDescString(), + // }); + // return result; + // } + // var xunyou_callback = (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(testSpeedCallback = TestSpeedCallback_Wrapper); + // testSpeedCode = xunyou_testspeed(gameid, area, xunyou_callback); + // } - return (XunYouTestSpeedCode)testSpeedCode; - } + // return (XunYouTestSpeedCode)testSpeedCode; + //} - /// - /// 获取指定游戏某分区的测速。 - /// - /// 游戏 id,由迅游给出明确值。 - /// 游戏分区 id ,由游戏给出区服名和 id 对照表。 - /// - /// - public static IAsyncEnumerable TestSpeed(int gameid, int area) - { - // 异步迭代器版本,用于 Ipc 调用,封装回调函数 - // 注意配合停止测试接口 - throw new NotSupportedException(); - } + ///// + ///// 获取指定游戏某分区的测速。 + ///// + ///// 游戏 id,由迅游给出明确值。 + ///// 游戏分区 id ,由游戏给出区服名和 id 对照表。 + ///// + ///// + //public static IAsyncEnumerable TestSpeed(int gameid, int area) + //{ + // // 异步迭代器版本,用于 Ipc 调用,封装回调函数 + // // 注意配合停止测试接口 + // throw new NotSupportedException(); + //} - [LibraryImport(libraryName)] - [UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])] - private static unsafe partial int xunyou_testspeed(int gameid, - int area, - delegate* unmanaged[Stdcall] callback = null); + //[LibraryImport(libraryName)] + //[UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])] + //private static unsafe partial int xunyou_testspeed(int gameid, + // int area, + // delegate* unmanaged[Stdcall] callback = null); /// /// 获取测速失败描述字符串