Commit 696a067c authored by Darwin's avatar Darwin
Browse files

offering is completed

parent 9b3bab9e
......@@ -3,13 +3,8 @@
<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:/E:/semester%206/Sistem%20Paralel%20dan%20Terdistribusi/SISTER/IF3230-Tugas-Besar-Sister-2015/src/client/src/tcpclient/TCPClient.java</file>
<file>file:/E:/semester%206/Sistem%20Paralel%20dan%20Terdistribusi/SISTER/IF3230-Tugas-Besar-Sister-2015/src/client/src/tcpclient/MainPage.java</file>
=======
<file>file:/C:/Users/Stephen/Documents/NetBeansProjects/TubesSister/src/client/src/tcpclient/TCPClient.java</file>
<file>file:/C:/Users/Stephen/Documents/NetBeansProjects/TubesSister/src/client/src/tcpclient/MainPage.java</file>
>>>>>>> 6ee3636e215ce68e8e6c04438b47fa355e8396b2
</group>
</open-files>
</project-private>
This diff is collapsed.
This diff is collapsed.
......@@ -238,9 +238,12 @@ public class TCPClient {
//throw ioexception
DataOutputStream outToServer;
try {
System.out.println("mix mantap");
outToServer = new DataOutputStream(clientSocket.getOutputStream());
outToServer.writeBytes(toSend + '\n');
System.out.println("harusnya udah nambah");
} catch (IOException ex) {
System.out.println("error woi mix nya");
Logger.getLogger(TCPClient.class.getName()).log(Level.SEVERE, null, ex);
throw new Exception("outtoserver mix item exception");
}
......
......@@ -3,8 +3,7 @@
<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>
<file>file:/C:/Users/Stephen/Documents/NetBeansProjects/TubesSister/src/server/src/tcpserver/TCPServer.java</file>
<file>file:/C:/Users/Stephen/Documents/NetBeansProjects/TubesSister/src/server/src/tcpserver/MySQLAccess.java</file>
<file>file:/E:/semester%206/Sistem%20Paralel%20dan%20Terdistribusi/SISTER/IF3230-Tugas-Besar-Sister-2015/src/server/src/tcpserver/TCPServer.java</file>
</group>
</open-files>
</project-private>
......@@ -137,9 +137,9 @@ public class MySQLAccess {
array.put(resultSet.getString("potion"));
array.put(resultSet.getString("incense"));
array.put(resultSet.getString("gems"));
array.put(resultSet.getString("elixir"));
array.put(resultSet.getString("crystal"));
array.put(resultSet.getString("stone"));
array.put(resultSet.getString("life_elixir"));
array.put(resultSet.getString("mana_crystal"));
array.put(resultSet.getString("philosopher_stone"));
response.put("inventory", array);
}
} catch (SQLException e) {
......@@ -171,21 +171,21 @@ public class MySQLAccess {
+ "id_item=" + item1 + ";");
resultSet2 = preparedStatement.executeQuery();
if(resultSet2.first())
itemName1 = resultSet2.getString("item_name").toLowerCase();
itemName1 = resultSet2.getString("item_name").toLowerCase().replace(' ','_');
// Cek apa nama dari item 2
preparedStatement = connect.prepareStatement("SELECT * FROM items WHERE "
+ "id_item=" + item2 + ";");
resultSet2 = preparedStatement.executeQuery();
if(resultSet2.first())
itemName2 = resultSet2.getString("item_name").toLowerCase();
itemName2 = resultSet2.getString("item_name").toLowerCase().replace(' ','_');
// Cek apa nama dari item hasil
preparedStatement = connect.prepareStatement("SELECT * FROM items WHERE "
+ "id_item=" + item_result + ";");
resultSet2 = preparedStatement.executeQuery();
if(resultSet2.first())
itemNameResult = resultSet2.getString("item_name").toLowerCase();
itemNameResult = resultSet2.getString("item_name").toLowerCase().replace(' ','_');
// Cek apakah pengguna memiliki jumlah barang yang cukup (masing - masing 3)
preparedStatement = connect.prepareStatement("SELECT * FROM inventory WHERE "
......
......@@ -31,7 +31,7 @@ public class TCPServer implements Runnable {
servers = new ArrayList<Host>();
// Test join tracker
join(InetAddress.getLocalHost().getHostAddress(), 6790);
//join(InetAddress.getLocalHost().getHostAddress(), 6790);
sql = new MySQLAccess();
}
......
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