AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   HTTP:X (https://forums.alliedmods.net/showthread.php?t=282949)

Black Rose 05-21-2016 12:37

HTTP:X
 
11 Attachment(s)
HTTP:X

This plugin is an API to download files and web content to the server and/or send commands using the HTTP protocol through other plugins.
It is not used to send files to clients. That is impossible.

This plugin will always keep itself up to date by automatically downloading the latest version whenever a new one is available.
This means that you as a developer can be relatively sure that the client has the correct version if your plugin requires possibly new functions.
This can be disabled by cvar.

You can also use this plugin to update your own plugin automatically. I suggest adding a version check first. Examples can be found below.
Remember that floats in PAWN are not 100% accurate so integers or strings should be used for checking if there is a new version available.
Also remember that for your plugin to be updated (downloaded) it has to compile without custom includes on this site. So any external functions has to be included inside the source of your plugin.
This can also be disabled by cvar.

Examples


httpx.inc


Changelog


Additional notes:
I'm always open to suggestions, feedback and criticism. Please share your thoughts.

EFFx 05-21-2016 13:34

Re: HTTP:X
 
How i spoke

You're not human
You're a E.T
You're awesome

GordonFreeman (RU) 05-22-2016 05:01

Re: HTTP:X
 
Thanks. Its very useful for working with json api.

klippy 05-22-2016 08:02

Re: HTTP:X
 
Didn't really look through your code thoroughly, but I noticed something. Why do you use callfunc_* natives in your auto-updater? Fake natives were made to avoid that, I believe, and it would make it simpler and easier to remember.

Also, here's something interesting you might want to take a look at: https://github.com/rsKliPPy/webserver_amxx. You could look at it as a server for the client you just wrote here, so it would allow cross-server communication with HTTP, almost like JS/AJAX. I was just too lazy past couple of months to add some finishing touches and release it. :/ Tell me what do you think about it.

Great job overall!

Black Rose 05-22-2016 12:40

Re: HTTP:X
 
I use callfunc_* because it doesn't make a plugin fail if the function doesn't exist.
That way, people can build autoupdate into their plugins but not make HTTP:X a requirement for it to run, just an option.

Honestly, I don't understand what the webserver is for.
Communication plugins are already out there with less overhead and more flexibility. This was not made to compete with them.

klippy 05-22-2016 13:44

Re: HTTP:X
 
There is set_module_filter() if the API user decides he wants it optional when using natives.
Even if you want it to stay that way, you should wrap it into a stock functions in your include file. Along the lines of:
PHP Code:

stock HTTPX_AutoupdatePlugin(const file_id[], frequency) {
    if ( 
callfunc_begin("AutoupdatePlugin""httpx.amxx") == ) {
        
callfunc_push_int(get_plugin(-1));
        
callfunc_push_str(file_idfalse);
        
callfunc_push_int(frequency);
        
callfunc_end();
    }


and callfunc might be also bad for a reason that it relies on plugin name, that is "httpx.amxx". That's pretty hardcoded in my opinion.


I know this may be going a bit offtopic, but the webserver is basically a module for hosting a HTTP server on top of a HL server. It's a GoldSrc/HL counterpart of Asherkin's HTTP server. It lets one program dynamic web pages with Pawn, just like you would do with PHP for example. Just a fun project and I brought that up as your plugin revolves around HTTP.
Cross-server communication was just an example what those two could do if they got their powers combined.

Black Rose 05-22-2016 18:08

Re: HTTP:X
 
If a plugin was using the include there would be no point of autoupdating since it wouldn't pass the compiler. This is done intentionally.
I don't see how set_module_filter() would help in this case. I have never used that function and I'm having a hard time understanding what it actually does. If you can show me what your thoughts were I would appreciate it.

The hardcoded part I could edit easily. I'll do that tomorrow. Done
Thank you for your feedback.

I'm not very experienced in C(#/++). But as far as I can tell your HTTP server looks professional.

klippy 05-22-2016 19:03

Re: HTTP:X
 
Quote:

Originally Posted by Black Rose (Post 2421251)
If a plugin was using the include there would be no point of autoupdating since it wouldn't pass the compiler. This is done intentionally.
I don't see how set_module_filter() would help in this case. I have never used that function and I'm having a hard time understanding what it actually does. If you can show me what your thoughts were I would appreciate it.

Oh, I totally misunderstood how the plugin updater works. I just saw that it actually downloads files from the web compiler, that wasn't obvious at first. Now I see why you used callfunc instead of creating a native, that explains it.
But here's the question then - what if a plugin includes a non-standard include file? Just like your own? That could be solved by copying include file's contents onto the top of the code, but that's not really the solution.

Quote:

Originally Posted by Black Rose (Post 2421251)
Thank you for your feedback.

Anytime. I really like this plugin/API and I am happy to help at improving it.

Black Rose 05-23-2016 13:24

Re: HTTP:X
 
It depends on the include. Some things are just stupid to move into an include. ColorChat is a great example. One small, simple function that comes in too many different versions.
If people copied the code instead they would compile fine online and it wouldn't be so hard to find the right version of colorchat.

It got me thinking and I'm gonna create an add-on that will update plugins instead. I think that will be easier for everyone. But that still won't work with custom includes.

This can be solved by using another compiler with the proper includes but I will not use anything else than downloads from AM. Mainly because malicious code is rare and will be removed but also for the sake of the GPL being enforced here.

Shooting King 05-26-2016 15:19

Re: HTTP:X
 
Why don't you make a Multi-threaded solution too instead of entity thinks ? ThreadedSocks

Black Rose 05-26-2016 16:07

Re: HTTP:X
 
If I would include a module I want the whole thing to be a module instead.
But it's never too late. I will see what I can do with it when I get the time.

Shooting King 05-27-2016 12:44

Re: HTTP:X
 
It would be just a waste of time for you to code Multi threaded sockets again, + Httpx would be a specific module, and ThreadedSocks will get added into Amxmodx eventually, so since this is a new plugin, i recommend you to even support Threaded mode.

Black Rose 05-27-2016 16:18

Re: HTTP:X
 
What will be added is not interesting. 1.8.3 is not really being released anytime soon. You also have to concider the adaptation. To support all servers I'm aiming for 1.8.2 compatibility. That is still the last "stable" release.
But I've already said I will take a look at it.

Shooting King 05-28-2016 15:50

Re: HTTP:X
 
lmao xDD

Black Rose 05-29-2016 06:24

Re: HTTP:X
 
Quote:

Originally Posted by Shooting King (Post 2422224)
Why don't you make a Multi-threaded solution too instead of entity thinks ? MultiThreadedSocks

Okay. I finally got time to take a look at it. I came to a halt at a point where I realize there's no way of dynamically changing the size of the packets to receive which is a killer for me.
I use 1B when getting the header and scanning for chunk sizes. Other than that I use 64KB. If you want threaded sockets to be included, you have to change this.

Shooting King 05-29-2016 09:55

Re: HTTP:X
 
socket_recv_t( const iThreadHandle, const CallBackHandler[], const iRecvDataLen ); ? iRecvDataLen ?

How could you achieve "dynamically changing size" with default sockets ? Could you give me an example to understand your problem better and if possible references in your code ? I guess its better to discuss this issue in Module's thread ?

JusTGo 09-14-2016 09:16

Re: HTTP:X
 
i want to download a file for specific player is there is a way to have played index added to complete handler for now i m looping through all players to find the related player file:
PHP Code:

#include <amxmodx>
#include <httpx>
#include <json>

new g_ClientTrace[33]

public 
plugin_init() {
    
register_plugin("HTTP:X Searching chunks example""2.0""[ --{-@ ]");
}

public 
client_putinserver(id)
{
    new 
sBuffer[128], IP[24
    
    
get_user_ip(id,IP,charsmax(IP),1)
    
    
format(sBuffer127"http://ip-api.com/json/%s"IP)
    
    
g_ClientTrace[id] = HTTPX_Download(sBuffer_"Complete");
}

public 
client_disconnect(id)
{
    
g_ClientTrace[id] = 0
}

public 
Complete(DownloadIDError) {
    if ( 
Error )
    {
        
server_print("Something went wrong...")
        return;
    }
    
    
server_print("file download complete.")
    
    new 
buffer[1024];
    
HTTPX_GetData(buffercharsmax(buffer));
    
    
server_print("Recived Data:%s",buffer)
    
    new 
id GetTracedClient(DownloadID)
    
    if(!
is_user_connected(id))
        return
    
    new 
szName[32]
    
get_user_name(idszNamecharsmax(szName))
    
    new 
JsonHandle:jroot json_object()
    new 
error_buffer[32]
    
jroot json_loads(bufferJSON_REJECT_DUPLICATESerror_buffersizeof(error_buffer))
    
    if(
jroot == INVALID_JSON)
    {
        
server_print("Coudln't decode json.")
        return
    }
    
    new 
JsonHandle:data json_object()
    new 
country[24],city[24],isp[24]
    
    
data json_object_get(jroot"country")
    if(
data == INVALID_JSON)
    {
        
server_print("Coudln't find country.")
        return
    }
    
json_string_value(datacountrysizeof(country))
    
    
data json_object_get(jroot"city")
    if(
data == INVALID_JSON)
    {
        
server_print("Coudln't find city.")
        return
    }
    
json_string_value(datacitysizeof(city))
    
    
data json_object_get(jroot"isp")
    if(
data == INVALID_JSON)
    {
        
server_print("Coudln't find isp.")
        return
    }
    
json_string_value(dataispsizeof(isp))
    
    
destroy_json(data)
    
destroy_json(jroot)
    
    
server_print("name: %s | country:%s | city:%s | isp:%s",szName,country,city,isp)
}

GetTracedClient(DownloadID)
{
    new 
iPlayers32 ], iNumiTracedClient=0;
    
get_playersiPlayersiNum"ch" );
    for( 
0iNumi++ )
    {
        if(
g_ClientTrace[i] == DownloadID)
        {
            
TracedClient=g_ClientTrace[i]
            break
        }
    }
    
    return 
TracedClient



Black Rose 09-14-2016 15:36

Re: HTTP:X
 
Looping through indexes in this way is really no problem at all. I guarantee you that you will never notice a difference.

However I do like the idea of passing and retrieving custom data and I will add this as a feature unless problems arise. The question becomes "how much". Infinite would be nice but that will require dynamic arrays or tries.

A good option could be to enable an integer to be passed where you could supply an array index if you wanted to which would require some more work from the user but will create more freedom without all the back-end.

I will take a look at this ASAP.
Thank you for your suggestion.

klippy 09-14-2016 16:16

Re: HTTP:X
 
If you don't mind making 1.8.3 a requirement, you could use DataPacks, they were made exactly for that.

Black Rose 09-14-2016 17:02

Re: HTTP:X
 
I do mind. I'm not developing for unofficial releases. Especially if it doesn't update automatically.

klippy 09-14-2016 17:07

Re: HTTP:X
 
I guess you could emulate a datapack with a cellarray then, that should work.

JusTGo 09-14-2016 17:14

Re: HTTP:X
 
Quote:

Originally Posted by Black Rose (Post 2453990)
Looping through indexes in this way is really no problem at all. I guarantee you that you will never notice a difference.

However I do like the idea of passing and retrieving custom data and I will add this as a feature unless problems arise. The question becomes "how much". Infinite would be nice but that will require dynamic arrays or tries.

A good option could be to enable an integer to be passed where you could supply an array index if you wanted to which would require some more work from the user but will create more freedom without all the back-end.

I will take a look at this ASAP.
Thank you for your suggestion.

well i guess it better to pass the index directly into the handler when downloading 2 or more files btw MAX_DOWNLOAD_SLOTS 10 does that mean the plugin can't download 32 files when players connect at the same time ?

Freezo Begin 09-14-2016 17:22

Re: HTTP:X
 
JustGo,

PHP Code:

#include <amxmodx> 
#include <httpx> 
#include <json> 

new g_ClientTrace[33

new 
idCount;

public 
plugin_init() { 
    
register_plugin("HTTP:X Searching chunks example""2.0""[ --{-@ ]"); 


public 
client_putinserver(id

    new 
sBuffer[128], IP[24]  
    
    
get_user_ip(id,IP,charsmax(IP),1
    
    
format(sBuffer127"http://ip-api.com/json/%s"IP
    
    
g_ClientTrace[id] = HTTPX_Download(sBuffer_"Complete"); 


public 
client_disconnect(id

    
g_ClientTrace[id] = 
    idCount
--;


public 
Complete(DownloadIDError) { 
    if ( 
Error 
    { 
        
server_print("Something went wrong..."
        return; 
    } 
    
    
idCount++;
    
    new 
szName[32];
    
get_user_name(idCountszNamecharsmax(szName))
    

    
server_print("file download complete."
    
    new 
buffer[1024]; 
    
HTTPX_GetData(buffercharsmax(buffer)); 
    
    if(!
is_user_connected(idCount)) 
        return 
    
    new 
JsonHandle:jroot json_object() 
    new 
error_buffer[32
    
jroot json_loads(bufferJSON_REJECT_DUPLICATESerror_buffersizeof(error_buffer)) 
    
    if(
jroot == INVALID_JSON
    { 
        
server_print("Coudln't decode json."
        return 
    } 
    
    new 
JsonHandle:data json_object() 
    new 
country[24],city[24],isp[24
    
    
data json_object_get(jroot"country"
    if(
data == INVALID_JSON
    { 
        
server_print("Coudln't find country."
        return 
    } 
    
json_string_value(datacountrysizeof(country)) 
    
    
data json_object_get(jroot"city"
    if(
data == INVALID_JSON
    { 
        
server_print("Coudln't find city."
        return 
    } 
    
json_string_value(datacitysizeof(city)) 
    
    
data json_object_get(jroot"isp"
    if(
data == INVALID_JSON
    { 
        
server_print("Coudln't find isp."
        return 
    } 
    
json_string_value(dataispsizeof(isp)) 
    
    
destroy_json(data
    
destroy_json(jroot
    
    
server_print("name: %s | country:%s | city:%s | isp:%s",szName,country,city,isp



JusTGo 09-14-2016 17:41

Re: HTTP:X
 
Quote:

Originally Posted by Freezo Begin (Post 2454023)
JustGo,

PHP Code:

#include <amxmodx> 
#include <httpx> 
#include <json> 

new g_ClientTrace[33

new 
idCount;

public 
plugin_init() { 
    
register_plugin("HTTP:X Searching chunks example""2.0""[ --{-@ ]"); 


public 
client_putinserver(id

    new 
sBuffer[128], IP[24]  
    
    
get_user_ip(id,IP,charsmax(IP),1
    
    
format(sBuffer127"http://ip-api.com/json/%s"IP
    
    
g_ClientTrace[id] = HTTPX_Download(sBuffer_"Complete"); 


public 
client_disconnect(id

    
g_ClientTrace[id] = 
    idCount
--;


public 
Complete(DownloadIDError) { 
    if ( 
Error 
    { 
        
server_print("Something went wrong..."
        return; 
    } 
    
    
idCount++;
    
    new 
szName[32];
    
get_user_name(idCountszNamecharsmax(szName))
    

    
server_print("file download complete."
    
    new 
buffer[1024]; 
    
HTTPX_GetData(buffercharsmax(buffer)); 
    
    if(!
is_user_connected(idCount)) 
        return 
    
    new 
JsonHandle:jroot json_object() 
    new 
error_buffer[32
    
jroot json_loads(bufferJSON_REJECT_DUPLICATESerror_buffersizeof(error_buffer)) 
    
    if(
jroot == INVALID_JSON
    { 
        
server_print("Coudln't decode json."
        return 
    } 
    
    new 
JsonHandle:data json_object() 
    new 
country[24],city[24],isp[24
    
    
data json_object_get(jroot"country"
    if(
data == INVALID_JSON
    { 
        
server_print("Coudln't find country."
        return 
    } 
    
json_string_value(datacountrysizeof(country)) 
    
    
data json_object_get(jroot"city"
    if(
data == INVALID_JSON
    { 
        
server_print("Coudln't find city."
        return 
    } 
    
json_string_value(datacitysizeof(city)) 
    
    
data json_object_get(jroot"isp"
    if(
data == INVALID_JSON
    { 
        
server_print("Coudln't find isp."
        return 
    } 
    
json_string_value(dataispsizeof(isp)) 
    
    
destroy_json(data
    
destroy_json(jroot
    
    
server_print("name: %s | country:%s | city:%s | isp:%s",szName,country,city,isp



ty for try but i think that players can disconnect before they trigger client_putinserver ? also this isn't a solution if you try to get the data in the middle of game.

Black Rose 09-14-2016 17:54

Re: HTTP:X
 
Quote:

Originally Posted by JusTGo (Post 2454021)
well i guess it better to pass the index directly into the handler when downloading 2 or more files btw MAX_DOWNLOAD_SLOTS 10 does that mean the plugin can't download 32 files when players connect at the same time ?

It will que the files. It allows 10 simoultaneous downloads. As soon as one download is done and there are downloads left in the que they will be added automatically. Tomorrow I will test the time it takes to download 32 examples.



Edit:
It's done.
HTTPX_SetCustom(DownloadID, any:val)
any:HTTPX_GetCustom(DownloadID)

HTTP:X will update automatically, you don't need to download it manually.



I also tested the time it took to completely download a different number of files at the same time.
Don't run this yourself as I got banned doing it. Allthough I ran it using 1s delay between each run.
Code:
#include <amxmodx> #include <httpx> #define TimerStart()            tickcount() #define TimerMid(%0)            ( tickcount() - %0 ) #define TimerStop(%0)           ( %0 = tickcount() - %0 ) #define TimerDays(%0)           ( %0 / 86400000 ) #define TimerHours(%0)          ( %0 % 86400000 / 3600000 ) #define TimerMinutes(%0)        ( %0 % 3600000 / 60000 ) #define TimerSeconds(%0)        ( %0 % 60000 / 1000 ) #define TimerMilliseconds(%0)   ( %0 % 1000 ) new gNum, gCount, hTimer; public plugin_init() {     register_plugin("Time test", "1.0", "[ --{-@ ]");     set_task(10.0, "TestDownload"); } public TestDownload() {     gCount = 0;     gNum++;     new szURL[40];     hTimer = TimerStart();     for ( new i ; i < gNum ; i++ ) {         format(szURL, charsmax(szURL), "http://ip-api.com/json/%d.%d.%d.%d", random(256), random(256), random(256), random(256));         HTTPX_Download(szURL, _, "Complete");     } } public Complete(DownloadID, Error) {     if ( Error )         return;     if ( ++gCount != gNum )         return;     TimerStop(hTimer);     new szTimer[32];     TimerFormat(hTimer, szTimer, charsmax(szTimer), 2);     server_print("%-2.2d download%s: %s (%-4.4dms/download)", gNum, gNum == 1 ? " " : "s", szTimer, hTimer/gNum);     if ( gNum < 32 )         set_task(60.0, "TestDownload"); } stock TimerFormat(hTimer, output[], maxlen, mode = 1, bool:full = false) {     new len;         if ( full || TimerDays(hTimer) )         len = formatex(output, maxlen, mode == 1 ? "%02d:" : "%dd ", TimerDays(hTimer));     if ( full || ( len && mode == 1 ) || TimerHours(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d:" : "%dh ", TimerHours(hTimer));     if ( full || ( len && mode == 1 ) || TimerMinutes(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d:" : "%dm ", TimerMinutes(hTimer));             if ( full || ( len && mode == 1 ) || TimerSeconds(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%02d." : "%ds ", TimerSeconds(hTimer));     if ( full || ( len && mode == 1 ) || TimerMilliseconds(hTimer) )         len += formatex(output[len], maxlen - len, mode == 1 ? "%03d" : "%dms", TimerMilliseconds(hTimer)); }

Code:

1 download : 261ms (261ms/download)
2 downloads: 285ms (142ms/download)
3 downloads: 311ms (103ms/download)
4 downloads: 340ms (85ms/download)
5 downloads: 367ms (73ms/download)
6 downloads: 400ms (66ms/download)
7 downloads: 439ms (62ms/download)
8 downloads: 475ms (59ms/download)
9 downloads: 511ms (56ms/download)
10 downloads: 547ms (54ms/download)
11 downloads: 676ms (61ms/download)
12 downloads: 702ms (58ms/download)
13 downloads: 740ms (56ms/download)
14 downloads: 755ms (53ms/download)
15 downloads: 781ms (52ms/download)
16 downloads: 818ms (51ms/download)
At this point I was banned and the test ended.

As you can see from the data I managed to gather before getting banned the time per download decreased logarithmically.
When reaching the end of the maximum number of downloads (10) the que is activated for the 11th entry and the time per download gets a small bump but then settles down and passes the previous results.
It will probably continue to get more effective throughout. Theoretically the only bump should be at 10 downloads. After that the que will keep active at all times and shouldn't affect the time in a negative way anymore.
Without following the pattern too much, assuming it will stagnate at 50ms/download you're looking at 1.6s for 32 players.

Edit:
I ran a second test using my own HTTP server (about 2m away on a gigabit LAN) and the result was interesting.
For every download added ~10ms was added to the time. And after every tenth an extra 100ms was added. Most likely due to the que work.
This is more or less the time of the internal works of the plugin. The other factor being response time and connection speed to the server.
Code:

1  download : 209ms(~210) (209 ms/download) +~210
2  downloads: 220ms(~220) (110 ms/download) +~ 10
3  downloads: 228ms(~230) (76  ms/download) +~ 10
4  downloads: 240ms(~240) (60  ms/download) +~ 10
5  downloads: 250ms(~250) (50  ms/download) +~ 10
6  downloads: 261ms(~260) (43  ms/download) +~ 10
7  downloads: 269ms(~270) (38  ms/download) +~ 10
8  downloads: 280ms(~280) (35  ms/download) +~ 10
9  downloads: 290ms(~290) (32  ms/download) +~ 10
10 downloads: 299ms(~300) (29  ms/download) +~ 10
11 downloads: 409ms(~410) (37  ms/download) +~110
12 downloads: 418ms(~420) (34  ms/download) +~ 10
13 downloads: 429ms(~430) (33  ms/download) +~ 10
14 downloads: 440ms(~440) (31  ms/download) +~ 10
15 downloads: 449ms(~450) (29  ms/download) +~ 10
16 downloads: 459ms(~460) (28  ms/download) +~ 10
17 downloads: 469ms(~470) (27  ms/download) +~ 10
18 downloads: 478ms(~480) (26  ms/download) +~ 10
19 downloads: 488ms(~490) (25  ms/download) +~ 10
20 downloads: 499ms(~500) (24  ms/download) +~ 10
21 downloads: 609ms(~610) (29  ms/download) +~110
22 downloads: 619ms(~620) (28  ms/download) +~ 10
23 downloads: 629ms(~630) (27  ms/download) +~ 10
24 downloads: 639ms(~640) (26  ms/download) +~ 10
25 downloads: 648ms(~650) (25  ms/download) +~ 10
26 downloads: 658ms(~660) (25  ms/download) +~ 10
27 downloads: 670ms(~670) (24  ms/download) +~ 10
28 downloads: 679ms(~680) (24  ms/download) +~ 10
29 downloads: 689ms(~690) (23  ms/download) +~ 10
30 downloads: 699ms(~700) (23  ms/download) +~ 10
31 downloads: 809ms(~810) (26  ms/download) +~110
32 downloads: 818ms(~820) (25  ms/download) +~ 10


krizsi123 04-22-2018 15:44

Re: HTTP:X
 
Hi.

I tried to use it but I get this error:

L 04/22/2018 - 21:51:14: [AMXX] Plugin "test.amxx" failed to load: Plugin uses an unknown function (name "HTTPX_Download") - check your modules.ini.

Black Rose 04-28-2018 05:47

Re: HTTP:X
 
It seems like you're not running the core plugin.

Double-check that...
  • The httpx.amxx file is in the plugins folder.
  • You have a file called config/plugins.ini with a line that says "httpx.amxx" in it.
  • The plugin shows up when you write "amxx plugins" or "amx_plugins" in console.

RaZ_HU 07-15-2019 05:00

Re: HTTP:X
 
Hi!
I have been using this for a long time already, but it seems that your website has gone offline and I get this message in logs:
Quote:

[httpx.amxx] [HTTP:X] Socket error: Couldn't resolve hostname. (digitaldecay.eu)
Any plans to update it or I should just disable the check for new versions? :D

sky_pg 11-21-2019 17:21

Re: HTTP:X
 
Quote:

Originally Posted by RaZ_HU (Post 2659166)
Hi!
I have been using this for a long time already, but it seems that your website has gone offline and I get this message in logs:


Any plans to update it or I should just disable the check for new versions? :D

same here

JocAnis 11-22-2019 07:27

Re: HTTP:X
 
i also tryed this plugin some days ago and got the same error...guys go with curl :)

Black Rose 11-25-2019 13:44

Re: HTTP:X
 
You can disable the check, I don't see a reason for updating it in the near future.

karaulov 12-03-2019 04:24

Re: HTTP:X
 
"D:\CounterStrike\Server\cs_16_server\cstrike \addons\amxmodx\scripting\httpx.sma(706) : warning 233: symbol "socket_change" is marked as deprecated: Use socket_is_readable() instead"
how to fix this fatal error???

HamletEagle 12-04-2019 05:35

Re: HTTP:X
 
Quote:

Originally Posted by karaulov (Post 2675485)
"D:\CounterStrike\Server\cs_16_server\cstrike \addons\amxmodx\scripting\httpx.sma(706) : warning 233: symbol "socket_change" is marked as deprecated: Use socket_is_readable() instead"
how to fix this fatal error???

>warning
>fatal error

Pick one.

Black Rose 12-15-2019 10:33

Re: HTTP:X
 
Quote:

Originally Posted by karaulov (Post 2675485)
"D:\CounterStrike\Server\cs_16_server\cstrike \addons\amxmodx\scripting\httpx.sma(706) : warning 233: symbol "socket_change" is marked as deprecated: Use socket_is_readable() instead"
how to fix this fatal error???

I really don't care about 1.10 for 2 reasons.

1. Not a stable release. If you use this release you should be able to handle these warnings/errors yourself. If you are unable to do so, use the stable release.

2. For the idiotic choice of naming it 1.10.

RaZ_HU 01-23-2020 07:59

Re: HTTP:X
 
I get a new error that was never present before:
[httpx.amxx] [HTTP:X] Socket error: Couldn't connect to host. (proxycheck.io:80)

There was no change in the code neither in the server (same plugins for 1+ year).
Any ideas? :D


Website is up and working when opening manually, plugin also works on local windows server, but not on linux dedicated.

HamletEagle 01-23-2020 11:13

Re: HTTP:X
 
Do you have any iptables/firewall rules that could block the connection?

RaZ_HU 01-25-2020 05:35

Re: HTTP:X
 
Not that I am aware of.
Going to ask the host if the did add anything new.

I have tried with other website ( https://ip.teoh.io ) but got the same results.

lexzor 05-10-2021 13:34

Re: HTTP:X
 
the plugin is updating only when i upload it. i did a debug but didn t even read the version of plugin
PHP Code:

#include <amxmodx>

enum {
    
REQUEST_GET,
    
REQUEST_POST
}

native HTTPX_Download(const URL[], const Filename[] = "", const CompleteHandler[] = "", const ProgressHandler[] = ""Port 0RequestType REQUEST_GET, const Username[] = "", const Password[] = "", ... /* For possible future use */)
native HTTPX_GetData(data[], len)

#define AUTOUPDATE_FILE_ID "76775"
#define AUTOUPDATE_HOW_OFTEN 0 // Download immediately

new const VersionNum =      102
new gHTTPX true;

public 
plugin_init() {

    new 
temp[5];
    
num_to_str(VersionNumtemp[1], charsmax(temp));
    
temp[0] = temp[1];
    
temp[1] = '.';
    
    
register_plugin("HTTP:X Autoupdate example 2"temp"[ --{-@ ]");

    if ( 
gHTTPX )
        
HTTPX_Download("https://lexzor.warface.ro/AutoUpdate/Test/version.txt""dada.amxx""Complete"""80REQUEST_GET""""0, -1);
}

public 
Complete(DownloadIDError) {
    if ( 
Error )
    return;

    new 
temp[16];
    
HTTPX_GetData(tempcharsmax(temp));
    
server_print("%s"temp)
    if ( 
str_to_num(temp) > VersionNum )
    
UpdatePlugin();
}

UpdatePlugin() {
    new 
hHTTPX is_plugin_loaded("HTTP:X");
    
server_print("plugin loaded")
    if ( 
hHTTPX )
    {
        new 
filename[64];
        
get_plugin(hHTTPXfilenamecharsmax(filename));
        
server_print("%s"filename)
        if ( 
callfunc_begin("AutoupdatePlugin"filename) == ) {
            
server_print("auto update start")
            
callfunc_push_int(get_plugin(-1));
            
callfunc_push_str(AUTOUPDATE_FILE_IDfalse);
            
callfunc_push_int(AUTOUPDATE_HOW_OFTEN);
            
callfunc_end();
        }
    }
}

public 
plugin_natives()
set_native_filter("forwardNativeFilter");

public 
forwardNativeFilter(const Native[], IndexTrap) {
    
    if ( 
Trap )
    return 
PLUGIN_CONTINUE;

    if ( 
equal(Native"HTTPX_Download") || equal(Native"HTTPX_GetData") ) {
        
gHTTPX false;
        return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;



Th3822 05-11-2021 08:16

Re: HTTP:X
 
Quote:

Originally Posted by lexzor (Post 2746463)
the plugin is updating only when i upload it. i did a debug but didn t even read the version of plugin

Quote:

Originally Posted by lexzor (Post 2746463)
PHP Code:

        HTTPX_Download("https://lexzor.warface.ro/AutoUpdate/Test/version.txt""dada.amxx""Complete"""80REQUEST_GET""""0, -1); 


This plugin doesn't support HTTPS connections, if you really need HTTPS, check the cURL module.

loki_himself 10-31-2022 16:48

Re: HTTP:X
 
...


All times are GMT -4. The time now is 20:05.

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