53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Csbot.Core
|
|
{
|
|
/// <summary>
|
|
/// This class implements the ISender interface and represents a "huamn" user (or a bot, or anything pretending to be human on IRC).
|
|
/// </summary>
|
|
class User : ISender
|
|
{
|
|
public String host { get; set; }
|
|
public String nick { get; set; }
|
|
public String realname { get; set; }
|
|
|
|
/// <summary>
|
|
/// Public constructor for the class.
|
|
/// </summary>
|
|
/// <param name="nick">The user's nickname.</param>
|
|
/// <param name="realname">The user's realname.</param>
|
|
/// <param name="host">The user's hostname.</param>
|
|
public User(String nick, String realname, String host)
|
|
{
|
|
this.nick = nick;
|
|
this.realname = realname;
|
|
this.host = host;
|
|
}
|
|
|
|
/// <summary>
|
|
/// This function returns a Message ready to be sent as a USER command.
|
|
/// </summary>
|
|
/// <returns>The USER command.</returns>
|
|
public Message getUserLine()
|
|
{
|
|
Message ret = new Message();
|
|
ret.line = "USER " + this.nick + " 0 * :" + realname;
|
|
return ret;
|
|
}
|
|
|
|
/// <summary>
|
|
/// This functions returns a Message ready to be sent as a NICK command.
|
|
/// </summary>
|
|
/// <returns>The NICK command.</returns>
|
|
public Message getNickLine()
|
|
{
|
|
Message ret = new Message();
|
|
ret.line = "NICK " + this.nick;
|
|
return ret;
|
|
}
|
|
}
|
|
}
|