Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from globalvars import *
- import os
- import lib.nbpoll as subp
- import server.main as web
- # First navigate into the bin folder.
- import subprocess
- servDir = os.getcwd()
- servDir = os.path.join(servDir, 'bin')
- os.chdir(servDir)
- # Launch the server binary.
- execLine = 'java -Xms1024M -Xmx1024M -jar minecraft_mod.jar nogui'
- servProc = subp.Popen(execLine, stdin = subp.PIPE, stdout = subp.PIPE, stderr=subp.PIPE)
- # Initialize the server thread.
- thrWeb = web.ServerThread(4931)
- thrWeb.start()
- # Main Loop
- while (not servProc.poll()):
- readBuffer = str.strip(subp.recv_some(servProc))
- print readBuffer
- if(thrWeb.isConnected()):
- thrWeb.send(readBuffer)
- # Make stdin a non-blocking file.
- #text = p.stdout.read()
- #p.wait()
- #print text
- #@echo off
- #java -Xms1024M -Xmx1024M -jar Minecraft_Mod.jar nogui
- #pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement