Commit f4e9e9c3 authored by Akhmad Fakhoni Listiyan Dede's avatar Akhmad Fakhoni Listiyan Dede
Browse files

offer message ok

parent f21b714f
......@@ -154,6 +154,16 @@ public class Message {
response = pickField(token);
break;
}
case "offer":
{
String token = jsonObj.getString("token");
int Offered_item = jsonObj.getInt("offered_item");
int n1 = jsonObj.getInt("n1");
int demanded_item = jsonObj.getInt("demanded_item");
int n2 = jsonObj.getInt("n2");
response = putOffer(token, Offered_item, n1, demanded_item, n2);
break;
}
case "serverStatus":
response = serverStatus(jsonString);
break;
......@@ -163,6 +173,7 @@ public class Message {
}
catch(JSONException ex)
{
System.out.println("Receive Exeption: [ERROR]" + jsonString);
return error();
}
return response;
......@@ -480,8 +491,8 @@ public class Message {
kemudian cek itemnya di map, baru bisa dimasukkan itemnya ke database */
JSONObject jsonObj = new JSONObject();
JSONObject jsonPosition = Database.getCurrentPosition(token);
int x = 0;
int y = 0;
int x;
int y;
String [][] map = Store.getMap();
int item;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment