Skip to content

Commit

Permalink
Merge pull request #11 from relavis/master
Browse files Browse the repository at this point in the history
fix shit
  • Loading branch information
Andrew authored Oct 22, 2020
2 parents 5adf058 + aede4bc commit b3d7a16
Show file tree
Hide file tree
Showing 3 changed files with 8 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
2 changes: 2 additions & 0 deletions src/main/java/org/cyberpwn/react/ui/ServerTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ public void push(GList<String> actions) {

public void push(GMap<String, Double> sample, String console) {
sample.put("rct", sample.get("rct") / 1000000.0);
sample.put("mah/s", sample.get("mah/s") / 1024D / 1024D);
sample.put("mem", sample.get("mem") / 1024 / 1024);
lastConsole = StringUtils.repeat("\n", 40) + console;
lastLog = StringUtils.repeat("\n", 40) + L.log;

Expand Down

0 comments on commit b3d7a16

Please sign in to comment.