-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGame.java
41 lines (35 loc) · 1.14 KB
/
Game.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
/**
* RMI methods definition.
* All methods on RMI must throw RemoteException.
* @author HAORAN
*
*/
public interface Game extends Remote {
/*
* Count the number of words in message.
*/
int count (String message) throws RemoteException;
/*
* Validate user in the database.
* Avoid Repeated login by checking against the online user list.
* Update OnlineUser list.
*/
int Login(String username, String password) throws RemoteException;
/*
* Avoid duplicating user name by checking the database
* Login user and update OnlineUser list if register successfully.
*/
int Register(String username, String password) throws RemoteException;
/*
* Update OnlineUser list.
*/
void Logout(String username) throws RemoteException;
ArrayList<String> userList = new ArrayList<String>();
ArrayList<String> password = new ArrayList<String>();
ArrayList<String> onlineUserList = new ArrayList<String>();
// remove the user from online user list
void removeUser(String username) throws RemoteException;
}