@@ -169,9 +169,14 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
169
169
break ;
170
170
}
171
171
172
- FFXIVPlugin = GetFFXIVPlugin ( ) ;
172
+ var ffxivPlugin = GetFFXIVPlugin ( ) ;
173
+ FFXIVPlugin = ffxivPlugin ;
174
+
175
+ _universalisPacketProcessor = new PacketProcessor ( ApiKey )
176
+ {
177
+ LocalContentId = ffxivPlugin . DataRepository . GetCurrentPlayerID ( ) ,
178
+ } ;
173
179
174
- _universalisPacketProcessor = new PacketProcessor ( ApiKey ) ;
175
180
_universalisPacketProcessor . Log += ( _ , message ) => Log ( message ) ;
176
181
_universalisPacketProcessor . LocalContentIdUpdated += ( _ , cid ) => LastSavedContentId = ( long ) cid ;
177
182
_universalisPacketProcessor . LocalContentId = ( ulong ) LastSavedContentId ;
@@ -224,14 +229,14 @@ private void DataSubscriptionOnNetworkReceived(string connection, long epoch, by
224
229
}
225
230
}
226
231
227
- private static object GetFFXIVPlugin ( )
232
+ private static FFXIV_ACT_Plugin . FFXIV_ACT_Plugin GetFFXIVPlugin ( )
228
233
{
229
234
var plugins = ActGlobals . oFormActMain . ActPlugins ;
230
- object ffxivPlugin = plugins
231
- . Where ( p => p . pluginFile . Name . ToUpper ( ) . Contains ( nameof ( FFXIV_ACT_Plugin ) . ToUpper ( ) ) )
232
- . FirstOrDefault ( p => p . pluginObj is FFXIV_ACT_Plugin . FFXIV_ACT_Plugin ) ? . pluginObj ;
233
235
234
- if ( ffxivPlugin == null )
236
+ if ( plugins
237
+ . Where ( p => p . pluginFile . Name . ToUpper ( ) . Contains ( nameof ( FFXIV_ACT_Plugin ) . ToUpper ( ) ) )
238
+ . FirstOrDefault ( p => p . pluginObj is FFXIV_ACT_Plugin . FFXIV_ACT_Plugin )
239
+ ? . pluginObj is not FFXIV_ACT_Plugin . FFXIV_ACT_Plugin ffxivPlugin )
235
240
{
236
241
throw new Exception ( "Could not find FFXIV plugin. Make sure that it is loaded before Universalis." ) ;
237
242
}
0 commit comments