mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* python script to generate cpp file with BareDistro content poltool cmd to generate the files * updated baredistro, fixed compilation * fix warning, ignore autogenerated file in stylechecker * test for pol? uoconvert got a new argument outdir for the cfg file output single thread decay has now a upper limit of sleeptime fixed that the exit_code can only get worse basic files for core testing in testsuite added a not really nice way to set it up via ctest integrated in CI with upload of log output * testenv * update poltool filegeneration to c++17 * first real tests * first npc test * equip a backpack and test a bit aos props * fixed early returns
61 lines
1.2 KiB
PHP
61 lines
1.2 KiB
PHP
use uo;
|
|
use os;
|
|
|
|
function account_test()
|
|
syslog("account_test..");
|
|
var success:=1;
|
|
|
|
var a:=CreateAccount("te st","pass",1);
|
|
if (a)
|
|
success:=0;
|
|
syslog("Could create account with whitespace: "+a);
|
|
endif
|
|
|
|
a:=CreateAccount("test","pass",1);
|
|
if (!a)
|
|
success:=0;
|
|
syslog("Could not create account: "+a);
|
|
endif
|
|
return success;
|
|
endfunction
|
|
|
|
function char_test()
|
|
syslog("char_test..");
|
|
var success:=1;
|
|
var a:=FindAccount("test");
|
|
if (!a)
|
|
a:=CreateAccount("test","pass",1);
|
|
syslog("need to create test account");
|
|
endif
|
|
a.addcharacter(0);
|
|
var char:=a.getcharacter(1);
|
|
if (!char)
|
|
success:=0;
|
|
syslog("Could not find char at slot 1");
|
|
return success;
|
|
endif
|
|
|
|
var backpack:=CreateItemAtLocation(0,0,0,0xE75);
|
|
var res:=EquipItem(char,backpack);
|
|
if (!res)
|
|
success:=0;
|
|
syslog("Failed to equip backpack "+backpack+" "+res);
|
|
return success;
|
|
endif
|
|
|
|
backpack.damage_cold_mod:=10;
|
|
if (char.damage_cold != 10)
|
|
syslog("failed to apply equipped aos prop");
|
|
success:=0;
|
|
return success;
|
|
endif
|
|
char.damage_cold_mod+=10;
|
|
if (char.damage_cold != 20)
|
|
syslog("failed to apply aos prop mod");
|
|
success:=0;
|
|
return success;
|
|
endif
|
|
|
|
|
|
return success;
|
|
endfunction
|