Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stephen
IF3230-Tugas-Besar-Sister-2015
Commits
01516b2f
Commit
01516b2f
authored
Apr 22, 2015
by
melvinfonda
Browse files
accept done 2
parent
f9d10a5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/client/build/classes/tcpclient/TCPClient.class
View file @
01516b2f
No preview for this file type
src/client/src/tcpclient/TCPClient.java
View file @
01516b2f
...
...
@@ -649,9 +649,9 @@ public class TCPClient {
return
responseJSON
;
}
public
static
void
main
(
String
argv
[])
throws
Exception
{
TCPClient
client
=
new
TCPClient
(
"localhost"
,
6789
);
//
public static void main(String argv[]) throws Exception
//
{
//
TCPClient client = new TCPClient("localhost", 6789);
// do {
// BufferedReader inFromUser = new BufferedReader( new InputStreamReader(System.in));
...
...
@@ -754,16 +754,16 @@ public class TCPClient {
// } while(true);
// } while(!command.equalsIgnoreCase("exit"));
//
JSONObject
response
=
client
.
login
(
"ayam"
,
"ayam"
);
if
(
response
.
getString
(
"status"
).
equals
(
"ok"
))
{
client
.
token
=
response
.
getString
(
"token"
);
client
.
x
=
response
.
getInt
(
"x"
);
client
.
y
=
response
.
getInt
(
"y"
);
}
System
.
out
.
println
(
response
.
toString
());
response
=
client
.
map
();
System
.
out
.
println
(
response
.
toString
());
//
JSONObject response = client.login("ayam", "ayam");
//
if(response.getString("status").equals("ok")) {
//
client.token = response.getString("token");
//
client.x=response.getInt("x");
//
client.y=response.getInt("y");
//
}
//
System.out.println(response.toString());
//
//
response = client.map();
//
System.out.println(response.toString());
//
// response = client.offer(client.token, 0, 1, 7, 3);
// System.out.println(response.toString());
...
...
@@ -771,12 +771,12 @@ public class TCPClient {
// response = client.findoffer(client.token, 2);
// System.out.println(response.toString());
//
response
=
client
.
accept
(
client
.
token
,
"a"
);
System
.
out
.
println
(
response
.
toString
());
//
response = client.accept(client.token, "a");
//
System.out.println(response.toString());
//
// response = client.tradebox(client.token);
// System.out.println(response.toString());
}
//
}
//
//
//
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment