using System; namespace Woodpecker.Game.Moderation { public struct chatLog { #region Fields /// /// The ID of the sessio that chatted this message. /// private uint sessionID; /// /// The System.DateTime object representing the timestamp of this chat message. /// public DateTime Timestamp; /// /// The database ID of the user that chatted this message. /// private int userID; /// /// The database ID of the room where this message was chatted in. /// private int roomID; /// /// In case the type of this chatlog is a whisper, this value will hold the database ID of the receiving user. /// private int receiverID; /// /// The type of this chat log message. /// private chatType Type; /// /// The actual message of this chat message. /// public string Text; #endregion #region Constructors /// /// Constructs a chatLog object with given parameters. /// /// /// /// /// /// /// public chatLog(uint sessionID, int userID, int roomID, int receiverID, chatType Type, string Text) { this.Timestamp = DateTime.Now; this.sessionID = sessionID; this.userID = userID; this.roomID = roomID; this.receiverID = receiverID; this.Type = Type; this.Text = Text; } #endregion #region Methods /// /// Crafts the SQL query for inserting this message in the database. /// public override string ToString() { return "INSERT INTO " + "moderation_chatlog " + "VALUES (@moment,'" + this.sessionID + "','" + this.userID + "','" + this.roomID + "','" + this.receiverID + "','" + this.Type.ToString() + "',@text)"; } #endregion } }