gw2cc is an extension on top of the godot game engine. This design means you have a similar level of access to the game state as the official Developers, giving you full control over every aspect of the game. The closed source binary part only provides a low level interface to the Guild Wars 2 server while more high level features are implemented in the Open Source GDScript part available in the gw2cc repository.
ClientSession #
ClientSession is the main access point to the current game state and is a globally accessible Singleton. You can use this object to get access to the LoginServerClient, SecureTokenServerClient and GameServerClient. Calling
ClientSession.start
will start the login procedure. If you are using the official godot project as a base you usually do not need to call this yourself as this is already handled by the Start scene. Note however that nothing else will be initialized before you have started the Session!
SecureTokenServerClient #
The SecureTokenServerClient (ClientSession.sts) is the main interface for communications with the Secure Token Server also sometimes called the Portal Server. This server is similar to an OAuth service in that it provides a central location to generate session tokens for all GW2 related services. It is also responsible for server independent information like the Friend list, Private Messages and the Trading Post. If you are using the official base client you will never need to interact with this object yourself as all necessary functionality is already included in the Gw2Login scene.
LoginServerClient #
The LoginServerClient (ClientSession.ls) is the main interface for communicating with the actual game login server. The ls client gives you access to your playable characters and home world. With
ClientSession.ls.play(character)
you can start a new game session with the selected character. Note that like with SecureTokenServerClient and ClientSession everything is already implemented in the official client base inside the Gw2Login and CharacterSelect scenes.
GameServerClient #
The GameServerClient is the most important object of gw2cc. It represents a connection to the ingame world and gives you access to all the different Managers that are handling specific aspects of the game through
ClientSession.gs.get_manager(<Manager>)
Note that managers are only valid as long as you are ingame and will be destroyed on every map change!
Managers #
The different Managers are the main interface to the game state. Each Manager implements a specific aspect of the game and can be used to manipulate and/or retrieve information regarding it. You get access to all managers through the GameServerClient. To get an overview and documentation for all managers you can open the godot editor help (F1) and search for “Manager”. All Managers are implemented as a subclass of the Manager class.
NavigationService #
The NavigationService, available through
var nav_service = ClientSession.gs.get_navigation_service()
can be used to find paths between any 2 points on the current map (as long as there exists such a path). The main function you will be using in your bots is
var res = nav_service.find_path(from, to)
which returns a dictionary containing all the waypoints on the path (res[“waypoints”]) [between two waypoints you can always walk in a straight line], the area types (res[“areas”]) and flags (res[“flags”]).