MantisBT - Soldat Dedicated Server
View Issue Details
0000035Soldat Dedicated ServerScripting Corepublic2011-09-17 18:492011-09-18 14:31
DorkeyDear 
Shoozza 
normalminoralways
resolvedfixed 
x86Windows7
2.7.0 
2.7.1 
0000035: BotChat on invalid player ids
Calling BotChat on certain player ids will either do no action, throw an exception, or have a bot with a blank name speak.
procedure OnPlayerSpeak(const Id: byte; const Text: string);
var
    i: integer;
begin

    if (Text = 'add5') then begin
        for i := 1 to 5 do
            Command('/addbot5 Boogie Man');
        exit;
    end;

    for i := 0 to 255 do begin
        try
            BotChat(i, 'BotChat FTW! i=' + InttoStr(i));
            WriteLn('no exception: i=' + InttoStr(i));
        except
            WriteLn('EXCEPTION @ i=' + InttoStr(i) + ' | ' + ExceptionToString(ExceptionType, ExceptionParam));
        end;
    end;

end;
Results from script provided here. Note that this does vary from time to time for some ids.

0,1(self),2-32(non-existing valid id),33-92,94,96,98,99,101-123,128-145,155,156,164-168,185-188,190,191,196,198: no action
2(bot): speaks, includes text in console
93,95,97,194,199: bot with blank name speaks, includes text in console
100,124-127,146-154,157-163,169-184,189,192,193,195,197,200-255: "Exception: Access violation at address 004056C3 in module 'soldatserver.exe'. Read of address 00000039" (address may vary)

Behavior after id 32 seems pretty consistent, but not 100% consistent. In a different test, some things varied:
128: bot with blank name speaks (seems more probable than no action)
161-162: bot with blank name speaks (seems less probable than no action)
No tags attached.
Issue History
2011-09-17 18:49DorkeyDearNew Issue
2011-09-18 14:31ShoozzaStatusnew => resolved
2011-09-18 14:31ShoozzaFixed in Version => 2.7.1
2011-09-18 14:31ShoozzaResolutionopen => fixed
2011-09-18 14:31ShoozzaAssigned To => Shoozza

There are no notes attached to this issue.