Lolunio to dobrze wytłumaczył, ale jednak chyba lepiej pousuwać sobie CVARy, niż je ukrywać.
Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
TriDi21
Rejestracja: 04.07.2013Aktualnie: Nieaktywny
Poza forum Ostatnio: 29.01.2014 17:38




Statystyki
- Grupa: Użytkownik
- Całość postów: 4
- Odwiedzin: 1 168
- Tytuł: Nowy
- Wiek: Wiek nie został ustalony
- Urodziny: Data urodzin nie została podana
-
Płeć
Mężczyzna
-
Lokalizacja
Tam Daleko
Kontakt
#555692 SZ_GetSpace: overflow on
Napisane przez Droso
w 16.07.2013 11:43
#555665 SZ_GetSpace: overflow on
Napisane przez Rivit
w 16.07.2013 08:35
KOMUNIAKTY BŁEDÓW
- SZ_GetSpace: overflow on Client Datagram WARNING: msg overflowed for nickname
- SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Reliable Datagram
- SZ_GetSpace: overflow on SVC_RuleInfo
- SZ_getspace: overflow on netchan->message
Błąd pojawia się gdy serwer operuje zbyt dużą ilością CVARów (są one tworzone przez pluginy, im więcej pluginów bądź im bardziej rozwinięte/ciężkie pluginy) . Zapytanie serwera z zewnątrz nie może przekraczać 2048 bajtów dlatego też informacje przesyłane nie powinny mieć więcej niż ta wartość (nie tylko CVARy ale także informacje HUD, itp).
- By pozbyć się tego błędu trzeba zoptymalizować ilość pluginów lub ten który jest ciężki i powoduje ten problem.
- Sporo osób też po prostu ignoruje ten problem.
- Można skorzystać też z pluginu który ukryje CVARY (które zdefiniujemy) i doda nam przez to miejsce dla nowych:
#include amxmodx
#define VERSION "0.1.0"
new g_szLogFile[64];
public plugin_init()
{
register_plugin("No See Vars", VERSION, "ConnorMcLeod");
get_localinfo("amxx_logs", g_szLogFile, charsmax(g_szLogFile));
add(g_szLogFile, charsmax(g_szLogFile), "/no_see_vars.log");
}
public plugin_cfg()
{
new szConfigFile[128];
get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile));
add(szConfigFile, charsmax(szConfigFile), "/nsv.cfg");
new fp = fopen(szConfigFile, "rt");
if( !fp )
{
return 0;
}
new szText[256], szCvar[128], szFlags[4];
while( !feof(fp) )
{
fgets(fp, szText, charsmax(szText));
trim(szText);
if(!szText[0] || szText[0] == ';' || szText[0] == '#' || (szText[0] == '/' && szText[1] == '/'))
{
continue;
}
parse(szText, szCvar, charsmax(szCvar), szFlags, charsmax(szFlags));
SetCvarFlags(szCvar, str_to_num(szFlags));
}
fclose(fp);
return 1;
}
SetCvarFlags( const szCvar[] , const iFlags = 0 )
{
new pCvar = get_cvar_pointer(szCvar);
if( pCvar )
{
new iOldFlags = get_pcvar_flags(pCvar);
if( iFlags != iOldFlags )
{
new fp = fopen(g_szLogFile, "at");
fprintf(fp, "^nSetting cvar ^"%s^" flags to %s^n", szCvar, Util_FCVAR(iFlags));
fprintf(fp, "Previous ^"%s^" flags were %s^n", szCvar, Util_FCVAR(iOldFlags));
fclose(fp);
set_pcvar_flags( pCvar, iFlags );
}
return 1;
}
return 0;
}
Util_FCVAR( const fCvar )
{
new szFlags[256], n;
if( fCvar & FCVAR_ARCHIVE ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_ARCHIVE | ");
if( fCvar & FCVAR_USERINFO ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_USERINFO | ");
if( fCvar & FCVAR_SERVER ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_SERVER | ");
if( fCvar & FCVAR_EXTDLL ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_EXTDLL | ");
if( fCvar & FCVAR_CLIENTDLL ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_CLIENTDLL | ");
if( fCvar & FCVAR_PROTECTED ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_PROTECTED | ");
if( fCvar & FCVAR_SPONLY ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_SPONLY | ");
if( fCvar & FCVAR_PRINTABLEONLY ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_PRINTABLEONLY | ");
if( fCvar & FCVAR_UNLOGGED ) n += formatex(szFlags[n], charsmax(szFlags)-n, "FCVAR_UNLOGGED | ");
if( szFlags[0] ) szFlags[n-2] = 0;
else szFlags = "0";
return szFlags;
}
oraz plik konfiguracji który wrzucamy do amxmodx/configs/ nsv.cfg
// THIS FILE MUST BE PLACED IN YOUR <mod>/addons/nsv DIRECTORY (i.e., cstrike/addons/nsv) // // One entry per line, in one of the following formats... // FORMAT: cvarname // FORMAT: cvarname flag // FORMAT: cvarname "value" flag // // (no flag will default to a flag value of 8, which is generally the value that should be used to hide a cvar). // Other values are provided for more advanced usage... // // 1 = FCVAR_ARCHIVE set to cause it to be saved to vars.rc // 2 = FCVAR_USERINFO changes the client's info string // 4 = FCVAR_SERVER notifies players when changed // 8 = FCVAR_EXTDLL defined by external DLL // 16 = FCVAR_CLIENTDLL defined by the client dll // 32 = FCVAR_PROTECTED It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value // 64 = FCVAR_SPONLY This cvar cannot be changed by clients connected to a multiplayer server. // 128 = FCVAR_PRINTABLEONLY This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). // 256 = FCVAR_UNLOGGED If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log // // * Desired flag values for each cvar should be added together to create a single value. // * Any changes/additions to the nsv.cfg file will require a map change before they take effect. // * Any deletions from the nsv.cfg file will require a server restart before they take effect. // * Values can also be assigned via the third format approach listed above. Quotes around the value are required! // // sample values - add or remove as you see fit, based on cvars you want to hide from the public. sv_accelerate sv_airaccelerate sv_airmove sv_allowupload sv_bounce sv_clienttrace sv_clipmode sv_stepsize sv_stopspeed sv_wateraccelerate sv_waterfriction edgefriction pausable
i dodajemy więcej cvarów które chcemy ukryć.
#555920 SZ_GetSpace: overflow on
Napisane przez Rivit
w 17.07.2013 06:47
usuwając cvary tracisz możliwość szybkiej konfiguracji. Coś za coś.
Ale taki cvar np.
cvar_proporcja_poziomu = 30
można usunąć bo on występuje tylko jeden raz w kodzie.
Dokładnie tu:
public PobierzDoswiadczeniePoziomu(poziom) return power(poziom, 2)*get_pcvar_num(cvar_proporcja_poziomu);
A to z kolei można zastąpić tym:
public PobierzDoswiadczeniePoziomu(poziom) return power(poziom, 2)*30;
I już jeden cvar z głowy. Ale jeśli dany cvar występuje w kodzie dużo razy to nie radze go usuwać i podmieniać wartości bo to dużo pracy.
#559816 Proszę o : Modyfikacje KillStreak
Napisane przez Mr. Dziwny
w 31.07.2013 01:43
- AMXX.pl: Support AMX Mod X i SourceMod
- → Przeglądanie profilu: Reputacja: TriDi21
- Regulamin


Dodatki SourceMod



Moja zawartość

