Raised This Month: $ Target: $400
 0% 

[DOTA2] Server crash if launched in thread (windows only issue)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IloveMusic
Junior Member
Join Date: Nov 2014
Old 01-21-2015 , 04:32   [DOTA2] Server crash if launched in thread (windows only issue)
Reply With Quote #1

Hello everyone, let me introduce my problem : if I will start my dota 2 server with srcds.exe it's OK.
But if I will start the server from any other env ( python or socket io ) I'm getting error and server shuts down.
How to fix that? I'm using subprocess.popen ( python 2.7 ).

Threaded logs : ( server crashes in 3-5 seconds )
PHP Code:
Opened server(27015) (threaded)
execcouldn't exec server.cfg
Unknown command "sm_flood_time"
Unknown command "sm_reserve_type"
Unknown command "sm_reserved_slots"
Unknown command "sm_hide_slots"
Unknown command "sm_chat_mode"
Unknown command "sm_timeleft_interval"
Unknown command "sm_trigger_show"
Server is hibernating
CTextConsoleWin32::GetLine: !GetNumberOfConsoleInputEvents
CTextConsoleWin32::GetLine: !GetNumberOfConsoleInputEventsAsync I/O disabled on dedicated server. 
Non-threaded logs: ( server is running )
PHP Code:
Opened server(27015) (threaded)
execcouldn't exec server.cfg
Unknown command "sm_flood_time"
Unknown command "sm_reserve_type"
Unknown command "sm_reserved_slots"
Unknown command "sm_hide_slots"
Unknown command "sm_chat_mode"
Unknown command "sm_timeleft_interval"
Unknown command "sm_trigger_show"
Server is hibernating
Connection to Steam servers successful, Game Server SteamID [A:X:XXX:XX] (XXXX).
CDOTAGCServerSystem - adding listener
    VAC secure mode is activated.
NOTE: Not updateing item schema. Using version 8F89695F; latest version is 727BA225
GC Connection established for server version 0 
P.S. This launch scripts works perfect 4 linux systems.

Last edited by IloveMusic; 01-21-2015 at 08:12. Reason: Information about linux
IloveMusic is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-21-2015 , 08:06   Re: [DOTA2] Server crash if launched in thread (windows only issue)
Reply With Quote #2

Your subprocess.Popen should have the command line parameters to launch srcds, and your working directory should be the folder where srcds is located (not strictly required but is easiest).

Do NOT use subprocess.PIPE in stdin or stdout in the Popen constructor since for some reason that never works with srcds:

PHP Code:
from subprocess import Popen
process 
Popen("srcds.exe -game dota"#add any additional command line parameters here
process.wait() 
Potato Uno is offline
IloveMusic
Junior Member
Join Date: Nov 2014
Old 01-21-2015 , 08:10   Re: [DOTA2] Server crash if launched in thread (windows only issue)
Reply With Quote #3

Quote:
Originally Posted by Potato Uno View Post
Your subprocess.Popen should have the command line parameters to launch srcds, and your working directory should be the folder where srcds is located (not strictly required but is easiest).

Do NOT use subprocess.PIPE in stdin or stdout in the Popen constructor since for some reason that never works with srcds:

PHP Code:
from subprocess import Popen
process 
Popen("srcds.exe -game dota"#add any additional command line parameters here
process.wait() 
Server starts. Map changes to dota. Everything with the start script is OK. But server fails after 3-6 seconds after the start.
And PIPE works well with srcds in linux. Windows prefer to give me screw errors.
PHP Code:
dota_process subprocess.Popen(argsbufsize=0cwd=dota_dir+'/'stdout=subprocess.PIPEstderr=subprocess.STDOUTstdin=subprocess.PIPEuniversal_newlines=True
IloveMusic is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-21-2015 , 11:03   Re: [DOTA2] Server crash if launched in thread (windows only issue)
Reply With Quote #4

Try:

PHP Code:
dota_process subprocess.Popen(argsbufsize=0cwd=dota_dir+'/'universal_newlines=True
In TF2 I just use simply:

PHP Code:
Popen("srcds.exe -game tf -maxplayers 32 +sv_pure 1 +sv_lan 0 +map mvm_decoy"
and it works fine (just the launch command only).
Potato Uno is offline
IloveMusic
Junior Member
Join Date: Nov 2014
Old 01-22-2015 , 07:25   Re: [DOTA2] Server crash if launched in thread (windows only issue)
Reply With Quote #5

Ok, it works. If I'm not using stdout I can launch server. But I'm not able to connect to it.
After this I launched server without python and successfully joined the game. Any suggestion?
IloveMusic is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-22-2015 , 11:05   Re: [DOTA2] Server crash if launched in thread (windows only issue)
Reply With Quote #6

Try using subprocess.Popen to open the batch file that launches your servers, as opposed to passing in the command line parameters directly.

So for tf2, it would be:

server = Popen("tf.bat")

Where tf.bat has the srcds command line parameters all in it. Maybe you have a dota.bat file inside the same folder as steamcmd is in.

All my servers launch perfectly fine in python (and python uses multiple threads to maintain each server), so I am not too sure why it's not working for you.
Potato Uno is offline
IloveMusic
Junior Member
Join Date: Nov 2014
Old 01-26-2015 , 03:08   Re: [DOTA2] Server crash if launched in thread (windows only issue)
Reply With Quote #7

Quote:
Originally Posted by Potato Uno View Post
Try using subprocess.Popen to open the batch file that launches your servers, as opposed to passing in the command line parameters directly.

So for tf2, it would be:

server = Popen("tf.bat")

Where tf.bat has the srcds command line parameters all in it. Maybe you have a dota.bat file inside the same folder as steamcmd is in.

All my servers launch perfectly fine in python (and python uses multiple threads to maintain each server), so I am not too sure why it's not working for you.
Ok, I'll give it a try, thx.
IloveMusic is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode