Commit f12af3f9 authored by Hendro Triokta Brianto's avatar Hendro Triokta Brianto
Browse files

server test

parents f94c89cd 3e2d779e
......@@ -298,26 +298,27 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="itemIcon5" min="-2" max="-2" attributes="0"/>
<Component id="itemIcon6" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblItem5" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="txtCount5" min="-2" max="-2" attributes="0"/>
<Component id="itemIcon5" min="-2" max="-2" attributes="0"/>
<Component id="lblItem6" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
<Component id="txtCount6" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="itemIcon6" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="1" attributes="0">
<Component id="txtCount6" min="-2" pref="18" max="-2" attributes="0"/>
<Component id="lblItem6" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="txtCount5" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<Component id="lblItem5" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
......@@ -337,18 +338,18 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="txtCount4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="itemIcon5" min="-2" max="-2" attributes="0"/>
<Component id="itemIcon6" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
<Component id="lblItem5" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="txtCount5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="itemIcon6" min="-2" max="-2" attributes="0"/>
<Component id="txtCount5" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="itemIcon5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblItem6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtCount6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="27" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
......@@ -366,14 +367,14 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="itemIcon6">
<Component class="javax.swing.JLabel" name="itemIcon5">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/thealchemist/img/incense.png"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="itemIcon5">
<Component class="javax.swing.JLabel" name="itemIcon6">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/thealchemist/img/gems.png"/>
......@@ -395,7 +396,7 @@
<Property name="text" type="java.lang.String" value="Gems"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="txtCount5">
<Component class="javax.swing.JLabel" name="txtCount6">
<Properties>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
......@@ -405,7 +406,7 @@
<Property name="text" type="java.lang.String" value="Incense"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="txtCount6">
<Component class="javax.swing.JLabel" name="txtCount5">
<Properties>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
......
......@@ -26,7 +26,7 @@ user.properties.file=C:\\Users\\Muldani\\AppData\\Roaming\\NetBeans\\8.0\\build.
<<<<<<< HEAD
user.properties.file=C:\\Users\\A450LC W8\\AppData\\Roaming\\NetBeans\\8.0.1\\build.properties
=======
user.properties.file=C:\\Users\\Muldani\\AppData\\Roaming\\NetBeans\\8.0\\build.properties
user.properties.file=C:\\Users\\adwisatya\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
>>>>>>> 02323e945e52f7a247d213f954c360232adc5b0e
>>>>>>> 43edd7f388dc28ed09074436ded7167fffce2bcf
>>>>>>> 08b39e9ffc058e8856fd1186a9d3fbe46d951054
......
......@@ -3,29 +3,10 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<<<<<<< HEAD
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/gui/AlcMixItem.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/gui/AlcLogon.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/gui/AlcMap.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/gui/AlcFindItem.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/engine/Main.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/gui/AlcTradeBox.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/gui/AlcItem.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/engine/Response.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/client/TheAlchemistClient/src/thealchemist/engine/Connection.java</file>
=======
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/AlcOffer.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/AlcItem.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/AlcFindItem.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/AlcMap.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/engine/Connection.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/engine/Main.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/AlcTradeBox.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/AlcTradeItem.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/AlcLogon.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/AlcMixItem.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/gui/ImagePanel.java</file>
>>>>>>> ab35a18e11b0fab1af378a1ddb185a0c486fc47b
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/client/TheAlchemistClient/src/thealchemist/engine/Response.java</file>
</group>
</open-files>
</project-private>
......@@ -8,10 +8,12 @@ package thealchemist.engine;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.security.MessageDigest;
......@@ -28,6 +30,10 @@ import org.json.JSONObject;
* @author adwisatya
*/
public class Connection {
Socket miniSocket;
private String clientSentence;
private BufferedReader fromClient;
private DataOutputStream toClient;
String response;
String request;
private static String URL = "167.205.32.46";
......@@ -36,27 +42,33 @@ public class Connection {
// private static String URL;
// private static int defPort;
private String token = "kosong";
// public Connection(Socket c) throws IOException{
// connectionSocket = c;
// }
public String sendRequest(String JSON) throws IOException, JSONException{
Socket miniSocket = new Socket(URL,defPort);
miniSocket = new Socket(URL,defPort);
char[] buffer = new char[1024];
JSONObject obj = new JSONObject(JSON);
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(miniSocket.getOutputStream())));
out.println(obj);
out.println();
out.flush();
InputStream dataInputStream = new DataInputStream(miniSocket.getInputStream());
InputStreamReader inputStreamReader = new InputStreamReader(dataInputStream);
BufferedReader in = new BufferedReader(inputStreamReader);
in.read(buffer);
response = new String(buffer);
in.close();
sendToClient(obj.toString());
// PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(miniSocket.getOutputStream())));
// out.print(obj);
// //out.print();
// out.flush();
fromClient = new BufferedReader(new InputStreamReader(miniSocket.getInputStream()));
fromClient.read(buffer);
clientSentence = new String(buffer);
return response;
// InputStream dataInputStream = new DataInputStream(miniSocket.getInputStream());
// InputStreamReader inputStreamReader = new InputStreamReader(dataInputStream);
// BufferedReader in = new BufferedReader(inputStreamReader);
// in.read(buffer);
// response = new String(buffer);
// in.close();
return clientSentence;
}
public void setToken(String JSONString){
......@@ -266,5 +278,9 @@ public class Connection {
return img;
}
public void sendToClient(String tmpStr) throws IOException{
PrintStream out = new PrintStream(miniSocket.getOutputStream());
out.print(tmpStr);
System.out.println(tmpStr);
}
}
......@@ -298,26 +298,27 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="itemIcon5" min="-2" max="-2" attributes="0"/>
<Component id="itemIcon6" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblItem5" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="txtCount5" min="-2" max="-2" attributes="0"/>
<Component id="itemIcon5" min="-2" max="-2" attributes="0"/>
<Component id="lblItem6" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
<Component id="txtCount6" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="itemIcon6" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="1" attributes="0">
<Component id="txtCount6" min="-2" pref="18" max="-2" attributes="0"/>
<Component id="lblItem6" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="txtCount5" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<Component id="lblItem5" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
......@@ -337,18 +338,18 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="txtCount4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="itemIcon5" min="-2" max="-2" attributes="0"/>
<Component id="itemIcon6" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
<Component id="lblItem5" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="txtCount5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="itemIcon6" min="-2" max="-2" attributes="0"/>
<Component id="txtCount5" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="itemIcon5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblItem6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtCount6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="27" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
......@@ -366,14 +367,14 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="itemIcon6">
<Component class="javax.swing.JLabel" name="itemIcon5">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/thealchemist/img/incense.png"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="itemIcon5">
<Component class="javax.swing.JLabel" name="itemIcon6">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/thealchemist/img/gems.png"/>
......@@ -395,7 +396,7 @@
<Property name="text" type="java.lang.String" value="Gems"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="txtCount5">
<Component class="javax.swing.JLabel" name="txtCount6">
<Properties>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
......@@ -405,7 +406,7 @@
<Property name="text" type="java.lang.String" value="Incense"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="txtCount6">
<Component class="javax.swing.JLabel" name="txtCount5">
<Properties>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
......
......@@ -49,8 +49,8 @@ public class AlcItem extends javax.swing.JFrame {
txtCount2.setText(list.get(2));
txtCount3.setText(list.get(3));
txtCount4.setText(list.get(4));
txtCount5.setText(list.get(5));
txtCount6.setText(list.get(6));
txtCount6.setText(list.get(5));
txtCount5.setText(list.get(6));
txtCount7.setText(list.get(7));
txtCount8.setText(list.get(8));
txtCount9.setText(list.get(9));
......@@ -88,14 +88,14 @@ public class AlcItem extends javax.swing.JFrame {
jPanel2 = new javax.swing.JPanel();
jLabel12 = new javax.swing.JLabel();
itemIcon4 = new javax.swing.JLabel();
itemIcon6 = new javax.swing.JLabel();
itemIcon5 = new javax.swing.JLabel();
itemIcon6 = new javax.swing.JLabel();
lblItem4 = new javax.swing.JLabel();
txtCount4 = new javax.swing.JLabel();
lblItem5 = new javax.swing.JLabel();
txtCount5 = new javax.swing.JLabel();
lblItem6 = new javax.swing.JLabel();
txtCount6 = new javax.swing.JLabel();
lblItem6 = new javax.swing.JLabel();
txtCount5 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel22 = new javax.swing.JLabel();
itemIcon7 = new javax.swing.JLabel();
......@@ -237,9 +237,9 @@ public class AlcItem extends javax.swing.JFrame {
itemIcon4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/thealchemist/img/potion.png"))); // NOI18N
itemIcon6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/thealchemist/img/incense.png"))); // NOI18N
itemIcon5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/thealchemist/img/incense.png"))); // NOI18N
itemIcon5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/thealchemist/img/gems.png"))); // NOI18N
itemIcon6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/thealchemist/img/gems.png"))); // NOI18N
lblItem4.setText("Potion");
......@@ -247,11 +247,11 @@ public class AlcItem extends javax.swing.JFrame {
lblItem5.setText("Gems");
txtCount5.setText("0");
txtCount6.setText("0");
lblItem6.setText("Incense");
txtCount6.setText("0");
txtCount5.setText("0");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
......@@ -273,21 +273,22 @@ public class AlcItem extends javax.swing.JFrame {
.addComponent(lblItem4))
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(itemIcon5))
.addComponent(itemIcon6))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(29, 29, 29)
.addGap(19, 19, 19)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblItem5)
.addComponent(itemIcon5)
.addComponent(lblItem6)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(txtCount5))))
.addGap(22, 22, 22)
.addComponent(txtCount6))))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(19, 19, 19)
.addGap(29, 29, 29)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(itemIcon6)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(txtCount6, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblItem6)))))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(txtCount5, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(lblItem5))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
......@@ -302,18 +303,18 @@ public class AlcItem extends javax.swing.JFrame {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtCount4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(itemIcon5)
.addComponent(itemIcon6)
.addGap(5, 5, 5)
.addComponent(lblItem5)
.addGap(2, 2, 2)
.addComponent(txtCount5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(itemIcon6)
.addComponent(txtCount5)
.addGap(2, 2, 2)
.addComponent(itemIcon5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblItem6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtCount6)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(27, Short.MAX_VALUE))
);
jPanel3.setBackground(new java.awt.Color(153, 255, 204));
......
......@@ -25,7 +25,7 @@ user.properties.file=C:\\Users\\Muldani\\AppData\\Roaming\\NetBeans\\8.0\\build.
<<<<<<< HEAD
user.properties.file=C:\\Users\\A450LC W8\\AppData\\Roaming\\NetBeans\\8.0.1\\build.properties
=======
user.properties.file=C:\\Users\\Muldani\\AppData\\Roaming\\NetBeans\\8.0\\build.properties
user.properties.file=C:\\Users\\adwisatya\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
>>>>>>> 02323e945e52f7a247d213f954c360232adc5b0e
>>>>>>> 43edd7f388dc28ed09074436ded7167fffce2bcf
>>>>>>> 08b39e9ffc058e8856fd1186a9d3fbe46d951054
......
......@@ -3,16 +3,9 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<<<<<<< HEAD
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/server/src/thealchemist/Client.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/server/src/thealchemist/TCPServer.java</file>
<file>file:/F:/z~edo/Kuliah/Semester%206/IF3230%20Sistem%20Paralel%20dan%20Terdistribusi/Tugas%20Akhir/src/server/src/thealchemist/Database.java</file>
=======
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/server/src/folder/map.json</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/server/src/thealchemist/Client.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/server/src/thealchemist/Database.java</file>
<file>file:/C:/Users/adwisatya/Documents/Semester%206/Tugas/IF3230%20Sister/IF3230-Tugas-Besar-Sister-2015/src/server/src/thealchemist/TCPServer.java</file>
>>>>>>> ab35a18e11b0fab1af378a1ddb185a0c486fc47b
</group>
</open-files>
</project-private>
......@@ -115,7 +115,6 @@ public class Client extends Thread{
System.out.println(database.getServers().toString());
break;
case "serverStatus":
System.out.println(JSONtoString("server",cmd));
cmdServerStatus(JSONtoString("server",cmd));
break;
/* 1 */
......@@ -138,7 +137,7 @@ public class Client extends Thread{
case "mixitem":
cmdMixitem(JSONtoString("token",cmd),JSONtoString("item1",cmd),JSONtoString("item2",cmd));
break;
/* 6 belum */
/* 6 */
case "map":
cmdMap(JSONtoString("token",cmd));
break;
......@@ -162,8 +161,9 @@ public class Client extends Thread{
case "sendfind":
cmdSendFind(JSONtoString("token",cmd), Integer.parseInt(JSONtoString("item",cmd)));
break;
case "12": System.out.println(cmdFindOffer("ece63df163ce1948008064c006f4900d",2));
/* 12 belum */
case "findoffer":
cmdFindOffer(new Integer(JSONtoString("itemid",cmd)));
break;
case "13": System.out.println(cmdSendAccept("ece63df163ce1948008064c006f4900d","ece63df163ce1948008064c006f4900d"));
break;
......@@ -197,7 +197,7 @@ public class Client extends Thread{
} catch (JSONException ex) {
Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
}
System.out.println("request");
System.out.println(request);
}
public void cmdJoin() throws IOException, JSONException{
String response = "";
......@@ -398,7 +398,7 @@ public class Client extends Thread{
sendToClient(obj.toString());
}
/* Sukses */
public String cmdFindOffer(String token,int itemId) throws IOException, NoSuchAlgorithmException, JSONException{
public void cmdFindOffer(int itemId) throws IOException, NoSuchAlgorithmException, JSONException{
String response = "";
String request= "";
Socket miniSocket = new Socket(URL,dbPort);
......@@ -416,8 +416,6 @@ public class Client extends Thread{
BufferedReader in = new BufferedReader(new InputStreamReader(miniSocket.getInputStream()));
response = org.apache.commons.io.IOUtils.toString(in);
in.close();
return response;
}
/* Sukses */
public String cmdSendAccept(String token, String offer_token) throws IOException, NoSuchAlgorithmException, JSONException{
......
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