Constructor and Description |
---|
Server()
Constructs a new server.
|
Modifier and Type | Method and Description |
---|---|
int |
addUser(java.lang.String name,
java.lang.String password)
Tries to register a new user with a given screen name
and password.
|
int |
login(java.lang.String name,
java.lang.String password)
Tries to login a user with a given screen name and password.
|
void |
logout(MsgUser u)
Removes a given user
u from the set of all logged-in users. |
public Server()
public int addUser(java.lang.String name, java.lang.String password)
user
object
for this user and adds this user to the map of all users
(using the screen name as the key).addUser
in interface Login
name
- the screen name of the user.password
- the password for the user.public int login(java.lang.String name, java.lang.String password)
openDialog()
method;public void logout(MsgUser u)
u
from the set of all logged-in users.
Removes u
from the buddy list of each logged-in user.u
- user to be logged out.