File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -50,15 +50,4 @@ public static string GetUniqueIdString()
5050 {
5151 return Guid . NewGuid ( ) . ToString ( "N" ) ;
5252 }
53-
54- /// <summary>
55- /// 静态构造函数,初始化雪花算法的ID生成器
56- /// </summary>
57- static IdGenerator ( )
58- {
59- // 创建ID生成器配置,WorkerId设为0
60- var options = new IdGeneratorOptions ( 0 ) ;
61- // 初始化雪花算法ID生成器
62- YitIdHelper . SetIdGenerator ( options ) ;
63- }
6453}
Original file line number Diff line number Diff line change 11using GameFrameX . Foundation . Json ;
22using GameFrameX . Foundation . Logger ;
33using GameFrameX . Utility . Extensions ;
4+ using Yitter . IdGenerator ;
45
56namespace GameFrameX . Utility . Setting ;
67
@@ -106,6 +107,10 @@ public static void SetCurrentSetting(AppSetting setting)
106107 setting . NetWorkSendTimeOutSeconds = 5 ;
107108 }
108109
110+ // 创建ID生成器配置,WorkerId设为0
111+ var options = new IdGeneratorOptions ( setting . WorkerId ) ;
112+ // 初始化雪花算法ID生成器
113+ YitIdHelper . SetIdGenerator ( options ) ;
109114 CurrentSetting = setting ;
110115 }
111116
You can’t perform that action at this time.
0 commit comments