Ensure unique file locations for every data value to prevent any file

mishaps or errors.
dev
sigonasr2 7 years ago
parent d889ce8495
commit 5978cf6e49
  1. BIN
      sigIRCv2.jar
  2. 4
      src/sig/modules/RabiRace/Profile.java
  3. 4
      src/sig/modules/RabiRace/SessionListWindow.java

Binary file not shown.

@ -175,7 +175,7 @@ public class Profile {
public void downloadProfile() { public void downloadProfile() {
if (sigIRC.authenticated) { if (sigIRC.authenticated) {
File file = new File(sigIRC.BASEDIR+"tmp"); File file = new File(sigIRC.BASEDIR+"tmp_profile");
try { try {
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=retrievedata&name="+username.toLowerCase()),file); org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=retrievedata&name="+username.toLowerCase()),file);
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
@ -183,7 +183,7 @@ public class Profile {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"tmp"); String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"tmp_profile");
//System.out.println(Arrays.toString(data)); //System.out.println(Arrays.toString(data));
if (data.length>=18) { if (data.length>=18) {
int i=0; int i=0;

@ -145,9 +145,9 @@ public class SessionListWindow extends JFrame{
if (hashedPass.length()==0) { if (hashedPass.length()==0) {
hashedPass="none"; hashedPass="none";
} }
File file = new File(sigIRC.BASEDIR+"sigIRC/tmp.data"); File file = new File(sigIRC.BASEDIR+"sigIRC/tmp_session.data");
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=joinsession&name="+RabiRaceModule.module.myProfile.username+"&session="+session.id+"&password="+hashedPass),file); org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=joinsession&name="+RabiRaceModule.module.myProfile.username+"&session="+session.id+"&password="+hashedPass),file);
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/tmp.data"); String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/tmp_session.data");
if (data.length==1) { if (data.length==1) {
int errorCode = Integer.parseInt(data[0]); int errorCode = Integer.parseInt(data[0]);

Loading…
Cancel
Save