示例#1
0
        public static unsafe void Install2(PluginHeader *plugin)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //SplashScreen.Start();
            m_ActiveWnd = SplashScreen.Instance;

            ClassicUOClient.UOFilePath =
                ((OnGetUOFilePath)Marshal.GetDelegateForFunctionPointer(plugin->GetUOFilePath, typeof(OnGetUOFilePath))
                )();

            ClassicUOClient cuo = new ClassicUOClient();

            Client.Instance = cuo;
            cuo.InitPlugin(plugin);
            cuo.Init(false);
            cuo.RunUI();

            //if (!(Client.Instance as ClassicUOClient).Install(plugin, HostExecutionContext, character))
            //{
            //    Process.GetCurrentProcess().Kill();
            //    return;
            //}
        }
示例#2
0
        public static unsafe void Install2(PluginHeader *plugin, string shard_host)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AppDomain.CurrentDomain.AssemblyResolve += (sender, e) =>
            {
                string[] fields  = e.Name.Split(',');
                string   name    = fields[0];
                string   culture = fields[2];

                if (name.EndsWith(".resources") && !culture.EndsWith("neutral"))
                {
                    return(null);
                }

                AssemblyName askedassembly = new AssemblyName(e.Name);

                bool isdll = File.Exists(Path.Combine(RootPath, askedassembly.Name + ".dll"));

                return(Assembly.LoadFile(Path.Combine(RootPath, askedassembly.Name + (isdll ? ".dll" : ".exe"))));
            };

            //SplashScreen.Start();
            m_ActiveWnd = SplashScreen.Instance;

            ClassicUOClient.ShardHost = shard_host;

            ClassicUOClient cuo = new ClassicUOClient();

            Client.Instance = cuo;
            cuo.InitPlugin(plugin);
            cuo.Init(false);
            cuo.RunUI();

            //if (!(Client.Instance as ClassicUOClient).Install(plugin, HostExecutionContext, character))
            //{
            //    Process.GetCurrentProcess().Kill();
            //    return;
            //}
        }