rian
18th December, 2001, 10:40 AM
Hi there,
I decided to try n recompile CSHP for my server as i know many of You guys have done. I managed all that without too much hazzle. But the thing is, i haven't been using CSHP for a while since it did crash my server the second someone connects if i don't remove some of the server-packages. I found this function in HackProtection.uc:
function bool xxValidSP(string zzPackname)
{
local int zzp;
if (zzMyPacks == "")
zzMyPacks = Caps(ConsoleCommand("get engine.gameengine serverpackages"));
zzp = instr(zzMyPacks, Chr(34)$zzPackname$Chr(34));
if (zzp == -1 || zzPackname ~= "BOTPACK")
return false;
return true;
}
Changed it to this:
function bool xxValidSP(string zzPackname)
{
local string zzUsedPack;
zzUsedPack = Caps(zzPackname);
if (zzUsedPack == "BOTPACK")
return false;
return true;
}
Now it doesn't crash the server anymore :) But it doesn't check the players skin against server-packages any more either, just that the skin doesn't use textures from "Botpack.u"
Think the problem is that the return from the "get engine.gameengine serverpackages" command adds up to approx 1100 chars in my case including the quotes, commas and parenthesis's. I've read that string variables are dynamically allocated in size but to which extent? Even when exceeding 1024 chars? Any idea how to modify that code-snippet to be able to check against the server's packages also?
I apologise in advance if i'm way off here or if it sounds too trivial but this is my first time ever venturing into UC-scripting:)
I decided to try n recompile CSHP for my server as i know many of You guys have done. I managed all that without too much hazzle. But the thing is, i haven't been using CSHP for a while since it did crash my server the second someone connects if i don't remove some of the server-packages. I found this function in HackProtection.uc:
function bool xxValidSP(string zzPackname)
{
local int zzp;
if (zzMyPacks == "")
zzMyPacks = Caps(ConsoleCommand("get engine.gameengine serverpackages"));
zzp = instr(zzMyPacks, Chr(34)$zzPackname$Chr(34));
if (zzp == -1 || zzPackname ~= "BOTPACK")
return false;
return true;
}
Changed it to this:
function bool xxValidSP(string zzPackname)
{
local string zzUsedPack;
zzUsedPack = Caps(zzPackname);
if (zzUsedPack == "BOTPACK")
return false;
return true;
}
Now it doesn't crash the server anymore :) But it doesn't check the players skin against server-packages any more either, just that the skin doesn't use textures from "Botpack.u"
Think the problem is that the return from the "get engine.gameengine serverpackages" command adds up to approx 1100 chars in my case including the quotes, commas and parenthesis's. I've read that string variables are dynamically allocated in size but to which extent? Even when exceeding 1024 chars? Any idea how to modify that code-snippet to be able to check against the server's packages also?
I apologise in advance if i'm way off here or if it sounds too trivial but this is my first time ever venturing into UC-scripting:)