Raised This Month: $51 Target: $400
 12% 

[help] sockets_hz


Post New Thread Reply   
 
Thread Tools Display Modes
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 10-31-2010 , 11:00   Re: [help] sockets_hz
Reply With Quote #11

yeah i get ya and isse1 exolent is right with loopback as it was used by hackinzer in his irc server plugin but for me idk why it doesnt receive anything... i made it print as chat the info received, the plugin doesnt receive any packets for some reason
i tried making my hltv send rcon stuff to the server for testing...
__________________
okay
ARES[ro] is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-31-2010 , 13:01   Re: [help] sockets_hz
Reply With Quote #12

Quote:
Originally Posted by ARES[ro] View Post
yeah i get ya and isse1 exolent is right with loopback as it was used by hackinzer in his irc server plugin but for me idk why it doesnt receive anything... i made it print as chat the info received, the plugin doesnt receive any packets for some reason
i tried making my hltv send rcon stuff to the server for testing...
Make sure it was on the exact port as well.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 10-31-2010 , 13:11   Re: [help] sockets_hz
Reply With Quote #13

Yeah i did it was all on 27015 rcon_port and defined in the code
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <sockets_hz>

#define IP                  "0.0.0.0" 
#define PORT                27015
#define THINK_DELAY          0.01 
#define RECEIVE_DELAY          1.0 
#define BUFFERSIZE            512

new g_socket;
new 
g_entity;
public 
plugin_init() 
{
    
register_plugin("""-0.1""Plane Crash LOL");
    new 
error;
    
g_socket socket_listen(IPPORTSOCKET_TCPerror);
    if( 
error )
    {
        switch( 
error )
        {
            case 
1:        log_amx("Error creating a TCP socket to %s:%i"IPPORT);
            case 
2:        log_amx("Error resolving the hostname for %s:%i"IPPORT);
            case 
3:        log_amx("Error connecting a TCP socket to %s:%i"IPPORT);
        }                 
        return;
    }
    
    
socket_unblock(g_socket);
    
g_entity create_entity("info_target");
    if( 
is_valid_ent(g_entity) )
    {
        
entity_set_string(g_entityEV_SZ_classname"TCP_Socket_Reader");
        
entity_set_float(g_entityEV_FL_nextthinkget_gametime() + THINK_DELAY);
        
register_think("TCP_Socket_Reader""FwdThink");
    }
    else
    {
        
log_amx("Could not create TCP Socket Receiver entity.");
        
plugin_end();
    }
}

public 
plugin_end()
{
    if( 
g_socket )
        
socket_close(g_socket);
}

public 
FwdThink(entity)
{     
    if( 
entity != g_entity 
        return;         
    static 
socket;
    if( (
socket socket_accept(g_socket)) > )
    {
        
socket_unblock(socket);                 
        
set_task(RECEIVE_DELAY"TaskReceiveData"socket);
    }
    
entity_set_float(entityEV_FL_nextthinkget_gametime() + THINK_DELAY);
}


public 
TaskReceiveData(socket)
{
    new 
data[BUFFERSIZE]
    if(
socket_change(socket))
        
socket_recv(socketdataBUFFERSIZE)
    
client_print(0print_console"Reading socket %s:%i >>>[%s]"IPPORTdata)

__________________
okay

Last edited by ARES[ro]; 10-31-2010 at 13:14. Reason: addedcode
ARES[ro] is offline
issen1
Member
Join Date: Jan 2010
Old 11-02-2010 , 13:08   Re: [help] sockets_hz
Reply With Quote #14

Make sure your port isn't used by any other program. 27015 is likely the port your gameserver is running on, it it won't work with that one. Also connect the socket with the interface ip you want to listen on.

Furthermore, make sure no firewall is blocking any packets and check your routing.
__________________
greets (:
issen1 is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 11-03-2010 , 18:38   Re: [help] sockets_hz
Reply With Quote #15

Quote:
Originally Posted by issen1 View Post
Make sure your port isn't used by any other program. 27015 is likely the port your gameserver is running on, it it won't work with that one. Also connect the socket with the interface ip you want to listen on.

Furthermore, make sure no firewall is blocking any packets and check your routing.
ROFL thats why i even posted this thread LMAO!!!
Im trying to block rcon from certain ips that means i gota hook to the server port of course and its the same reason its not working...
and i need a way to do it no?
thanks for all ur posts but i was asking for that ...
__________________
okay
ARES[ro] is offline
issen1
Member
Join Date: Jan 2010
Old 11-04-2010 , 07:13   Re: [help] sockets_hz
Reply With Quote #16

You can't. Only one socket can listen to one port. You have to hook the rcon routine in the server dll.
__________________
greets (:
issen1 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 09:02.


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