ZZ-Cat / raildriver

Smart Locomotive Controller script for Garry's Mod Train Build Servers.
GNU Affero General Public License v3.0
2 stars 0 forks source link

Version FIle Scanning Method 1 #34

Closed ZZ-Cat closed 1 year ago

ZZ-Cat commented 1 year ago

Overview

This Pull Request is a part of an ongoing test to determine the best method to scan through the Version File in order to determine whether-or-not one or more of RailDriver's libraries need to be updated in-game.

I have two methods to test & compare:

This Pull Request is for testing Method 1.

Method 1

In this method, I can easily catch any errors that occur during the comparisons. For example, if the checksums between a file in the Local Version File does not match the checksum in the Online Version File, then I know that file has changed. Then, I can compare the semantic version numbers of that file. If the semantic version numbers of the local file is greater than the semantic version number of the online file, then I can check if the player is a developer. If the player is not a developer, I may want to throw an error message to the player. If the player is a developer, then I may want to throw a warning message to the player to remind them to update the Online Version File on RailDriver's GitHub repository.

If the semantic version numbers of the local file is less than the semantic version numbers of the online file, then that file is downloaded & updated in-game.

If the semantic version numbers are equal, then this file will be skipped.

Results from Method 1

To be determined.

Method 2

In this method, deciding on whether-or-not a file needs to be updated in-game is a similar process to Method 1. However, the semantic version numbers are compared first before the checksums. This means that the semantic version numbers of each file need to be parsed from both the Local Version File & the Online Version File, in order to compare them. This is a bit more complicated than Method 1 & may be more prone to errors. EG Tick Quota Exceeded. I also believe that this method may introduce more computational overhead than Method 1 because of the extra parsing that needs to be done. Thus, the reason for testing both methods. I want to a.) Be proven wrong; & b.) Determine which method is more efficient.

Results from Method 2

To be determined.

Conclusion

To be determined.

ZZ-Cat commented 1 year ago

When I made both of these pull requests, I was indecisive about how I was going to go about this, & I had difficulty with making up my mind on how to go about doing it.

Now, that it has been well over six months, I have no reason to drag this out any longer. I have finally made up my mind, here. I will go with File Scanning Method 1, as I like the idea of being able to catch errors as early as I possibly can.

I am merging this Pull Request "as-is" & closing its sister Pull Request #35