private void Initialize(TabPage pluginScreenSpace, Label pluginStatusText) { pluginScreenSpace.Text = "오버레이 & 웹소켓 "; asmResolver.ExceptionOccured += (o, e) => { //logger.Log(LogLevel.Error, "AssemblyResolver: Error: {0}", e.Exception); }; asmResolver.AssemblyLoaded += (o, e) => { //logger.Log(LogLevel.Debug, "AssemblyResolver: Loaded: {0}", e.LoadedAssembly.FullName); }; AppDomain.CurrentDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs args) { string asmFile = (args.Name.Contains(",") ? args.Name.Substring(0, args.Name.IndexOf(",")) : args.Name); if (!ASMCHK.Contains(asmFile)) { return(null); } try { if (Environment.Is64BitOperatingSystem) { return(Assembly.LoadFile(Path.Combine(CEFDIR64, asmFile + ".dll"))); } else { return(Assembly.LoadFile(Path.Combine(CEFDIR, asmFile + ".dll"))); } } catch { return(null); } }; var m = new ACTWebSocketMain(); string pluginDirectory = GetPluginDirectory(); m.SetSkinDir(Path.Combine(Environment.CurrentDirectory, "OverlaySkin")); m.SetPluginDirectory(pluginDirectory); m.InitPlugin(pluginScreenSpace, pluginStatusText); main = m; }
private void Initialize(TabPage pluginScreenSpace, Label pluginStatusText) { pluginScreenSpace.Text = "ACTWebSocket"; asmResolver.ExceptionOccured += (o, e) => { //logger.Log(LogLevel.Error, "AssemblyResolver: Error: {0}", e.Exception); }; asmResolver.AssemblyLoaded += (o, e) => { //logger.Log(LogLevel.Debug, "AssemblyResolver: Loaded: {0}", e.LoadedAssembly.FullName); }; var m = new ACTWebSocketMain(); string pluginDirectory = GetPluginDirectory(); string pluginPath = GetPluginPath(); m.SetPluginPath(pluginPath); m.SetSkinDir(Path.Combine(Environment.CurrentDirectory, "OverlaySkin")); m.SetScreenShotDir(Path.Combine(Environment.CurrentDirectory, "ScreenShot")); m.SetPluginDirectory(pluginDirectory); m.InitPlugin(pluginScreenSpace, pluginStatusText); main = m; }
public ACTWebSocketCore(ACTWebSocketMain gui) { overlayAPI = new FFXIV_OverlayAPI(this); this.gui = gui; }
internal void InstallMessageHandle(ref Dictionary <string, Action <ACTWebSocketCore.WebSocketCommunicateBehavior, JObject> > handle) { handle["overlayAPI"] = (session, o) => { String type = o["msgtype"].ToString(); if (type == null) { return; } switch (type) { case "Capture": { if (!ACTWebSocketMain.SendMessage(JObject.FromObject(new { cmd = "capture", value = new { id = session.id } }))) { // TODO : } } break; case "RequestLastCombat": case "RequestLastCombatData": session.Send(session.id, session.id, SendMessageType.CombatData.ToString(), CreateEncounterJsonData()); break; case "RequestEnd": case "RequestEncounterEnd": ActGlobals.oFormActMain.EndCombat(false); break; case "GetFileList": { String arg = ((JToken)o).ToObject <string>(); session.Send(session.id, session.id, "FileList", ListToJSON(GetFiles(arg))); } break; case "GetDirectoryList": { String arg = ((JToken)o).ToObject <string>(); session.Send(session.id, session.id, "DirectoryList", ListToJSON(GetDirectories(arg))); } break; case "GetDirectoryNoLastSlash": { String arg = ((JToken)o).ToObject <string>(); session.Send(session.id, session.id, "GetDirectoryNoLastSlash", GetDirectoryNoLastSlash(arg)); } break; case "FileExists": { String arg = ((JToken)o).ToObject <string>(); session.Send(session.id, session.id, "FileExists", FileExists(arg)); } break; case "DirectoryExists": { String arg = ((JToken)o).ToObject <string>(); session.Send(session.id, session.id, "DirectoryExists", DirectoryExists(arg)); } break; //case "ReadFile": // { // String arg = ((JToken)o).ToObject<string>(); // session.Send(session.id, session.id, "File", ReadFile(arg)); // } // break; //case "GetImageBase64": // { // String arg = ((JToken)o).ToObject<string>(); // session.Send(session.id, session.id, "ImageBase64", GetImageBASE64(arg)); // } // break; } ; }; }