qubits
Members-
Content Count
105 -
Joined
-
Last visited
Everything posted by qubits
-
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
-
flipped it around just now.. with this.. function SwapBytes(Value: LongWord): LongWord; type Bytes = packed array[0..3] of Byte; begin Bytes(Result)[0]:= Bytes(Value)[3]; Bytes(Result)[1]:= Bytes(Value)[2]; Bytes(Result)[2]:= Bytes(Value)[1]; Bytes(Result)[3]:= Bytes(Value)[0]; end; info := fWifiManager.getConnectionInfo; lw:=info.getIpAddress; lw:=SwapBytes(lw); ip := MakeDWordIntoIPv4Address(lw); fIp:=ip; fixed me up nicely.. i have already seen that getting ip from wifimanager is no longer appreciated.. so yes, i'll give that example a testing too, thanks!! Indy Packet Server - work in progress ~q
-
Cross platform way of waiting for multiple objects
qubits replied to FPiette's topic in RTL and Delphi Object Pascal
quite interesting.. WaitForMultipleObjects Linux Not sure what is implemented in delphi already for linux. TEvent for sure. pevents github -
TWSocket problem on Delphi Intraweb
qubits replied to Baxing's topic in ICS - Internet Component Suite
idk intraweb either, but looks like it's running in a browser. wouldn't that be considered a security flaw if we could privately fire up an ssl socket and start sending data out to some other server?? -
I need to merge these two codes but I have little programming practice.
qubits replied to MrCamarium's topic in Network, Cloud and Web
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.. -
I need to merge these two codes but I have little programming practice.
qubits replied to MrCamarium's topic in Network, Cloud and Web
yeah, but i had color.. -
I need to merge these two codes but I have little programming practice.
qubits replied to MrCamarium's topic in Network, Cloud and Web
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.. -
I need to merge these two codes but I have little programming practice.
qubits replied to MrCamarium's topic in Network, Cloud and Web
new to indy servers myself, currently working on one. with what i know now, i'd have to say, you can't. at a minimum you need some control mechanism to switch your server from string mode to recv filestream mode. the showmessage is a no,no Execute is not in the main thread. got some demos of rolling your own packets here. ~q -
Transfer a file from client to server (Delphi XE)
qubits replied to MrCamarium's topic in Network, Cloud and Web
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.. -
Transfer a file from client to server (Delphi XE)
qubits replied to MrCamarium's topic in Network, Cloud and Web
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. -
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
-
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..
-
emulation for the DEC VT's like VT200, Virtual Terminal. Old stuff.. use to repair them and fixed allot of pdp11's too, beautiful machines, lot's of gold.. 🙂
-
here's the unit i got, same author. looks like it anyway. if you're curious.. there's no vtWide anything in there.. memSortList.pas
-
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
-
most everything there is super old like me and now that i think about it, i was using RemoteTools with Delphi 5.
-
idk, i thought being fmx and no KeyPreview. looks like you override the method KeyDown of the form, goes there first then out as IsDialogKey or something like that. but i don't think you can tell which keyboard it comes from, you need to access the device directly using a provided api or something.
-
I should add in case you don't realize.. My unit says "freeware" yours does not, so you should not post it without prior consent from original copyright owner. original author is active here.
-
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
-
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..
-
Maybe, some processing in the fmx.form method KeyDown.
-
Showing a warning form to some users
qubits replied to Henry Olive's topic in RTL and Delphi Object Pascal
Multi-user DB App. If you don't need instant notification, could also add a User Messages table and add a record to each user that needs notification. Have the app check user messages once and awhile. Unless maybe you do want to create and display the forms in a loop and have them all on one screen? -
uh, i just threw up a little in my mouth, that nasty taste again. sorry, former borland stock owner.
-
pretty sure your integers are 24 bits, 3 bytes not 4. Reading words won't help. Need to read bytes and pad it.
-
Don't think it's in there. Property Store Maybe this helps.