Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Repair Functions
#1
Upon thinking about how to handle certain processes, there are some cases where a power outage or a disconnection could cause a complication with how the game works. As a result, I am going to develop repair functions which can repair all participants in a specific battle or all characters in the game. This would reset them to a state where they are in town and are not engaged in any activity.

During the development process this will be crucial since a lot of information is temporarily stored in files to control combat and other aspects of the game. If the game were to crash, certain timers would be stopped and not restarted when the bot is launched again. As a result, this could cause issues with trying to resume gameplay requiring manual editing of files unless there is a repair function.

Any time the bot is started, it will run a full repair function which resets all player characters to a default state while wiping all temporary NPC information. This means if the bot is shut down in the middle of a fight, that fight is essentially negated.

Once we near a "complete" launch of the game, I will look into some form of resuming fights if the bot crashes, if the connection between the bot and server is lost, or if there is some sort of other issue.

I'll use this page as personal notes on what I need to take into consideration for repair functions so I don't forget anything. This could even include deleting entire files since the bot can recreate the files if needed.

Potentially required files
timers.data - Tracks all currently running timers. If the bot disconnects from the server, it will unset all of these timers.
battles.data - Tracks all ongoing battles. If the bot disconnects from the server, it will reset all of the characters in these battles to default status and then remove all of the temporary NPC data.
longtimers.data - There will be some processes that take a while to complete such as blacksmithing. I would hate to punish players over the bot becoming disconnected, therefore this file would make sure all of these timers are documented and then resumed when the bot reconnects. If there is a crash, I will make an effort to restore them as much as possible. Not sure the best way to approach this since I don't think there are many long timers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)