mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 11:22:53 +02:00
Client
- `user(string, string, string, string)` now checks for illegal characters
This commit is contained in:
parent
d2b4ccfeda
commit
f20c078fc3
@ -876,15 +876,25 @@ public class Client : Thread
|
||||
* hostname = the hostname to use
|
||||
* servername = the servername to use
|
||||
* 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)
|
||||
{
|
||||
// TODO: Implement me properly with all required checks
|
||||
|
||||
if(isValidText(username) && isValidText(hostname) && isValidText(servername) && isValidText(realname))
|
||||
{
|
||||
/* 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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a given message onto the receieve queue for
|
||||
|
Loading…
Reference in New Issue
Block a user