protected override bool OnServerItemSpawnedInToolbelt(GameObject obj, PlayerToolbeltSlot slot) { /* Get the journal manager from this item */ JournalManager journal = obj.GetComponent <JournalManager>(); /* Does this item have a journal manager? */ if (journal != null) { /* Set the current journal */ currentJournal = journal; currentJournalId = journal.netId; /* Setup the journal on clients only */ if (isClient) { currentJournal.SetupPageManager(playerController.GetEntityName(), questManager, skillsManager.GetSkills(), combatManager); } if (debug) { Debug.Log("PlayerJournalManager: Journal assigned."); } /* We consumed this event */ return(true); } /* We don't care about this item */ return(false); }
public string JournalSaveChanges(string jsonString) { try { JsonSerializerSettings st = new JsonSerializerSettings(); st.DateTimeZoneHandling = DateTimeZoneHandling.Local; JournalEntity entity = JsonConvert.DeserializeObject <JournalEntity>(jsonString, st); JournalManager service = new JournalManager(); if (string.IsNullOrEmpty(entity.iGuid)) { entity.iCreatedBy = SessionHelper.CurrentUser.UserName; entity.iUpdatedBy = SessionHelper.CurrentUser.UserName; service.Insert(entity); } else { entity.iUpdatedBy = SessionHelper.CurrentUser.UserName; service.Update(entity); } return("success"); } catch (Exception e) { return(e.ToString()); } }
private void JournalUpdated(NetworkInstanceId currentJournalId) { /* Don't process hooks on local hosts */ if (isServer && isClient) { return; } // Debug.LogError("JOURNAL HOOK= " + currentJournalId.Value); /* Save the journal id */ this.currentJournalId = currentJournalId; /* Get the journal object */ GameObject journalObj = ClientScene.FindLocalObject(currentJournalId); Debug.Assert(journalObj != null); /* Get the journal component */ currentJournal = journalObj.GetComponent <JournalManager>(); Debug.Assert(currentJournal != null); /* Setup the page manager for this journal */ currentJournal.SetupPageManager(playerController.GetEntityName(), questManager, skillsManager.GetSkills(), combatManager); if (debug) { Debug.Log("PlayerJournalManager Client: Journal assigned."); } }
void Start() { watch = System.Diagnostics.Stopwatch.StartNew(); moveCount = 0; v1_multiplier = 0; v2_multiplier = 0; backtrack_counter = 0; fuel_remaining = 100; rb = GetComponent <Rigidbody>(); movementList = new List <Vector3>(); movementDict = new Dictionary <Vector3, UndoDataL3>(); if (movementList.Count == 0) { undoButton.SetActive(false); } destination = transform.position; moving = false; rotating = false; pdaManager = pda.GetComponent <PDAManager>(); gameController = gameWorld.GetComponent <GameControllerL3>(); journalManager = journal.GetComponent <JournalManager>(); //dialogueManagerLevel1 = DialogueWindow.GetComponent<DialogueManagerLevel1>(); initializePDA(); initializeVectorArrows(); }
public App() { AppDomain.CurrentDomain.ProcessExit += (o, e) => { Core.WarningHandler.Info("Lazurite отключен"); }; System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); System.Windows.Forms.Application.ThreadException += (o, e) => { HandleUnhandledException(e.Exception); }; AppDomain.CurrentDomain.UnhandledException += (o, e) => { HandleUnhandledException(e.ExceptionObject as Exception); }; DispatcherUnhandledException += (o, e) => { HandleUnhandledException(e.Exception); }; ShutdownMode = ShutdownMode.OnExplicitShutdown; try { Core = new LazuriteCore(); // Crutch; after this actions first window run is faster JournalLightWindow.Show("Lazurite запущен...", WarnType.Info); JournalLightWindow.CloseWindow(); Core.WarningHandler.OnWrite += (o, e) => { var args = (WarningEventArgs)e; JournalManager.Set(args.Message, args.Value, args.Exception); }; Core.Initialize(); Core.Server.StartAsync(null); Singleton.Add(Core); NotifyIconManager.Initialize(); DuplicatedProcessesListener.Found += (o, e) => NotifyIconManager.ShowMainWindow(); DuplicatedProcessesListener.Start(); } catch (Exception e) { Core.WarningHandler.Fatal("Во время инициализации приложения возникла ошибка", e); } var ci = new CultureInfo("ru-RU"); Thread.CurrentThread.CurrentCulture = ci; Thread.CurrentThread.CurrentUICulture = ci; }
static void Main(string[] args) { Console.WriteLine("libEDJournalMonitor CLI Test"); JournalManager journalManager = new JournalManager(); journalManager.RaiseJournalEvent += new JournalEventHandler(LogEvent); journalManager.Start(); Console.ReadLine(); journalManager.RaiseJournalEvent -= LogEvent; }
public InformationManager(string databaseFolderPath, bool allowAnonymousErrorFeedback) { _version = Assembly.GetExecutingAssembly().GetName().Version.ToString(4); _databaseManager = new DatabaseManager <DatabaseConnection>(databaseFolderPath); ResetDatabaseIfOutOfDate(); ReadInitialData(); _journalManager = new JournalManager(allowAnonymousErrorFeedback); _journalManager.JournalEntryRead += OnJournalEntryRead; _journalManager.JournalEntryException += OnJournalEntryException; FeedbackManager.PreviewFeedback += OnPreviewFeedback; FeedbackManager.FeedbackSent += OnFeedbackSent; }
public object Read(NodeEntry node, BinaryReader reader, List <INodeParser> parsers) { var result = new JournalManager(); reader.Skip(4); // Skip Id var entryCount = reader.ReadUInt32(); for (int i = 0; i < entryCount; i++) { var entry = new JournalManager.Entry1(); entry.Unk1_PathHash = reader.ReadUInt32(); entry.Unk2_State = reader.ReadUInt32(); entry.Unknown3 = reader.ReadUInt32(); entry.Unknown4 = reader.ReadUInt32(); result.Entries.Add(entry); } result.Unk1_TrackedQuestPath = reader.ReadUInt32(); entryCount = reader.ReadUInt32(); for (int i = 0; i < entryCount; i++) { // could be wrong, strings with length 2? result.Unknown2.Add(reader.ReadUInt64()); } entryCount = reader.ReadUInt32(); for (int i = 0; i < entryCount; i++) { var entry = new JournalManager.Entry2(); entry.Unknown1 = reader.ReadUInt32(); entry.Unknown2 = reader.ReadUInt32(); entry.Unknown3 = reader.ReadUInt32(); entry.Unknown4 = reader.ReadUInt32(); result.Unknown3.Add(entry); } int readSize = node.Size - ((int)reader.BaseStream.Position - node.Offset); result.TrailingBytes = reader.ReadBytes(readSize); result.Node = node; return(result); }
public JsonResult GetJournal(string iGuid) { try { JournalManager service = new JournalManager(); JournalEntity entity = service.FirstOrDefault(iGuid); return(new JsonResult { Data = new { success = true, msg = "msg", data = entity }, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception ex) { log4net.ILog log = log4net.LogManager.GetLogger(this.GetType()); log.Error(ex); return(new JsonResult { Data = new { success = false, msg = ex.ToString() }, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } }
public PageManager(JournalManager journal, List <Quest> currentQuests, List <Quest> completedQuests) { /* Save the journal */ this.journal = journal; /* Setup required lists */ metaList = new List <PagePairing>(); ipQuests = new List <PagePairing>(); cQuests = new List <PagePairing>(); /* Setup the master list */ masterList = new List <List <PagePairing> >(); masterList.Add(metaList); masterList.Add(ipQuests); masterList.Add(cQuests); /* Setup the item inspector */ itemInspector = LoadPair("ItemInspectorLeftPage", "ItemInspectorRightPage"); /* Setup the players stats */ playerStats = LoadPair("PlayerStatsLeftPage", "PlayerStatsRightPage"); /* Add these pairings to the meta list */ metaList.Add(itemInspector); metaList.Add(playerStats); /* Add all of the in progress quests */ foreach (Quest q in currentQuests) { ipQuests.Add(CreateQuestPair(q)); } /* Add all of the completed quests */ foreach (Quest q in completedQuests) { cQuests.Add(CreateQuestPair(q)); } /* We start out just looking at the player stats */ currentList = targetList = metaList; currentIndex = targetIndex = metaList.IndexOf(playerStats); /* We're ready to flip whenever */ flipTimer = 0.0f; }
private static void Upload() { var openFileDialog = new OpenFileDialog { Filter = "PDF Files|*.pdf" }; if (openFileDialog.ShowDialog() == true) { var path = openFileDialog.FileName; if (path != null) { var journal = new Journal { Author = AuthenticationManager.Instance.CurrentUser, Path = path, Name = new Guid().ToString() }; JournalManager.PublishJournal(journal); } } }
private void Awake() { instance = this; }
public void DeleteJournal(int journalId, string username) { JournalManager.DeleteSpecificJournal(journalId, username); }
public void SaveJournal(IJournal journal) { JournalManager.PublishJournal(journal); }
public List <IJournal> GetAllJournals() { return(JournalManager.GetAllJournals()); }
public List <IJournal> GetJournalsByUserId(string username) { return(JournalManager.GetJournalsForUser(username)); }
public IJournal GetJournalById(int documentId) { return(JournalManager.GetJournal(documentId)); }
void Start() { JM = transform.Find("UI").gameObject.GetComponent <JournalManager>(); SetStdStats(); InitialLoadStats(); }
public void GetAllJournal() { try { //用于序列化实体类的对象 JavaScriptSerializer jss = new JavaScriptSerializer(); jss.MaxJsonLength = Int32.MaxValue; //请求中携带的条件 string order = HttpContext.Request.Params["order"]; string sort = HttpContext.Request.Params["sort"]; string searchKey = HttpContext.Request.Params["search"]; int offset = Convert.ToInt32(HttpContext.Request.Params["offset"]); //0 int pageSize = Convert.ToInt32(HttpContext.Request.Params["limit"]); Dictionary <string, string> bizParaDic = new Dictionary <string, string>(); bizParaDic.Add("search", searchKey); Dictionary <string, string> bizParaDicTemp = new Dictionary <string, string>(); foreach (string para in HttpContext.Request.Params.Keys) { if (para.StartsWith("s") && (JournalManager.JournalDic.ContainsValue("i" + para.Substring(1, para.Length - 1)) || (para.Length > 2 && JournalManager.JournalDic.ContainsValue("i" + para.Substring(1, para.Length - 2))))) { bizParaDicTemp.Add("i" + para.Substring(1, para.Length - 1), HttpContext.Request.Params[para]); } } foreach (var item in bizParaDicTemp) { if (item.Key.EndsWith("2")) { continue; } if (bizParaDicTemp.ContainsKey(item.Key + "2")) { bizParaDic.Add(item.Key + "[d]", item.Value + "§" + bizParaDicTemp[item.Key + "2"]); } else { bizParaDic.Add(item.Key, item.Value); } } int total = 0; JournalManager service = new JournalManager(); List <JournalEntity> list = service.GetSearch(SessionHelper.CurrentUser.UserType, bizParaDic, sort, order, offset, pageSize, out total); DicManager dm = new DicManager(); var companies = dm.GetAllCompanies(); var projects = dm.GetAllProjects(); Dictionary <string, string> comDic = companies.ToDictionary(i => i.iGuid, i => i.iName); Dictionary <string, string> proDic = projects.ToDictionary(i => i.iGuid, i => i.iName); foreach (var item in list) { item.iCompanyId = comDic[item.iCompanyId]; item.iProjectId = proDic[item.iProjectId]; } //给分页实体赋值 PageModels <JournalEntity> model = new PageModels <JournalEntity>(); model.total = total; if (total % pageSize == 0) { model.page = total / pageSize; } else { model.page = (total / pageSize) + 1; } model.rows = list; //将查询结果返回 HttpContext.Response.Write(jss.Serialize(model)); } catch (Exception ex) { log4net.ILog log = log4net.LogManager.GetLogger(this.GetType()); log.Error(ex); } }
public void SetValue(ExecutionContext context, string value) { JournalManager.Set(value, WarnType.Info, null, true); }
void Start() { cm = GameObject.FindGameObjectWithTag("GameController").GetComponent<CharacterManager> (); jm = GameObject.FindGameObjectWithTag("GameController").GetComponent<JournalManager> (); gc = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController>(); aManager = GameObject.FindGameObjectWithTag ("AudioManager").GetComponent<AudioManager> (); active_speech = false; sub_switch = 0; current_sub = 0; Debug.Log (name + " Should not destroy on load"); DontDestroyOnLoad (transform.parent); }
public GameStatistics SelectGamePlayedStatistics() { var gamePlayedData = SelectSetting <GamePlayedData>(SettingType.GamePlayed) ?? new GamePlayedData(); var entrySources = Connection.SelectLazy <JournalEntrySource>() .Where(jes => jes.Id >= gamePlayedData.SessionStartedId).OrderBy(jes => jes.Filename) .ThenBy(jes => jes.LineNumber); DateTime?lastEntryTimestamp = null; var currentFilename = string.Empty; DateTime?gameStarted = null; var endGameAction = new Action <DateTime?, DateTime?>( (gameStarted2, gameEnded2) => { if (!gameStarted2.HasValue || !gameEnded2.HasValue) { return; } var gameTime = gameEnded2.Value - gameStarted2.Value; gamePlayedData.SessionsPlayed++; gamePlayedData.TotalTimePlayed = gamePlayedData.TotalTimePlayed.Add(gameTime); }); foreach (var entrySource in entrySources) { if (!entrySource.Parsed) { continue; } var entry = JournalManager.ParseJournalEntry(entrySource.Json); if (entrySource.Filename != currentFilename) { var fileHeader = entry as FileheaderJournalEntry; if (fileHeader?.Part == 1) { endGameAction(gameStarted, lastEntryTimestamp); gameStarted = null; } } currentFilename = entrySource.Filename; switch (entry.Event) { case JournalEventType.LoadGame: endGameAction(gameStarted, lastEntryTimestamp); gamePlayedData.SessionStartedId = entrySource.Id; gameStarted = entry.Timestamp; break; } lastEntryTimestamp = entry.Timestamp != lastEntryTimestamp ? entry.Timestamp : lastEntryTimestamp; } InsertOrUpdateSettingsEntry(SettingType.GamePlayed, gamePlayedData); if (!gameStarted.HasValue) { return(new GameStatistics { SessionsPlayed = gamePlayedData.SessionsPlayed, TotalTimePlayed = gamePlayedData.TotalTimePlayed }); } var sessionTimePlayed = lastEntryTimestamp.Value - gameStarted.Value; return(new GameStatistics { SessionsPlayed = gamePlayedData.SessionsPlayed + 1, TotalTimePlayed = gamePlayedData.TotalTimePlayed.Add(sessionTimePlayed), CurrentSessionPlayed = sessionTimePlayed }); }