Jump to content

qubits

Members
  • Content Count

    105
  • Joined

  • Last visited

Posts posted by qubits


  1. GStack,LocalAddress does not work on Android.

     

    I am already getting WifiManager to obtain a lock, so I pulled the ip out of it.

     

        info := fWifiManager.getConnectionInfo;
        ip := MakeDWordIntoIPv4Address(info.getIpAddress);
        fIp:=ip;

     

    works perfect but all backwards.

    looked but, is there another routine i can run the longword thru before converting to a string or something??

     

    sorry, thanks..

     

    q


  2. procedure TForm1.serverExecute(AContext: TIdContext);
    var
      clients: tlist;
      i: integer;
      messaggioprelevato, FileName: string;
      FileStreamIn: TFileStream;
    begin
      messaggioprelevato := AContext.Connection.IOHandler.ReadLn;
      // send this magic string just before you send file stream
      if messaggioprelevato <> '!FILE#' then
      begin
        clients := Server.Contexts.LockList;
        try
          for i := 0 to connessi - 1 do
            TIdContext(clients.Items[i]).Connection.IOHandler.WriteLn
              (messaggioprelevato);
        finally
          Server.Contexts.UnlockList;
        end;
    
      end
      else
      begin
        // recv file stream
        TThread.Synchronize(nil,
          procedure
          begin
            showmessage('Arriva qualcosa...');
            FileName := 'C:' //suspect drive name in Windows
          end);
    
        FileStreamIn := TFileStream.Create(FileName, fmCreate);
        try
          AContext.Connection.IOHandler.ReadStream(aFileStreamIn);
        finally
          FileStreamIn.Free;
        end;
      end;
    end;

    there, much better.. only gots notepad, not sure what the ++ is about..

    lol, completely untested i should have added..


  3. procedure TForm1.serverExecute(AContext: TIdContext);
    var
      clients: tlist;
      i: integer;
      messaggioprelevato, FileName: string;
      TFSFileIn: TFileStream;
    begin
      messaggioprelevato := AContext.Connection.IOHandler.ReadLn;
    //send this magic string just before you send file stream
    if messaggioprelevato <>'!FILE#' then
      begin
      clients := Server.Contexts.LockList;
    try
    for i := 0 to connessi - 1 do
      TIdContext(clients.Items[i]).Connection.IOHandler.WriteLn
      (messaggioprelevato);
    finally
      Server.Contexts.UnlockList;
    end;
    
    end else
       begin
      //recv file stream
      TThread.Synchronize(nil,
    procedure
    begin
      showmessage('Arriva qualcosa...');
      Filename := 'C:';
    end);
    
      TFSFileIn := TFileStream.Create(FileName, fmCreate);
    try
      AContext.Connection.IOHandler.ReadStream(TFSFileIn);
    finally
      TFSFileIn.Free;
    end;
    end;
    end;

    good luck..


  4. there's an open bracket on Synchronize

     

    Should be

    procedure TForm1.ServerExecute(AContext: TIdContext);
    var
      FileName: string;
      TFSFileIn: TFileStream;
    begin
      TThread.Synchronize(nil,
        procedure
        begin
          Label1.Caption := 'Arriva qualcosa...';
          Filename := Edit1.Text;
        end
      );
      TFSFileIn := TFileStream.Create(FileName, fmCreate);
      try
        AContext.Connection.IOHandler.ReadStream(TFSFileIn);
      finally
        TFSFileIn.Free;
      end;
    end;

     

    Indy's got nice FTP components, might be easier solution..


  5. 9 hours ago, MrCamarium said:

    TThread.Synchronize(nil, procedure begin Label1.Caption := 'Arriva qualcosa...'; Filename := Edit1.Text; end end;

    in above quoted, replace last end with )

    that's all i see..

     

    should note, i do believe serverexecute will be called multiple times until all data is received, depending on your file size it may be chopped up into smaller chunks, usually like 1500 byte or so, depends on routers and os configs.

     


  6. Just got the tournament mode working!

    Now it's SpaceBallz Tournamentz!!

     

    SpaceBallz

     

    Tournament server is a 3d windows app as well, maybe the 1st 3d server, idk..

    Just a very simple thing, used ICS and sever is also a leader board that displays top 12.

    Now you can re-purpose that old windows tab collecting dust.

     

    The game is using Indy, tested on my cheap android 10 tab that's permanently wired into my delphi..

     

    Not perfect, just fun stuff..

    Took me a bit, was busy busy and it may show a bit in the code, as i rated it pg-13, for language and drug use..

     

    edit, lines 117,118 in uSpaceBallzData pretty much sums up my existence and i bet you im not alone there.. 🙂

     

     

    have fun..

     

    ~q

     

    sbzSrv.jpg

    • Thanks 1

  7. On 2/27/2022 at 11:58 PM, psla314 said:

    I dont really want to use TText3D

    Had to drop it too, was bugging me out..

    If you want to spin the text with the cube, maybe just use a Timage3D and loose all the other layers..

    really should be TText3d then you can see all sides.

     

    I'm playing in 3d. Github here..


  8. a sorted list of users..

    just finished that.

    i just used a list, like  this..

    fGamerz:TList<tGamer>;

     

    and i sort em like this..

     

    procedure tGameData.SortGamerz;
    begin
    // sort gamerz by bestscore
    fGamerz.Sort(
     TComparer<TGamer>.Construct(
        function(const Left, Right: TGamer): Integer
        begin
          Result := Left.bestscore - Right.bestscore;
        end
      )
    );

    fGamerz.Reverse;
    end;

     

     

    should be finished in a day or so, then it'll all be up on my GitHub.

     

    ~q


  9. for me that unit is.

    unit memSortList;

    { Copyright (c) 2003. Danijel Tkalcec }

    {$A-}{$O-}

    (*
    This class (with it's source) is given as freeware,
    with no guarantees. If it doesn't work, or puts your
    computer to smoke, destroys your data or whatever,
    DON'T BLAME ME !

     

    It was part of his RemoteTools, which was remote control software, like vnc.

     

    I purchased that years ago, don't think it's around anymore.

     

    I haven't bothered to try to migrate it, there's been allot of changes and additions since it's creation.

    Make yourself a GitHub account and post the code there, it's free, or drag the file to the bottom which would attach it to your post.

    But sorry, no time right now, for this.

    ~q

     

     


  10. 54 minutes ago, Lindawb said:

    as you know vtString not supported after Delphi 2009

    this was in my help file for d11.

     

    function MakeStr(const Args: array of const): string;
    var
      I: Integer;
    begin
      Result := '';
      for I := 0 to High(Args) do
         with Args[I] do
            case VType of
              vtInteger:  Result := Result + IntToStr(VInteger);
              vtBoolean:  Result := Result + BoolToStr(VBoolean);
              vtChar:     Result := Result + VChar;
              vtExtended: Result := Result + FloatToStr(VExtended^);
              vtString:   Result := Result + VString^;
              vtPChar:    Result := Result + VPChar;
              vtObject:   Result := Result + VObject.ClassName;
              vtClass:    Result := Result + VClass.ClassName;
              vtWideChar: Result := Result + VWideChar;
              vtPWideChar: Result := Result + VPWideChar;
              vtAnsiString:  Result := Result + string(AnsiString(VAnsiString));
              vtUnicodeString:  Result := Result + string(UnicodeString(VUnicodeString));
              vtCurrency:    Result := Result + CurrToStr(VCurrency^);
              vtVariant:     Result := Result + string(VVariant^);
              vtWideString:  Result := Result + string(WideString(VWideString));
              vtInt64:       Result := Result + IntToStr(VInt64^);
      end;
    end;
    

     

    looks like it's still there to me..

     

     

×