|
Apologies yes! Mar_11_2023_hst.txt and Mar_12_hst.txt
I saw someone else had commented that maybe my time in hours is not 24 since you lose the 2am hour from daylight savings time. I think that may be the problem. i will post when i get a chance to look at it.
Thank you.
|
|
|
|
|
You provide to little information to be able to help. What data store are you using? How are the dates stored? In what time units you calculate (days, hours, seconds)? For instance from Mar 11, 2023 03:00:00 to Mar 12, 2023 03:00:00 there are only 23 hours so your system might say it's less than a day.
Having worked for a long time with time, my advice is to always use UTC. It's the only (almost) uniform time scale and computations to and from local time can be handled relatively easy.
Mircea
|
|
|
|
|
Mircea Neacsu wrote: always use UTC When I suggested that to the designers and team leaders driving the last commercial project that I worked on, the answer was, "No, we need to keep track of transactions by local time".
Fortunately the project was canned not long afterwards.
|
|
|
|
|
Richard MacCutchan wrote: we need to keep track of transactions by local time
Not surprised. I've seen the same attitude by one of the habituals in the lounge. People don't understand that local time is mostly an expression of political will rather than a time scale.Even with UTC some forget about the occasional leap second but at least Earth is not playing any political games.
Best put by Dr Who: Big ball of wibbly wobbly... time-y wimey... stuff.[^]
Mircea
|
|
|
|
|
That I can understand.
|
|
|
|
|
Hi Mircea,
I think you might be onto something here! I will check my code and probably even use UTC and end this little problem. Thank you.
|
|
|
|
|
As Mircea says, "always use UTC". The only time you need to convert it to local time is when you want to display it to one of those insignificant, and simple, blobs of protoplasm that inhabit the earth.
|
|
|
|
|
Looks like someone here doesn't like UTC and down-voted both my answer and yours.
Oh well, can't please everyone!
Mircea
|
|
|
|
|
I'm more interested in helping people than pleasing them. Probably one of the reasons I got in trouble at work.
|
|
|
|
|
I’m building a chart for my game I’m hoping it will help me understand various parts of the game and how they interact. Please forgive my newbish approach. Could you please take a look and tell what you think?
Raw collision detection->Optimised collision detection->Collision Detection events
Raw line of sight check->Optimised line of sight check->Los events
CD and Los events->Units ->Response
Factory algorithm-> spawn units
|
|
|
|
|
You will have to be more specific on what you would like checked, be specific on methods, show some code etc.
|
|
|
|
|
Ok. The variety of game objects in a strategy game is substantial. You have not only units and buildings but also projectiles, projectile explosions or impact representations etc. The question is do they all get the same treatment? I know they can’t be treated exactly the same all the way trough but I mean do they have an Update() function which is being called each frame? The only thing that has graphics changing and isn’t a game object is water animation, that must be the only item that should be treated differently, other than that it seems like everything should, on a shallow level, look the same, be in the same place and get modified using the same approach.
|
|
|
|
|
This is very broad, you need to break this down into way smaller chunks, design modules for each part i.e. building and line of sight, pathways and obstacles etc. etc.
Maybe follow the following link on where to start - WHERE TO START IN GAME DEVELOPMENT[^]
Quote: Many developers love games and want to build games. But game development is a vast ocean. There are so many aspects to developing a game that it's hard to understand where a game developer should even start.
One way to start building a game is by choosing how you will build it. Regardless of whether you're an indie developer or an established game development studio, there are 3 ways you can build a game.
|
|
|
|
|
You can't collide until something is moving. You can't move until you've "spawned". Line of sight is useless until you're "targeting" (firing or traveling to a destination). Things have a (natural) order. You're focusing on details without a bigger picture.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Context: Windows Server 2012 64 bit, everything else is 32 bit.
So, I have a very simple application using tcpip that has worked fine for years. This application exists in the structure of another var application. Using a config file, the var knows to launch my code and connect - it's the way the var allows 3rd parties to extend services. In the environment that works, the oem app and mine runs in user space (see note below). From the user application window, I launch it, everything starts, like is good. It's worked for decades.
In present time, I need to start the oem app as a service. The app starts, launches my application (app runs under a service account) where upon my app C000005s to death. No code has changed. C00005 exceptions are usually obvious to track down - look for the smoking hole in the ground. This one is a little sneaky since it's a few degrees off from my keyboard.
I have an assert and a DebugAssert athe very beginning of my application - c5s and no prompts.
If I launch my app from my command line - it starts and waits on the socket connection.
-----------------------------------------
So any ideas how to catch my app/service starting up? Can I add code to the app? My feeling is that this is system related, but well anyway
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
|
And the beginning of my old post was "Having a senior moment..."
thanks for the reminder
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
|
Since your application has been working fine in the user space, but encounters issues when running as a service, it's possible that there could be compatibility problems between your application and the service environment. You can try running your application in different compatibility modes (e.g., Windows XP, Windows 7) to see if it runs or not.
You can also check if your application relies on any external dependencies such as libraries, frameworks, or drivers. Make sure that these dependencies are compatible with Windows Server 2012 64-bit. Outdated or incompatible dependencies can sometimes cause unexpected crashes or exceptions.
|
|
|
|
|
I'll try the different modes - good suggestion. As for the dependency question, I would think if such were the case it would not work standalone. This is a *very* simple program that acts as a network connection to simulate old hardware. Trivial UI (About...) and a socket connection.
But we'll see. I just feel a forehead slapping moment coming on
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
charlieg wrote: Trivial UI (About...) and a socket connection. Just wanted to mention that you cannot create a process with a GUI inside of session 0 where the system services resides. All window creation will fail.
Also, if you are using the old WSAAsyncSelect/ WSAAsyncGetHostByAddr and so forth... those will all fail. Make sure you aren't using any of the old "Async" winsock functions.
|
|
|
|
|
Excellent point, but one of the issues already identified in this migration process is that session 0 has no access to the printer interfaces. So the next step was to have the service run as a specific user.
This is where I am right now. And thank you for all the notes on WSA*, I'll check for anything like that.
Interestingly, this app is the parent of another application that seems to run just fine (same socket infrastructure).
Edited: no longer sure of the above statement.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
modified 12-Jul-23 6:20am.
|
|
|
|
|
Yeah, this is becoming an unexpected train wreck. This code was written back in Windows Xp land and possibly earlier.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
charlieg wrote: This code was written back in Windows Xp land
If it was me I would just say it needs to keep being run as an app or it needs to be refactored. Perhaps not completely refactored but enough so you (and future developers) can have a chance at maintaining it.
I think actually I would start with the first solution - question why it needs to be run as a service.
|
|
|
|
|
Thinking along the same lines.
What's driving the need to do this is the 3rd party emulation system. Customer wants this system to fit into their new, super secure cloud system with network licenses, etc. Lots of requirements/desires that collide with each other.
The good side of things is that the Windows side of the code is minimal - it just provides a framework for the parts that actually do all the work. Refactoring is exactly what is going on.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|