Raised This Month: $ Target: $400
 0% 

Server hangs at startup due to hltv socket


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sparkey
Senior Member
Join Date: May 2010
Old 07-11-2010 , 08:51   Server hangs at startup due to hltv socket
Reply With Quote #1

Hi,

hlds cstrike crashes at startup when connecting to a hltv through socket_open.

hlds starts up just fine as long as i dont have the hltv process running on the remote server. As soon as i start it and try to start hlds the server just hangs right after mapchange when it starts connecting to the hltv.

here is the amxx code im using

PHP Code:
#define HLTV                    "1.2.3.4"

new hltv_port;
new 
hltv_stat;
hltv_port FETCHING_A_PORT_FROM_MYSQL;

public 
hltv_reset()
{
    new 
socket 0;
    new 
error;
    new 
rconid[13];
    new 
rcv[256];
    new 
snd[256];
    new 
rconPass[32];

    
// Connect to server
    
socket socket_open(HLTVhltv_portSOCKET_UDPerror);
    if (
error != 0)
    {
        
server_print("[%s]%s HLTV Record :: Connection to HLTV %s:%s failed.",log_time(), SERVER_PREFIXHLTVhltv_port);
    } else {

    
//send challenge rcon and receive response
    
setc(snd,4,0xff);
    
copy(snd[4],255,"challenge rcon");
    
setc(snd[18],1,'^n');
    
socket_send(socket,snd,255);
    
socket_recv(socket,rcv,255);

    
// get rcon challenge number from response
    
copy(rconid,12,rcv[19]);
    
replace(rconid,255,"^n","");
    
rconPass "asdasd";

    
// set rcon command
    
setc(snd,255,0x00);
    
setc(snd,4,0xff);
    
format(snd[4],255,"rcon %s %s  stoprecording",rconid,rconPass);

    
// send rcon command and close socket
    
socket_send(socket,snd,255);
    
socket_close(socket);

No logs or anything :/

Thankful for all the help i can get on this issue.

Last edited by sparkey; 07-11-2010 at 11:22.
sparkey is offline
sparkey
Senior Member
Join Date: May 2010
Old 07-11-2010 , 10:50   Re: Server crash at startup due to hltv socket
Reply With Quote #2

After some commenting in the code it seems that the following row makes the server hang.

PHP Code:
socket_recv(socket,rcv,255); 
Any ideas?
sparkey 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 07:06.


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