public void EndPartyMemberStatusEntry(PartyMemberStatusEntry partyMemberStatusEntry)
 {
     partyMemberStatusEntry.TimeExpiredOffset = Convert.ToUInt32(EncounterTimer.ElapsedMilliseconds);
     _sqLiteConnection.UpdateAsync(partyMemberStatusEntry)
                      .ContinueWith(t => LogHelper.Log(Logger, "Status " + partyMemberStatusEntry.StatusName + " (" + partyMemberStatusEntry.StatusId + ") expired on encounter " + EncounterId + ".", LogLevel.Trace));
     partyMemberStatusEntries.Remove(partyMemberStatusEntry);
 }
        public void NewPartyMemberStatusEntry(StatusEntry statusEntry, uint partyMemberId)
        {
            try
            {
                var partyMemberStatusEntry = new PartyMemberStatusEntry
                {
                    CasterId = statusEntry.CasterID,
                    Duration = statusEntry.Duration,
                    EncounterId = EncounterId,
                    PartyMemberId = partyMemberId,
                    StatusId = statusEntry.StatusID,
                    StatusName = statusEntry.StatusName,
                    TargetName = statusEntry.TargetName,
                    TimeOffset = Convert.ToUInt32(EncounterTimer.ElapsedMilliseconds)
                };

                _sqLiteConnection.InsertAsync(partyMemberStatusEntry)
                                 .ContinueWith(t => LogHelper.Log(Logger, "Status " + partyMemberStatusEntry.StatusName + " (" + partyMemberStatusEntry.StatusId + ") for party member " + partyMemberId + " captured for encounter " + EncounterId + ".", LogLevel.Trace));

                partyMemberStatusEntries.Add(partyMemberStatusEntry);
            }
            catch (Exception ex)
            {
                LogHelper.Log(Logger, ex, LogLevel.Error);
            }
        }