Manipulowanie header przy wyświetlaniu MOTD

Jak widać MOTD jest cześcią CS’a która mnie bardzo interesuje co widać po ilości artykułów odnoszących się do tego tematu Tym razem zajmiemy się parametrem header funkcji show_motd ( http://amxx.pl/dokumentacja/f36/show-motd ). Jeśli nie podamy żadnej wartości w tym parametrze w nagłówku MOTD zostanie wyświetlona nazwa serwera. Sprawdzimy co stanie się kiedy zaczniemy „bawić” się tym parametrem. Najpierw spróbujmy wysłać show_motd z jak najdłuższym title.
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
/* Script generated by Pawn Studio */
#include <amxmodx>
#include <amxmisc></amxmisc></amxmodx>
#define PLUGIN "New Plugin"
#define AUTHOR "DarkGL"
#define VERSION "1.0"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "say /test" , "motd" );
}
public motd( id ){
new szTitle[ 512 ];
for( new iPosition = 0; iPosition < sizeof szTitle ; iPosition++ ){
szTitle[ iPosition ] = 'a';
}
szTitle[ charsmax( szTitle ) ] = '^0';
show_motd( id , "test" , szTitle );
}
/* Script generated by Pawn Studio */ #include <amxmodx> #include <amxmisc></amxmisc></amxmodx> #define PLUGIN "New Plugin" #define AUTHOR "DarkGL" #define VERSION "1.0" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd( "say /test" , "motd" ); } public motd( id ){ new szTitle[ 512 ]; for( new iPosition = 0; iPosition < sizeof szTitle ; iPosition++ ){ szTitle[ iPosition ] = 'a'; } szTitle[ charsmax( szTitle ) ] = '^0'; show_motd( id , "test" , szTitle ); }
/* Script generated by Pawn Studio */

#include 
#include 

#define PLUGIN	"New Plugin"
#define AUTHOR	"DarkGL"
#define VERSION	"1.0"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd( "say /test" , "motd" );
}

public motd( id ){
new szTitle[ 512 ];

for( new iPosition = 0; iPosition < sizeof szTitle ; iPosition++ ){
		szTitle[ iPosition ] = 'a';
	}

	szTitle[ charsmax( szTitle ) ] = '^0';

	show_motd( id , "test" , szTitle );
}
Co kończy się crashem cs’a i logiem z konsoli
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Host_Error: PF_MessageEnd_I: Refusing to send user message ServerName of 512 bytes to client, user message size limit is 192 bytes
Host_Error: PF_MessageEnd_I: Refusing to send user message ServerName of 512 bytes to client, user message size limit is 192 bytes
Host_Error: PF_MessageEnd_I:  Refusing to send user message ServerName of 512 bytes to client, user message size limit is 192 bytes
Tak więc title może mieć tylko 192 znaki. Po zmianie pluginu aby ustawiał tylko 192 znaki wszystko wyświetla się poprawnie niestety tytuł jest ucinany. 2016-02-06_00001

2 komentarzy o “Manipulowanie header przy wyświetlaniu MOTD

  1. Czy możesz zrobić plugin do cs 1.6 który będzie przywracał zbugowaną pakę. Czasami jest tak ze paka wpadnie w jakaś szczelinę i nie da się jej podnieść, jak byś zrobił tak że admin po przez menu wybiera gracza, ktory dostanie bombe to by było świetnie.

Dodaj komentarz

This site uses Akismet to reduce spam. Learn how your comment data is processed.