浏览代码

some more tweaking done

nossr50 14 年之前
父节点
当前提交
e5a97641b3
共有 1 个文件被更改,包括 10 次插入4 次删除
  1. 10 4
      vMinecraftUsers.java

+ 10 - 4
vMinecraftUsers.java

@@ -2,6 +2,7 @@ import java.io.*;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.logging.Level;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.logging.Logger;
+
 public class vMinecraftUsers {
 public class vMinecraftUsers {
     private static volatile vMinecraftUsers instance;
     private static volatile vMinecraftUsers instance;
     protected static final Logger log = Logger.getLogger("Minecraft");
     protected static final Logger log = Logger.getLogger("Minecraft");
@@ -41,11 +42,13 @@ public class vMinecraftUsers {
     public static void addUser(Player player){
     public static void addUser(Player player){
         FileWriter writer = null;
         FileWriter writer = null;
         String location = "vminecraftusers.txt";
         String location = "vminecraftusers.txt";
+        BufferedWriter bw = new BufferedWriter(new FileWriter(location, true));
         try {
         try {
-            writer = new FileWriter(location);
-            writer.append(player.getName()+"::::");
-        } catch (Exception e) {
-            log.log(Level.SEVERE, "Exception while trying to add user with writer to " + location, e);
+            bw.append(player.getName()+"::::\r\n");
+            bw.newLine();
+            bw.close();
+        } catch (IOException e) {
+            log.log(Level.SEVERE, "Exception while trying to add user with BufferedWriter to " + location, e);
 		} finally {
 		} finally {
 			try {
 			try {
 				if (writer != null) {
 				if (writer != null) {
@@ -63,4 +66,7 @@ public class vMinecraftUsers {
 		}
 		}
 		return instance;
 		return instance;
 	}
 	}
+    public static void getRow(){
+
+    }
 }
 }