Back to blog

HRL - Development Blog 1

It's really a bit late to start this development blog, as the web app and server-side script are already complete, however I suppose I'll do a quick update in this first post.

The development idea came up when asking some fellow Halo players for some ideas. I already knew of systems like SAPP, and Phasor, as these have been around for quite a while now. What I didn't know was how far these have come since the days when they came out.

These programs, SAPP I chose as it is the most popular nowadays, have a lot of potential, and are great for extending the game, allowing for developers to use LUA, as long as their documentation is good! (this will come up later on).

 

Back to the topic at hand of development.
It started with the idea of a leaderboard listing lap times. Currently server have to host these and they are only accessable inside the game. But what if they could be accessed externally?
I knew to start out the Web App would not need a login sytem, which made it quite easy.

I go stuck into looking for a documentation for SAPP, from what I can tell the source code was never released. Somewhere along the way I managed to find a PDF with general information, what variables, events are available.
I got the general development of getting the fastest lap time quickly, using the EVENT_SCORE event. Finding the current player using the get_dynamic_player function. Finding the current vehicle using the player address. then finding the current driver of said vehicle. Testing this current driver against the player_address allows to tell if the current player is the driver. Not I only want the drivers lap time to be recorded.
Generate a JSON string and submit using a .dll I developed (more on this later).

That is the general idea of the LUA script.

 

Next came the .dll file. the development for this started from being unable to find a existing way to make a request against a server, that was lightweight and had not many dependencies.
Finally I decided to develop it myself. using the RUST language and the Hyper.rs library allowed for this development to go quickly, as I did not require the request to return a response.

 

The web app was simple aswell, a basic Laravel setup, no login system, just an API controller which logs a Job, later triggered by a program called Supervisor.
This Job checks against whether the server, player, map exist in the database already, and created if not, including creating relationships between the server-map, player-server.
We then check whether the current lap time is faster than the record in the database (if there is one). If not, we update the entry with the new time.

Frontend wise, is actually the default laravel bootstrap theme, with datatables ontop. Using ajax for pagination, search, and filtering.