Hallo,
ich bekomm jetzt 67108864, Car.Munition ist aber 10. Hier der Code:
Delphi-Quellcode:
procedure TForm1.ServerExecute(AThread: TIdPeerThread);
var Big: Integer;
RecInfos: TMemoryStream;
Test: Integer;
begin
Big := Athread.Connection.ReadInteger;
RecInfos := TMemoryStream.Create;
Athread.Connection.ReadStream(RecInfos, Big);
RecInfos.Position:=0;
RecInfos.Read(test, sizeof(test));
Menup.Caption := IntToStr(Test);
recinfos.Free;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
Var Infos: TMemoryStream;
begin
Infos := TMemoryStream.Create;
Infos.WriteBuffer(Car.Munition, SizeOf(Car.Munition));
Client.WriteInteger(SizeOf(Car.Munition));
Client.WriteStream(Infos,true,True,0);
infos.Free;
end;