public void AddEvent(object e, KeyboardUtils keyboardUtils) { if (EventLogList.Count > 10) { EventLogList.RemoveAt(0); } if (e is KeysArray) { EventLogList.Add(new LogElement(e.ToString())); } if (e is string) { EventLogList.Add(new LogElement(e as string)); } }
public void LogGuildEvent(GuildEventLogTypes EventType, ulong Guid1, ulong Guid2 = 0, uint newRank = 0) { EventLog NewEvent = new EventLog() { EventType = (byte)EventType, PlayerGuid1 = new ObjectGuid(Guid1), PlayerGuid2 = new ObjectGuid(Guid2), NewRank = (byte)newRank, TimeStamp = (ulong)DateTime.UtcNow.Ticks }; EventLogList.Add(NewEvent); // Save event to DB //CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE guildid='%u' AND LogGuid='%u'", m_Id, m_GuildEventLogNextGuid); //CharacterDatabase.PExecute("INSERT INTO guild_eventlog (guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp) VALUES ('%u','%u','%u','%u','%u','%u','" UI64FMTD "')", //m_Id, m_GuildEventLogNextGuid, uint32(NewEvent.EventType), NewEvent.PlayerGuid1, NewEvent.PlayerGuid2, uint32(NewEvent.NewRank), NewEvent.TimeStamp); }
public void AddEvent(object e) { if (EventLogList.Count > 10) { EventLogList.RemoveAt(0); } switch (e) { case KeysArray k: EventLogList.Add(new LogElement(k.ToString())); break; case string s: EventLogList.Add(new LogElement(s.ToString())); break; default: EventLogList.Add(new LogElement(e.ToString())); break; } }