-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathProtocol.java
More file actions
52 lines (46 loc) · 965 Bytes
/
Protocol.java
File metadata and controls
52 lines (46 loc) · 965 Bytes
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
42
43
44
45
46
47
48
49
50
51
52
/*
* Protocol.java
*
* Created on 25 ãÇÑÓ, 2008, 10:32 ã
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
/**
*
* @author Mohamed Talaat Saad
*/
public class Protocol {
/**
* Creates a new instance of Protocol
*/
private String message="";
public Protocol()
{
}
public String RegisterPacket(int x,int y)
{
message="Hello"+x+","+y;
return message;
}
public String UpdatePacket(int x,int y,int id,int dir)
{
message="Update"+x+","+y+"-"+dir+"|"+id;
return message;
}
public String ShotPacket(int id)
{
message="Shot"+id;
return message;
}
public String RemoveClientPacket(int id)
{
message="Remove"+id;
return message;
}
public String ExitMessagePacket(int id)
{
message="Exit"+id;
return message;
}
}