using System;
using Woodpecker.Storage;
using Woodpecker.Game.Users.Roles;
namespace Woodpecker.Game.Users
{
///
/// Contains the basic information about a user.
///
public class basicUserInformation
{
#region Fields
///
/// The database ID of this user.
///
public int ID;
///
/// The username of this user.
///
public string Username;
///
/// The System.DateTime object representing the last activity of this user.
///
public DateTime lastActivity;
///
/// This user's last activity formatted as a string in the format dd-MM-yyyy HH:mm:ss.
///
public string messengerLastActivity
{
get
{
return this.lastActivity.ToString("dd-MM-yyyy HH:mm:ss");
}
}
///
/// The figure string (25 characters, digits only) of this user.
///
public string Figure;
///
/// The sex of this user. ('M' = male, 'F' = female)
///
public char Sex;
///
/// The motto (also known as 'mission') of this user.
///
public string Motto;
///
/// The motto displayed for this user in the messenger.
///
public string messengerMotto;
#endregion
#region Methods
///
/// Updates the last activity datetime in the database and this object to the current time.
///
public void updateLastActivity()
{
Database Database = new Database(false, true);
Database.addParameterWithValue("userid", this.ID);
Database.Open();
if (Database.Ready)
Database.runQuery("UPDATE users SET lastactivity = NOW() WHERE id = @userid");
this.lastActivity = DateTime.Now;
}
#endregion
}
}