AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hlds freezes when connecting to hltv (https://forums.alliedmods.net/showthread.php?t=143428)

sparkey 11-19-2010 17:34

hlds freezes when connecting to hltv
 
Hello,

I got a big trouble at my hands and i have been looking for the problem for days now and don't know where to look next.

Nothing is reported the amx logs, neither hlds debug logs. I have checked the kernel, system logs and nothing there either.

The hlds process just freezes and gets timeout, not crashing just frozen at the state when connecting to the hltv. I have found that it is happening when connecting to the hltv to execute the command.

I have tried to disable iptabels (firewall) on all the servers to make sure that it is not the problem without luck.

It is not always happening, it happens for lets say 1 of 30 times but is getting really annoying to manually restart servers every hour.

Here is the code for the hltv function.

PHP Code:

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. Error: %s",log_time(), SERVER_PREFIXHLTVhltv_porterror);
    } 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 "xxxxxxxxx";

        
// 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);

        
server_print("[%s]%s HLTV Record :: Automatic recording now ending %s:%d.",log_time(), SERVER_PREFIXHLTVhltv_port);
    }


Thanks guys!

fysiks 11-19-2010 20:17

Re: hlds freezes when connecting to hltv
 
And if you connect your HLTV manually everytime?

sparkey 11-19-2010 21:15

Re: hlds freezes when connecting to hltv
 
Quote:

Originally Posted by fysiks (Post 1352655)
And if you connect your HLTV manually everytime?

Thx for your answer.

Hltv is connected to the server, its when authenticating and executing the command to the hltv that it freezes.

madeitout 11-20-2010 07:04

Re: hlds freezes when connecting to hltv
 
your server will hang if the server your connecting to with your socket is down or slow.
there is a modified version of hackziners sockets_hz module somewhere that will solve your dilemma

sparkey 11-20-2010 10:49

Re: hlds freezes when connecting to hltv
 
Quote:

Originally Posted by madeitout (Post 1352858)
your server will hang if the server your connecting to with your socket is down or slow.
there is a modified version of hackziners sockets_hz module somewhere that will solve your dilemma

Ahh thx :) Would it be enough to just replace the include the socket_hz module instead of the socket module or do you think i have to change any code?

sparkey 07-15-2011 13:28

Re: hlds freezes when connecting to hltv
 
Hi again,

This problem is still not solved :(

Is'nt hackziners modified version only for listening or is it also modified to solve my dilemma when opening a socket to send data to the hltv?

Best regards


All times are GMT -4. The time now is 11:28.

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