Показать сообщение отдельно
Старый 10.07.2010, 19:05   #16
Новичок
 
Регистрация: 09.07.2010
Сообщений: 19
Сказал Спасибо: 13
Имеет 1 спасибку в 1 сообщении
ampeg пока неопределено
По умолчанию

Код:
const
Nick='DamageControl';
var
 ListID:integer;
 Timer01: TTimer;
 TimerCyrcle:integer;

procedure SendMsg2(msg:string);
begin
buf:=#$4A; WriteD(0); WriteD(10); WriteS(''); WriteS(msg);
SendToClientEx(Nick);
end;


procedure Init;
begin
   Timer01:=TTimer.Create(nil); 
   Timer01.OnTimer:=@OnTimer01; 
   Timer01.enabled:=true; 
   Timer01.interval:=1000; 
   TimerCyrcle:=1;
end;

procedure OnTimer01(Sender: TObject);
begin
    case TimerCyrcle of
        1:begin   
            buf:=hstr('04 C9 2C 10 48 21 43 01 00 32 44 02 00 74 F2 FF FF 00');
            SendToServerEx(Nick);
            SendMsg2('Отправился пакет 1');
            SendToServerEx(Nick);
            SendMsg2('Еще раз отправился пакет 1, без задержки');
            Inc(TimerCyrcle);
        end;
        2:begin
             buf:=hstr('20 74 00 65 00 73 00 74 00 5F 00 73 00 65 00 72 00 76 00 65 00 72 00 5F 00 68 00 65 00 6C 00 70 00 65 00 72 00 5F 00 67 00 6D 00 6F 00 2E 00 68 00 74 00 6D 00 00 00');
            SendToServerEx(Nick);
            SendMsg2('Отправился пакет 2');
            Inc(TimerCyrcle);
         end; 
     3:begin
            buf:=hstr('21 6D 00 65 00 6E 00 75 00 5F 00 73 00 65 00 6C 00 65 00 63 00 74 00 3F 00 61 00 73 00 6B 00 3D 00 2D 00 31 00 26 00 72 00 65 00 70 00 6C 00 79 00 3D 00 31 00 32 00 00 00');
            SendToServerEx(Nick);
            SendMsg2('Отправился пакет 3 и таймер остановился');
            TimerCyrcle:=1;
            Timer01.enabled:=false;    
        end;    
        end;
      
    end;
procedure Free;
begin
  Timer01.free;
end;    
    

  begin    
                If (ConnectName=Nick) and FromServer and (pck[1] = #$11) then begin
                ListID:=ReadD(6);
                SendMsg2('Поймали пакет #$11');
                buf:=#$1F; WriteD(ListID); WriteD(1); WriteD(6577); WriteD(1);
                SendMsg2('Модифицировали пакет RequestBuyItem, ListID= ' + IntToStr(ListID));
                SendToServerEx(Nick);
                

             end;    
  end.
по логам доходит до конца, лист ИД получает правильно, реквестбай итем не отправляет.

Последний раз редактировалось ampeg, 10.07.2010 в 19:41.
ampeg вне форума   Ответить с цитированием