mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* added api to get information of the internal state of the client lock cleanup * test cleanup added ability to ignore tests client communication can now be transfered to different scripts setup script handles now the initial connection * added api for open backpack and target/targetcoordinates * helper function to create account with char fixed signed char range added testclient timeout for initial connection * higher timeout
26 lines
559 B
Text
26 lines
559 B
Text
use os;
|
|
use uo;
|
|
|
|
program clientconn(con, testscript)
|
|
SetGlobalProperty("#clientcon", getpid());
|
|
while (1)
|
|
var ev:=Wait_For_Event(10);
|
|
if (!ev)
|
|
continue;
|
|
endif
|
|
if (ev.?todo)
|
|
var json:=PackJson(ev);
|
|
syslog(" to client: "+json,0);
|
|
con.transmit(json);
|
|
if (ev.todo=="exit")
|
|
break;
|
|
endif
|
|
elseif (ev.?ownership)
|
|
testscript:=ev.ownership;
|
|
else
|
|
syslog(" from client: "+ev,0);
|
|
var e:=UnpackJson(ev.value);
|
|
testscript.sendevent(e);
|
|
endif
|
|
endwhile
|
|
endprogram
|