So. The need to implement one server feature properly rather than patching it together led to almost two weeks of trial and error.
But... victory! That's the short version.
Here's the longer one. There was a small server program that acted as a clock. As long as that program ran under the same roof as everything else, all was well. Every other component took its data from it, and everything hummed along. The problem arose when another program needed access to that information. Because of its extensive database work, this other program could no longer run under the same roof.
For many days I tried every approach I could think of to gain access. No matter how I twisted it, either there was no access, there was access only to a nonworking segment, or another copy started and was naturally out of sync.
This matters because all game events, client-server synchronization, and so on depend on this clock.
And if parts of the server are eventually distributed across different resources, I either had to establish complete communication or devise a different architecture. The current arrangement worked and could have been patched, but it was a dead end.
So I had to integrate another framework, Spring, into the server and use its architecture to launch a separate server that handles and processes API requests.
In plain language, any program that knows the correct HTTP address and endpoint name can now request a variable's value and receive its contents in response, whether it is on the same machine or in Australia.
Overall, this provides relatively fast communication between different parts of the server without using databases. It also makes it possible to create separate graphical interfaces for monitoring and controlling the server quickly. By quickly, I mean that a controller and display for the clock would take perhaps half an hour. With practice and ready-made examples, it would be even faster. And it can all run from any other machine.
In the end, I did it. It works. I gained a great deal of experience and knowledge in the process.
Yes, it took an unexpected two weeks, but it had to be done. The poorly functioning clock was holding up the server component that handles changes in ship state. Without it, the little ships won't fly and land properly.
Today I already added more client-side interface and logic for landed and launching ships. It isn't finished, but a lot is done.
We'll start flying soon!
