Initialization & main loop
High-level description of what Kore does
When you start Kore, it first loads configuration and table files. Then it connects to the Ragnarok Online server. It will now process all data received from the server, and calculate what to do (walking, attacking monsters, etc.), in an infinite loop (until the user tells Kore to quit).Initialization
openkore.pl is the main source file. The following image describes what happens when openkore.pl is run:
After this, Kore will enter the main loop.
Main loop
Every loop in the main loop lasts very shortly (exception: when it's calculating a route it can take a while). In each loop, the following things are performed:-
Re-initialize X-Kore if necessary
TODO: document how X-Kore works. -
Parse command input
If there is keyboard input available, then Kore will read the keyboard input and process the data.- The Interface module is the module that checks whether there is keyboard input.
- The main loop retrieves the keyboard input data, and passes that data to the Commands module, where it is processed.
-
Process and handle data from RO server
TODO -
Process AI
The AI ("Artificial Intelligence") function calculates what actions to perform, when, and in what way. See also the page that describes the AI in detail. -
Handle connection states
The functionNetwork::checkConnection()
handles connection issues. See the Network module for more information. Do not confuse this step with step 3, which handles network data, not network connection issues. -
Misc other stuff