View Single Post
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-17-2017 , 19:26   Re: Klippy's Webserver
Reply With Quote #28

Quote:
Originally Posted by PartialCloning View Post
The server still crashes a lot randomly while spamming refresh. Even if I have nothing running in the call back. It's as if the spamming slows down the server to the point where other modules malfunction (specifically on heavy forwards so I used server_frame to test it) causing the server to crash.
After many more tests I think the cause is an overflow somewhere?

Code:
#include <amxmodx> #include <webserver> new WSResponse:gBasicMOTD; public plugin_init() {     WS_RegisterRequestCallback("home", "OnWebServerHome");     WS_RegisterRequestCallback("motd", "OnWebServerHome");     gBasicMOTD = WS_CreateStringResponse("<!DOCTYPE HTML><html><head><meta charset='UTF-8'><title>Cstrike MOTD</title><style type='text/css'>body{background:#000;margin:8px;color:#FFB000;font:normal 16px/20px Verdana, Tahoma, sans-serif;}a{color:#FFF;text-decoration:underline;}a:hover{color: #EEE;text-decoration: none;}</style></head><body>You are playing Counter-Strike v1.6<br>Visit the official CS web site @<br>www.counter-strike.net<br><a href='http://www.counter-strike.net'>Visit Counter-Strike.net</a></body></html>");     WS_AddHeader(gBasicMOTD, WSH_ContentType, "text/html"); } public OnWebServerHome(WSConnection:Connection, const Method[], const URL[]) {     return WS_QueueResponse(Connection, WS_StatusCode_OK, gBasicMOTD); } public plugin_end() {     WS_DestroyResponse(gBasicMOTD); }

Expected Behavior: Default CS MOTD.

Actual Behavior: Displays random information at the beginning of the MOTD. Random information including timeleft and plugin names. Example: "19:54menu.amxxue%....etc" where 19:54 is the timeleft and it changes to whatever the timeleft is when I refresh the page, and menu.amxx is one of the default amx menu plugins. It also displays random cvars names and amx messages "This server is using AMX Mod X".

Quote:
19:56menu.amxxue% -- This server is using AMX Mod XCstrike MOTDYou are playing Counter-Strike v1.6
Visit the official CS web site @
www.counter-strike.net
Visit Counter-Strike.net
PartialCloning is offline