mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 13:43:19 +02:00
Client
- `user(string, string, string, string)` now checks for illegal characters
This commit is contained in:
parent
d2b4ccfeda
commit
f20c078fc3
@ -876,14 +876,24 @@ public class Client : Thread
|
|||||||
* hostname = the hostname to use
|
* hostname = the hostname to use
|
||||||
* servername = the servername to use
|
* servername = the servername to use
|
||||||
* realname = your realname
|
* realname = your realname
|
||||||
|
* Throws:
|
||||||
|
* `BirchwoodException` if the username, jostname,
|
||||||
|
* servername or realname contains illegal characters
|
||||||
*/
|
*/
|
||||||
public void user(string username, string hostname, string servername, string realname)
|
public void user(string username, string hostname, string servername, string realname)
|
||||||
{
|
{
|
||||||
// TODO: Implement me properly with all required checks
|
// TODO: Implement me properly with all required checks
|
||||||
|
|
||||||
/* User message */
|
if(isValidText(username) && isValidText(hostname) && isValidText(servername) && isValidText(realname))
|
||||||
Message userMessage = new Message("", "USER", username~" "~hostname~" "~servername~" "~":"~realname);
|
{
|
||||||
sendMessage(userMessage);
|
/* User message */
|
||||||
|
Message userMessage = new Message("", "USER", username~" "~hostname~" "~servername~" "~":"~realname);
|
||||||
|
sendMessage(userMessage);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new BirchwoodException(ErrorType.ILLEGAL_CHARACTERS, "Illegal characters present in either the username, hostname, server name or real name");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user