Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


DavidRM last won the day on July 14

DavidRM had the most liked content!

About DavidRM

  • Rank

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Tulsa, OK

Smart Mobile Studio

  • Edition

Recent Profile Visitors

382 profile views
  1. DavidRM

    Bugs and Features

    I just saw it happen when I selected a block of lines from the bottom up (instead of top down). -David
  2. DavidRM

    PixiJS v5

    How hard would it be to to get the PixiJS unit included with SMS updated to the latest release (v5)? Thanks! -David
  3. DavidRM

    Page Loading Issues with iPhone Browser

    That seems to have fixed it. Thanks! -David
  4. DavidRM

    Page Loading Issues with iPhone Browser

    I will try that. Thanks! -David
  5. DavidRM

    Page Loading Issues with iPhone Browser

    Those details I mentioned: I have to go into settings, general, iPhone storage, scroll down to safari, select website data. Then swipe left on [the domain name] and press delete Thoughts? -David
  6. I've had some players report that their iPhone browser has a problem loading my Paintball Net UI web page (which was built with SMS). That is, they have to do some kind of "delete data" for the URL, then the page will load again. I'll provide more details from one of the users when I get it. Any ideas? Thanks. -David
  7. DavidRM

    Promises revisited

    I've had to use promises extensively, especially for accessing MySql. I've used Warley Alex's posted promise unit instead of the RTL unit.
  8. DavidRM

    Node.JS Game Loop

    Here is my Smart Mobile Studio adaptation of the Node.JS "node-gameloop" module. My primary modification was some code to make the *next* interval line up with the desired number of ms per tick. I also tightened the window for choosing SetTimeout vs SetImmediate. I needed this to provide the beating heart of Paintball Net's simulation engine. Which, sure, only beats 10 times per second, but I wanted it to be as accurate as possible. 🙂 -David unit UPBNGameGameLoop; interface uses System.Types, System.Types.Convert, System.Time, System.Streams, System.Reader, System.Writer, System.Device.Storage, SmartNJ.System, SmartNJ.Streams, SmartNJ.Device.Storage, SmartNJ.Application, NodeJS.Core; var GameLoopActive: boolean; type TGameLoopCallback = procedure(delta: float); procedure StartGameLoop(update: TGameLoopCallback; msInterval: integer); procedure StopGameLoop; implementation procedure SetImmediate(const Entrypoint: TProcedureRef); external 'setImmediate'; const Seconds2Nano = 1e9; Nano2Seconds = 1 / Seconds2Nano; MS2Nano = 1e6; Nano2MS = 1 / MS2Nano; var _loopProc: TGameLoopCallback; _loopLengthHR: float; _loopPrevHR, _loopTargetHR: float; function GetHRTime: float; var hrTime: Variant; begin // I need a more up-to-date node to use the bigint() function. // asm // @Result = process.hrtime.bigint(); // end; asm @hrTime = process.hrtime(); end; Result := (hrTime[0] * Seconds2Nano) + hrtime[1]; end; procedure DoGameLoop; var now, delta: float; remaining: integer; begin if GameLoopActive then begin now := GetHRTime; if now >= _loopTargetHR then begin delta := now - _loopPrevHR; _loopPrevHR := now; _loopTargetHR := now + _loopLengthHR; if delta > _loopLengthHR then begin _loopTargetHR -= (delta - _loopLengthHR); end; _loopProc(delta * Nano2Seconds); end; if GameLoopActive then begin remaining := Trunc((_loopTargetHR - GetHRTime) * Nano2MS); if remaining >= 4 {16} then SetTimeout(DoGameLoop, remaining) else SetImmediate(DoGameLoop); end; end; end; procedure StartGameLoop(update: TGameLoopCallback; msInterval: integer); begin if not GameLoopActive then begin GameLoopActive := True; _loopLengthHR := msInterval * MS2Nano; _loopProc := update; _loopPrevHR := GetHRTime; _loopTargetHR := _loopPrevHR; SetImmediate(DoGameLoop); end; end; procedure StopGameLoop; begin GameLoopActive := False; _loopProc := nil; end; end.
  9. DavidRM

    How do I use Secure Websockets (WSS)?

    Alrighty then. I have a plan of attack now. THanks! -David
  10. DavidRM

    How do I use Secure Websockets (WSS)?

    Some of my users have connected with mobile devices. I've done it with a Google Pixel 2, though not for long stretches of time. I haven't heard of any dropping connections like that. IPhones and Android both.
  11. DavidRM

    How do I use Secure Websockets (WSS)?

    @lynkfs It sounds like I should get the Websocket upgraded to SSL before messing with the web page. But since the backend doesn't have a domain name, I'm not sure how the certificate would work. This part is all quite new to me. (Hell, before last fall NodeJS/Websocket was totally new to me). I'm kinda figuring out as I go.
  12. What I'm trying to do: Keep the web page for the app separate from the backend server for the app. Right now, I have the web page serving the client, which opens a Websocket (ws) to the backend server. I want to add HTTPS to the web page and I want to support secure Websockets to the backend. The first part seems pretty straightforward. I'll just get an SSL certificate for the web page. But... How does that affect the second part? Can I still open a non-secure WS connection from the client? Or will the browser balk? Also, what do I need to do to the backend server to get it to handle secure WS connections? Thanks! -David
  13. DavidRM

    Server Side file creation and writing to files

    Fine. Answer your own question. I actually *knew* this one... 😉
  14. DavidRM

    Request for feedback: Changing class names in the RTL

    This. ^^^^^ That said, I vote for the change. -David
  15. DavidRM

    UI layout

    Now add some TW3Labels to your layout demo and experience Real Pain. 😉