Author | Message | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ![]() I am making a server tool in Visual Basic 2010 and I need help with the coding part of it. I want to use this to study the code so if someone can help me and also add notes in it explaining whats going on with the code that would be great and I will give you the credit for it. This is for my own use not to release to the public. this is my current look for it:
|
| ![]()
Ok, so what you want to do is this. ServerStartInfo as ProcessStartInfo = new ProcessStartInfo("java", "-Xmx3G -Xms2G -jar " & JarFileLocation & " nogui -nojline") InputStreamWriter as StreamWriter = ServerProcess.StandardInput Then you can use InputStreamWriter.WriteLine(Command) to send commands. InputStreamWriter.WriteLine("Stop") Heres a command list if needed. What i would do is create a Server Manager class so you could manage more then one server. You could also easily change without having to modify the whole program. You can also raise events for when a server disconnects, starts, and several status stuff like a player list included in the class. Then even farther to character information. --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() Yeah I have NO idea what to do with that stuff except for the sending commands. Would you mind doing the rest of the coding for me? I have the getting file dir part of it done (thats all I can get to work right). I can send you the files from skype or something
|
| ![]() nah, its pretty self explainitory. ServerStartInfo as ProcessStartInfo = new ProcessStartInfo("java", "-Xmx3G -Xms2G -jar " & JarFileLocation & " nogui -nojline") InputStreamWriter as StreamWriter = ServerProcess.StandardInput Use this when you use something like Connect(JarLocation) but make sure you can access the ServerStartInfo and the InputStreamWriter outside of that sub. Then you can make a sub like SendCommand(Message) InputStreamWriter.WriteLine(Message) --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() Wildsurvival posted: (20th May 2012, 04:54 pm) Whats the ServerProcess in the StreamWriter though? and how do I start the server from the button?
|
| ![]() Whoops i forgot. ServerProcess as Process = Process.Start(ServerStartInfo) --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
| |