Hallo liebe Entwickler Ecke,
ich schreibe gerade ein kleines programm, welches erstmal nur in einer Memo die Antwort eines Gameservers anzeigen soll.
Das sieht folgendermaßen aus:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IdBaseComponent, IdComponent, IdUDPBase, IdUDPClient, IdSocketHandle, StdCtrls;
type TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; IdUDPClient1: TIdUDPClient; procedure Button1Click(Sender: TObject); private public end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); var Buffer: Array [0..8192] of Byte ; i, j: integer; strTemp: string; str1: string; readAgain: boolean;
begin IdUDPClient1.Port := 28426; IdUDPClient1.Active := true; IdUDPClient1.BufferSize := 8192; IdUDPClient1.Send('\\status\\'); IdUDPClient1.ReceiveBuffer( Buffer, 8192); j := 0; for i := 0 to length(Buffer) do begin str1 := Char(Buffer[i]); strTemp := strTemp + str1; end; IdUDPClient1.Active := false; Memo1.Lines.Text := strTemp;
end; |
Nun wenn ich den Query "status" an den Server sende, bekomme ich nur "ÿÿÿÿdisconnectwlPwlÄ" zurück.
Was hat das zu bedeuten? Warum?
Danke schonmal im Voraus
Moderiert von
AXMD: Code- durch Delphi-Tags ersetzt