Skip to content

Commit 4103be5

Browse files
committed
[修改]1. 修改接口的变动适配
1 parent 741e117 commit 4103be5

File tree

7 files changed

+37
-35
lines changed

7 files changed

+37
-35
lines changed

DataBaseServer/GameFrameX.DataBase.RDS.MySql/SqlSugarDbService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void Open(string url, string dbName)
5050
};
5151
});
5252

53-
var types = AssemblyHelper.GetRuntimeImplementTypeNames<BaseCacheState>();
53+
var types = Assembly.GetRuntimeImplementTypeNames<BaseCacheState>();
5454
foreach (var type in types)
5555
{
5656
Client.CodeFirst.InitTables(type);

GameFrameX.Apps/BsonClassMapHelper.cs

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,45 @@ public void Apply(BsonMemberMap memberMap)
3232
if (genType == typeof(List<>))
3333
{
3434
memberMap.SetShouldSerializeMethod(o =>
35-
{
36-
var value = memberMap.Getter(o);
37-
if (value is IList list)
38-
{
39-
return list != null && list.Count > 0;
40-
}
35+
{
36+
var value = memberMap.Getter(o);
37+
if (value is IList list)
38+
{
39+
return list != null && list.Count > 0;
40+
}
4141

42-
return true;
43-
});
42+
return true;
43+
});
4444
}
4545

4646
else if (genType == typeof(ConcurrentDictionary<,>) || genType == typeof(Dictionary<,>))
4747
{
4848
memberMap.SetShouldSerializeMethod(o =>
49-
{
50-
if (o != null)
51-
{
52-
var value = memberMap.Getter(o);
53-
if (value != null)
54-
{
55-
PropertyInfo countProperty = value.GetType().GetProperty("Count");
56-
if (countProperty != null)
57-
{
58-
int count = (int)countProperty.GetValue(value, null);
59-
return count > 0;
60-
}
61-
}
62-
}
49+
{
50+
if (o != null)
51+
{
52+
var value = memberMap.Getter(o);
53+
if (value != null)
54+
{
55+
PropertyInfo countProperty = value.GetType().GetProperty("Count");
56+
if (countProperty != null)
57+
{
58+
int count = (int)countProperty.GetValue(value, null);
59+
return count > 0;
60+
}
61+
}
62+
}
6363

64-
return true;
65-
});
64+
return true;
65+
});
6666
}
6767
}
6868
}
6969
}
7070

7171
public static class BsonClassMapHelper
7272
{
73-
static public void SetConvention()
73+
public static void SetConvention()
7474
{
7575
ConventionRegistry.Register(nameof(DictionaryRepresentationConvention),
7676
new ConventionPack { new DictionaryRepresentationConvention(DictionaryRepresentation.ArrayOfDocuments) }, _ => true);
@@ -79,8 +79,11 @@ static public void SetConvention()
7979
new ConventionPack { new EmptyContainerSerializeMethodConvention() }, _ => true);
8080
}
8181

82-
//提前注册,简化多态类型处理
83-
public static void RegisterAllClass(Assembly assembly)
82+
/// <summary>
83+
/// 提前注册,简化多态类型处理
84+
/// </summary>
85+
/// <param name="assembly"></param>
86+
public static void RegisterAllClass(System.Reflection.Assembly assembly)
8487
{
8588
var types = assembly.GetTypes();
8689
foreach (var t in types)

GameFrameX.Launcher/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Reflection;
2-
using GameFrameX.GameAnalytics;
1+
using GameFrameX.GameAnalytics;
32
using GameFrameX.NetWork.Message;
43
using GameFrameX.Proto.BuiltIn;
54

@@ -9,7 +8,7 @@ internal static class Program
98
{
109
static async Task Main(string[] args)
1110
{
12-
GameAnalyticsHelper.Init("ec33486a135ae80984dbfc66eede1e41", "379e705038d46691c5c567db947af1828f702861", Assembly.GetCallingAssembly().ImageRuntimeVersion);
11+
GameAnalyticsHelper.Init("ec33486a135ae80984dbfc66eede1e41", "379e705038d46691c5c567db947af1828f702861", System.Reflection.Assembly.GetCallingAssembly().ImageRuntimeVersion);
1312
await GameApp.Entry(args, () =>
1413
{
1514
CacheStateTypeManager.Init();

GameFrameX.Launcher/StartUp/Discovery/AppStartUpDiscoveryCenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public override async Task StartAsync()
2020
_namingServiceManager.AddSelf(Setting);
2121

2222
StartServer();
23-
var aopHandlerTypes = AssemblyHelper.GetRuntimeImplementTypeNamesInstance<IHttpAopHandler>();
23+
var aopHandlerTypes = Assembly.GetRuntimeImplementTypeNamesInstance<IHttpAopHandler>();
2424
aopHandlerTypes.Sort((handlerX, handlerY) => handlerX.Priority.CompareTo(handlerY.Priority));
2525
// 启动Http服务
2626
await HttpServer.Start(Setting.HttpPort, Setting.HttpsPort, HotfixManager.GetHttpHandler, aopHandlerTypes);

GameFrameX.NetWork.ChannelBase/ConnectChannelHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public bool IsConnected
333333
/// <param name="serverPort">服务器端口</param>
334334
public void Start(string serverIp, int serverPort)
335335
{
336-
if (IpHelper.IsValidIpAddress(serverIp, out var value))
336+
if (Net.IsValidIpAddress(serverIp, out var value))
337337
{
338338
TargetEndPoint = new IPEndPoint(value, serverPort);
339339
}

GameFrameX.StartUp/AppExitHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void Init(Action<string> existCallBack, AppSetting setting)
3030
_isKill = false;
3131
_setting = setting;
3232
_existCallBack = existCallBack;
33-
var fetalExceptionExitHandlers = AssemblyHelper.GetRuntimeImplementTypeNames<IFetalExceptionExitHandler>();
33+
var fetalExceptionExitHandlers = Assembly.GetRuntimeImplementTypeNames<IFetalExceptionExitHandler>();
3434
foreach (var exceptionExitHandler in fetalExceptionExitHandlers)
3535
{
3636
var handler = (IFetalExceptionExitHandler)Activator.CreateInstance(exceptionExitHandler);

GameFrameX.StartUp/GameApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static async Task Entry(string[] args, Action initAction, Action<LogOptio
7171
GlobalSettings.Load($"Configs/app_config.json");
7272
initAction?.Invoke();
7373

74-
var types = AssemblyHelper.GetTypes();
74+
var types = Utility.Assembly.GetTypes();
7575
if (types != null)
7676
{
7777
foreach (var type in types)

0 commit comments

Comments
 (0)