hedgewars/runhelper.dpr
changeset 4 bcbd7adb4e4b
parent 1 30f2d1037d5d
equal deleted inserted replaced
3:ffe4ad26a64c 4:bcbd7adb4e4b
    45 end;
    45 end;
    46 
    46 
    47 procedure SendConfig;
    47 procedure SendConfig;
    48 begin
    48 begin
    49 Send('TL');
    49 Send('TL');
       
    50 Send('e$gmflags 1');
    50 Send('eaddteam');
    51 Send('eaddteam');
    51 Send('ename team "C0CuCKAzZz"');
    52 Send('ename team "C0CuCKAzZz"');
    52 Send('ename hh0 "Éîæûê"');
    53 Send('ename hh0 "Éîæûê"');
    53 Send('ename hh1 "¨æèê"');
    54 Send('ename hh1 "¨æèê"');
    54 Send('ename hh2 "¨æûê"');
    55 Send('ename hh2 "¨æûê"');
    80 Send('ebind 3 "timer 3"');
    81 Send('ebind 3 "timer 3"');
    81 Send('ebind 4 "timer 4"');
    82 Send('ebind 4 "timer 4"');
    82 Send('ebind 5 "timer 5"');
    83 Send('ebind 5 "timer 5"');
    83 Send('ebind mousel "put"');
    84 Send('ebind mousel "put"');
    84 Send('egrave "coffin"');
    85 Send('egrave "coffin"');
       
    86 Send('efort "Barrelhouse"');
    85 Send('ecolor 65535');
    87 Send('ecolor 65535');
    86 Send('eadd hh0 0');
    88 Send('eadd hh0 0');
    87 Send('eadd hh1 0');
    89 Send('eadd hh1 0');
    88 Send('eadd hh2 0');
    90 Send('eadd hh2 0');
    89 Send('eadd hh3 0');
    91 Send('eadd hh3 0');
   101 Send('ecolor 16776960');
   103 Send('ecolor 16776960');
   102 Send('eadd hh0 1');
   104 Send('eadd hh0 1');
   103 Send('eadd hh1 1');
   105 Send('eadd hh1 1');
   104 Send('eadd hh2 1');
   106 Send('eadd hh2 1');
   105 Send('eadd hh3 1');
   107 Send('eadd hh3 1');
       
   108 Send('efort Barrelhouse');
   106 end;
   109 end;
   107 
   110 
   108 procedure ParseCmd(s: shortstring);
   111 procedure ParseCmd(s: shortstring);
   109 begin
   112 begin
   110 case s[1] of
   113 case s[1] of
   117 const ss: string = '';
   120 const ss: string = '';
   118 var s: shortstring;
   121 var s: shortstring;
   119     i: integer;
   122     i: integer;
   120 begin
   123 begin
   121 i:= SDLNet_TCP_Recv(clsock, @s[1], 255);
   124 i:= SDLNet_TCP_Recv(clsock, @s[1], 255);
   122 if i = -2  then
   125 if i <= 0  then
   123    begin
   126    begin
       
   127    if i = -1 then exit;
   124    SDLNet_TCP_Close(clsock);
   128    SDLNet_TCP_Close(clsock);
   125    clsock:= nil;
   129    clsock:= nil;
   126    ss:= '';
   130    ss:= '';
   127    exit
   131    exit
   128    end;
   132    end;
   147   if clsock = nil then
   151   if clsock = nil then
   148      clsock:= SDLNet_TCP_Accept(servsock);
   152      clsock:= SDLNet_TCP_Accept(servsock);
   149   if clsock <> nil then
   153   if clsock <> nil then
   150      DoIt;
   154      DoIt;
   151   SDL_PollEvent(@event);
   155   SDL_PollEvent(@event);
       
   156   SDL_Delay(1)
   152 until event.type_ = SDL_QUITEV;
   157 until event.type_ = SDL_QUITEV;
   153 SDLNet_Quit;
   158 SDLNet_Quit;
   154 SDL_Quit
   159 SDL_Quit
   155 end.
   160 end.