Changeset 52f778b in java-rpg-server
- Timestamp:
- Jun 11, 2010, 5:07:30 PM (14 years ago)
- Branches:
- master
- Parents:
- 4fbc6ff
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LostHavenServer.java
r4fbc6ff r52f778b 41 41 new PortalInterfaceThread(portalSocket.accept(), this).start(); 42 42 } 43 } catch(SocketException se) { 44 } catch(IOException ioe) { 43 }catch(SocketException se) { 44 se.printStackTrace(); 45 }catch(IOException ioe) { 45 46 ioe.printStackTrace(); 46 47 } … … 224 225 public void updateLog(String fileName, String message) { 225 226 try { 227 System.out.println(message); 226 228 PrintWriter out = new PrintWriter(new FileWriter(fileName, true)); 227 229 out.println(message); … … 237 239 238 240 public static void main(String[] args) { 239 new LostHavenServer(); 241 try { 242 PrintStream st = new PrintStream(new FileOutputStream("err.txt",true)); 243 System.setErr(st); 244 System.setOut(st); 245 246 new LostHavenServer(); 247 }catch (Exception e) { 248 e.printStackTrace(); 249 } 250 System.exit(0); 240 251 } 241 252 -
ProcessingThread.java
r4fbc6ff r52f778b 36 36 target = p.getTarget(); 37 37 38 //if((System.currentTimeMillis()-p.getLastMoved())>=10) {38 if((System.currentTimeMillis()-p.getLastMoved())>=10) { 39 39 if(Point.dist(loc, target) <= p.getSpeed()) 40 40 p.setLoc(target); … … 47 47 p.setLastMoved(System.currentTimeMillis()); 48 48 server.sendAll(MessageType.Movement, p.getName()+" "+p.getLoc().toString()); 49 //}49 } 50 50 } 51 51 } -
ServerThread.java
r4fbc6ff r52f778b 90 90 main.addOnlineList(user, client); 91 91 main.sendAll(MessageType.PlayerJoined, "Player " + player.getName() + " logged on"); 92 player.setLoc(main.map.startingLoc); 93 player.setTarget(new Point(player.getLoc().getX(), player.getLoc().getY())); 92 94 } 93 95 break;
Note:
See TracChangeset
for help on using the changeset viewer.