mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* each SpeechEvent needs to contain a copy of the speechtokens * added core changes * prevent memoryleak * add basic pol test * Remove extraneous prints in test * Address review comments - Refactor token encoding into a method --------- Co-authored-by: Kevin Eady <8634912+KevinEady@users.noreply.github.com>
18 lines
465 B
Text
18 lines
465 B
Text
use os;
|
|
use uo;
|
|
|
|
const SYSEVENT_SPEECH := 0x00000001;
|
|
|
|
program main(item)
|
|
RegisterForSpeechEvents( item, 12 );
|
|
while (1)
|
|
var ev := os::wait_for_event(30);
|
|
case(ev.type)
|
|
SYSEVENT_SPEECH:
|
|
var tokens := ev.tokens;
|
|
tokens.sort();
|
|
// This needs to match what's tested in test_client's say_something_with_tokens
|
|
PrintTextAbove(item, $"source=[item] text=[{ev.text}] tokens=[{tokens}]");
|
|
endcase
|
|
endwhile
|
|
endprogram
|