Advertisement
cgrunwald

Untitled

Oct 21st, 2010
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. from globalvars import *
  2. import os
  3. import lib.nbpoll as subp
  4. import server.main as web
  5.  
  6. # First navigate into the bin folder.
  7. import subprocess
  8.  
  9. servDir = os.getcwd()
  10. servDir = os.path.join(servDir, 'bin')
  11. os.chdir(servDir)
  12.  
  13. # Launch the server binary.
  14. execLine = 'java -Xms1024M -Xmx1024M -jar minecraft_mod.jar nogui'
  15. servProc = subp.Popen(execLine, stdin = subp.PIPE, stdout = subp.PIPE, stderr=subp.PIPE)
  16.  
  17. # Initialize the server thread.
  18. thrWeb = web.ServerThread(4931)
  19. thrWeb.start()
  20.  
  21. # Main Loop
  22. while (not servProc.poll()):
  23.     readBuffer = str.strip(subp.recv_some(servProc))
  24.     print readBuffer
  25.     if(thrWeb.isConnected()):
  26.         thrWeb.send(readBuffer)
  27. # Make stdin a non-blocking file.
  28. #text = p.stdout.read()
  29. #p.wait()
  30. #print text
  31. #@echo off
  32. #java -Xms1024M -Xmx1024M -jar Minecraft_Mod.jar nogui
  33. #pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement