Skip to content

Commit

Permalink
Add network messages to RequestBasic, added network messages to Reque…
Browse files Browse the repository at this point in the history
…st (but disabled them because they're spammy)
  • Loading branch information
Andrew committed Jul 19, 2020
1 parent 5adf058 commit 467a545
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/cyberpwn/react/network/Request.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cyberpwn.react.network;

import org.cyberpwn.react.L;
import org.cyberpwn.react.util.GMap;
import org.json.JSONObject;

Expand All @@ -24,10 +25,12 @@ public void run() {
DataInputStream i = new DataInputStream(s.getInputStream());
DataOutputStream o = new DataOutputStream(s.getOutputStream());
PacketRequest pr = new PacketRequest(ns.getUsername(), ns.getPassword(), PacketRequestType.GET_SAMPLES.toString());
//L.n("OUT: " + pr.toString());
o.writeUTF(pr.toString());
o.flush();
String response = i.readUTF();
PacketResponse ps = new PacketResponse(new JSONObject(response));
//L.n("IN: " + ps.toString());
GMap<String, Double> data = new GMap<>();
String console = "";

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/cyberpwn/react/network/RequestBasic.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cyberpwn.react.network;

import org.cyberpwn.react.L;
import org.cyberpwn.react.util.GMap;
import org.json.JSONObject;

Expand All @@ -24,10 +25,12 @@ public void run() {
DataInputStream i = new DataInputStream(s.getInputStream());
DataOutputStream o = new DataOutputStream(s.getOutputStream());
PacketRequest pr = new PacketRequest(ns.getUsername(), ns.getPassword(), PacketRequestType.GET_BASIC.toString());
L.n("OUT: " + pr.toString());
o.writeUTF(pr.toString());
o.flush();
String response = i.readUTF();
PacketResponse ps = new PacketResponse(new JSONObject(response));
L.n("IN: " + ps.toString());
GMap<String, String> data = new GMap<>();

if (ps.getString("type").equals("OK")) {
Expand Down

0 comments on commit 467a545

Please sign in to comment.