Autor Beitrag
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: So 23.01.05 13:40 
also ich habe folgendes problem:

ich habe einen UDP server erstellt der daten von meiner eigene IP bekommt (UDP Server bekommt daten von Half-Life)
nun will ich an Halflife andere daten zurückschicken

der port ist 27012

ich bekomme die daten:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
var CHALLENGEsend: array[0..15] of byte =
     ($FF,$FF,$FF,$FF,$4A,$00,
      ord('C'),ord('H'),ord('A'),ord('L'),ord('L'),ord('E'),ord('N'),ord('G'),ord('E'),
      $00);

geschickt und will dann mit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
     ACCEPTsend: array[0..16] of byte =
      ($FF,$FF,$FF,$FF,$4B,$00,
       ord('A'),ord('C'),ord('C'),ord('E'),ord('P'),ord('T'),
       $00,$12,$34,$56,$78);


darauf antworten aber leider weiß ich nicht wie das ganze mit der komponente funktioniert (die ist totaler müll ;>)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.udp2UDPRead(Sender: TObject; AData: TStream;
  ABinding: TIdSocketHandle);
var d: array[0..8192-1] of byte;
    s: string;
begin
  adata.Read(d,8192);
  setlength(s,8192);
  copymemory(@s[1],@d[0],8192);
  if  copy(s,7,9) = 'CHALLENGE' then
  begin
    form1.caption := 'challenge send';
    udp2.SendBuffer('localhost',27012,ACCEPTsend,17);
  end else
   listbox1.items.add(copy(s,7,5));
end;


das problem ist das wenn ich udp2.sendbuffer amche mein eigener server die daten bekommt und nicht der client d.h. es ruft sich selbst auf

also kann mir jemand sagen wies richtig funzt oder ne andere UDP komponente geben wo ich direkt an clients daten senden kann?