Agent

From wowdev
Revision as of 22:23, 26 August 2024 by Luzifix (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Agent is the application that the Battle.net launcher uses to handle anything installation related. It starts together with the Battle.net client but is also known to idle in the background.

Products

Agent uses different product names than TACT does. For example, wowt is wow_ptr. A list of these products can be found in the Battle.net catalog and are listed on the TACT products lists under "Agent UID".

Command line arguments

Argument Description
--port= Port to start Agent on
--adminport=
--allowexternip Allow requests from non-local IPs
--nohttpauth Allows unauthenticated requests without Authentication token
--db_path=
--locale=
--autoclosedelay=
--show Open Agent in a window
--crashdelay=
--allowcommands Enables the /admin_command endpoint
--allowrestart
--allowversionrefresh
--skipupdate
--nopatchfromdvd
--curlreport=
--session= The used SessionId generated by the Battle.net application.
--showblizzarderror
--extendedblizzarderrorui
--readabledatabase
--telemetryhost=
--patchfreq=
--agentpeer_port=
--loglevel= 1-4
--logmaxsize=
--tracelevel= 1-4
--version_server_url= Override version url
--disable_crash_reporting=
--disable_admin_service=

HTTP server methods

Upon starting, Agent tries to bind itself to port 1120 on startup. If this fails, it tries on 6881, if that fails 6882, 6883 etc. When using the below methods, use the User-Agent 'phoenix-agent/1.0'. First request the /agent method to get an Authorization token you'll need to include in future requests (in the Authorization header). Do note that auth tokens are bound to connection, so doing multiple curls will be a bad idea.

This list is by no means exhaustive and entire methods might be missing or methods might be missing GET/POST or /[product] sub-methods.

/agent

GET

Gets authorization information.

Example response:

{
       "pid" : 1234.000000,
       "user_id" : "-- REDACTED --",
       "user_name" : "-- REDACTED --",
       "state" : 1004.000000,
       "version" : "2.17.2.6700",
       "region" : "eu",
       "type" : "retail",
       "opt_in_feedback" : true,
       "session" : "-- REDACTED --",
       "authorization" : "-- REDACTED --"
}

POST

Locale Request:

{
   "region": "EU"
}

Update Agent Request:

{
   "priority": {
       "insert_at_head": false,
       "value": 699.000000
   },
   "uid": "blizzard_update_agent"
}

These will return an empty response.

DELETE

An empty request will destroy the Agent instance and (possibly) shutdown the Agent process.

/game

GET

Gets a list of currently installed/installing products known to Agent.

Example response:

{
        "agent" : {
                "link" : "/game/agent"
        },
        "battle.net" : {
                "link" : "/game/battle.net"
        },
        "wow_classic_beta" : {
                "link" : "/game/wow_classic_beta"
        },
        "wow_enus" : {
                "link" : "/game/wow_enus"
        }
}

/game/[product]

GET

Example response:

This response is collapsed by default to reduce page length. Click expand on the right to expand.

{
       "background_download_available" : false,
       "background_download_complete" : true,
       "binary_launch_path" : "",
       "binary_launch_path64" : "",
       "download_complete" : true,
       "install_dir" : "C:/Program Files (x86)/World of Warcraft",
       "installed" : true,
       "installed_locales" : [
               "enUS"
       ],
       "launch_arguments" : [],
       "patch_application_complete" : true,
       "product" : "wow_classic_beta",
       "account_country" : "NLD",
       "geo_ip_country" : "NL",
       "selected_locale" : "enUS",
       "selected_asset_locale" : "enUS",
       "update_progress" : 1.000000,
       "binaries" : {
               "game" : {
                       "regex" : "",
                       "relative_path" : "_classic_beta_/WoWB.exe",
                       "switcher" : false,
                       "launch_arguments" : []
               }
       },
       "display_locales" : [
               "enUS",
               "deDE",
               "esES",
               "esMX",
               "frFR",
               "ruRU",
               "koKR",
               "ptBR",
               "zhTW",
               "zhCN"
       ],
       "update_method" : "ngdp",
       "required_os_version" : "6.1.0.0",
       "supports_multibox" : true,
       "supports_32bit" : false,
       "version_cooldown" : 0.000000,
       "opaque_product_specific" : {
               "uses_web_credentials" : "true"
       },
       "product_family" : "wow",
       "shared_container_info" : {
               "uids" : [
                       "wow_enus",
                       "wow_classic_beta"
               ],
               "subpath" : "_classic_beta_"
       },
       "region" : "eu",
       "branch" : "",
       "local_version" : "1.13.2.30406",
       "active_config_key" : "91f468f7aa61452dff81ace065f74685",
       "current_version" : 30406.000000,
       "playable" : true,
       "regional_version_info" : {
               "us" : {
                       "config_key" : "91f468f7aa61452dff81ace065f74685",
                       "display_version" : "1.13.2.30406",
                       "playable" : true
               },
               "eu" : {
                       "config_key" : "91f468f7aa61452dff81ace065f74685",
                       "display_version" : "1.13.2.30406",
                       "selected" : true,
                       "playable" : true
               },
               "cn" : {
                       "config_key" : "91f468f7aa61452dff81ace065f74685",
                       "display_version" : "1.13.2.30406",
                       "playable" : true
               },
               "kr" : {
                       "config_key" : "91f468f7aa61452dff81ace065f74685",
                       "display_version" : "1.13.2.30406",
                       "playable" : true
               },
               "tw" : {
                       "config_key" : "91f468f7aa61452dff81ace065f74685",
                       "display_version" : "1.13.2.30406",
                       "playable" : true
               },
               "sg" : {
                       "config_key" : "91f468f7aa61452dff81ace065f74685",
                       "display_version" : "1.13.2.30406",
                       "playable" : true
               },
               "xx" : {
                       "config_key" : "91f468f7aa61452dff81ace065f74685",
                       "display_version" : "1.13.2.30406",
                       "playable" : true
               },
               "beta" : {
                       "config_key" : "91f468f7aa61452dff81ace065f74685",
                       "display_version" : "1.13.2.30406",
                       "playable" : true
               }
       }
}

/install

POST

Requests the addition of a new product to the known product list. Does not actually start the install yet.

Example request:

{
	"instructions_dataset" : [
		"torrent",
		"win",
		"wow_classic_beta",
		"enus"
	],
	"instructions_patch_url" : "http://eu.patch.battle.net:1119/wow_classic_beta",
	"instructions_product" : "NGDP",
	"monitor_pid" : 12345.000000,
	"priority" : {
		"insert_at_head" : false,
		"value" : 900.000000
	},
	"uid" : "wow_classic_beta"
}

/install/[product]

GET

Gets the current status of the installation (if one is currently on-going, returns 404 otherwise).

Example response:

This response is collapsed by default to reduce page length. Click expand on the right to expand.

{
	"installed" : true,
	"progress" : 0.788332,
	"playable_progress" : 0.788332,
	"download_complete" : false,
	"patch_application_complete" : false,
	"state" : 1003.000000,
	"download_rate" : 6336703.523654,
	"paused" : false,
	"download_total" : [
		151679743.000000,
		5467787030.000000,
		1076909397.000000
	],
	"download_current" : [
		151679743.000000,
		4879705322.000000,
		241012436.000000
	],
	"thresholds" : [
		0.027161,
		0.839922
	],
	"download_remaining" : 1423978669.000000,
	"info_download_bytes" : 5277158968.000000,
	"info_written_bytes" : 5275355295.000000,
	"info_failed_bytes" : 0.000000,
	"info_expected_bytes" : 6696374732.000000,
	"info_expected_org_bytes" : 6696376170.000000,
	"needs_rebase" : false,
	"ignore_disc" : false,
	"using_media" : false,
	"extended_status" : {
		"current" : 0.000000,
		"total" : 0.000000,
		"state" : 0.000000,
		"remaining" : 0.000000,
		"unit_type" : "count"
	},
	"product_family" : "wow",
	"shared_container_info" : {
		"uids" : [
			"wow_enus",
			"wow_classic_beta"
		],
		"subpath" : "_classic_beta_"
	},
	"region" : "eu",
	"branch" : "",
	"local_version" : "1.13.2.30406",
	"active_config_key" : "91f468f7aa61452dff81ace065f74685",
	"current_version" : 30406.000000,
	"playable" : true,
	"regional_version_info" : {
		"us" : {
			"config_key" : "91f468f7aa61452dff81ace065f74685",
			"display_version" : "1.13.2.30406",
			"playable" : true
		},
		"eu" : {
			"config_key" : "91f468f7aa61452dff81ace065f74685",
			"display_version" : "1.13.2.30406",
			"selected" : true,
			"playable" : true
		},
		"cn" : {
			"config_key" : "91f468f7aa61452dff81ace065f74685",
			"display_version" : "1.13.2.30406",
			"playable" : true
		},
		"kr" : {
			"config_key" : "91f468f7aa61452dff81ace065f74685",
			"display_version" : "1.13.2.30406",
			"playable" : true
		},
		"tw" : {
			"config_key" : "91f468f7aa61452dff81ace065f74685",
			"display_version" : "1.13.2.30406",
			"playable" : true
		},
		"sg" : {
			"config_key" : "91f468f7aa61452dff81ace065f74685",
			"display_version" : "1.13.2.30406",
			"playable" : true
		},
		"xx" : {
			"config_key" : "91f468f7aa61452dff81ace065f74685",
			"display_version" : "1.13.2.30406",
			"playable" : true
		},
		"beta" : {
			"config_key" : "91f468f7aa61452dff81ace065f74685",
			"display_version" : "1.13.2.30406",
			"playable" : true
		}
	}
}

POST

Queues the installation of a product. The finalized key is optional and is only sent after the user confirms the Install dialog in the Battle.net app.

Example request:

{
	"account_country" : "---",
	"finalized" : true,
	"game_dir" : "C:\\Program Files (x86)\\World of Warcraft",
	"geo_ip_country" : "--",
	"language" : [
		"enUS"
	],
	"selected_asset_locale" : "enUS",
	"selected_locale" : "enUS",
	"shortcut" : "all",
	"tome_torrent" : ""
}

/update/[product]

POST

Starts an update.

Example request:

{
    "priority": {
        "insert_at_head": true,
        "value": 699.0
    },
    "uid": "wow_classic_beta"
}

/uninstall

POST

Uninstalls a product.

Example request:

{
    "run_compaction": true,
    "uid": "wow_classic_beta"
}

Response:

{
    "request_uri": "uninstall/w3"
}

/admin

To do!

/download

To do!

/agent/download

To do!

/backfill

To do!

/repair

GET

Returns Repair uri

Example Response:

{
   "response_uri":"/repair/wow_ptr_[locale]",
   "result_uri":"/game/wow_ptr_[locale]"
}

POST

Requests Repair of a Product

Example Request:

{
   "priority":{
      "insert_at_head":false,
      "value":1000.000000
   },
   "uid":"wow_ptr_[locale]"
}

/repair/[product]

GET

Returns Progress of Repairing

Example Response:

{
   "progress": 0.080002,
   "state": 1001.000000,
   "extended_status": {
      "current": 0.000000,
      "total": 0.000000,
      "state": 3.000000,
      "remaining": 0.000000,
      "rate": 0.000000,
      "unit_type": "bytes"
   }
}

DELETE

Cancels the current Repairing process

/register

To do!

/gamesession

GET

Gets running Game Sessions

Example Response:

{
   "battle.net": {
      "1": {
         "request_id" : 0.000000,
         "pid" : 12948.000000,
         "pid_path" : "C:/Program Files (x86)/Battle.net/Battle.net.exe",
         "binary_type" : "game"
      }
   }
}

/spawned

To do!

/version

GET

Returns /version/[product]

Example Response:

{
  "response_uri": "/version/wow_ptr_[locale]"
}

POST

Gets /version/[product]

Example Request:

{
  "uid": "wow_ptr_[locale]"
}

/version/[product]

GET

Returns versions file in JSON format

Example Response:

This response is collapsed by default to reduce page length. Click expand on the right to expand.

{
  "state":1007.000000,
  "region":"us",
  "branch":"",
  "local_version":"8.2.0.30430",
  "active_config_key":"54b3dc4ced90d45071f72a05fecfd063",
  "current_version":30430.000000,
  "playable":true,
  "regional_version_info":{
      "us":{
         "config_key":"54b3dc4ced90d45071f72a05fecfd063",
         "display_version":"8.2.0.30430",
         "selected":true,
         "playable":true
      },
      "eu":{
         "config_key":"54b3dc4ced90d45071f72a05fecfd063",
         "display_version":"8.2.0.30430",
         "playable":true
      },
      "cn":{
         "config_key":"54b3dc4ced90d45071f72a05fecfd063",
         "display_version":"8.2.0.30430",
         "playable":true
      },
      "kr":{
         "config_key":"54b3dc4ced90d45071f72a05fecfd063",
         "display_version":"8.2.0.30430",
         "playable":true
      },
      "tw":{
         "config_key":"54b3dc4ced90d45071f72a05fecfd063",
         "display_version":"8.2.0.30430",
         "playable":true
      },
      "sg":{
         "config_key":"54b3dc4ced90d45071f72a05fecfd063",
         "display_version":"8.2.0.30430",
         "playable":true
      },
      "xx":{
         "config_key":"54b3dc4ced90d45071f72a05fecfd063",
         "display_version":"8.2.0.30430",
         "playable":true
      }
   }
}

/option

To do!

/priorities

GET

Returns the current priorities (?)

Example Response:

{
    "priorities": [
        "wow_ptr_enus",
        "heroes",
        "battle.net"
    ]
}

/createshortcut

To do!

/hardware

GET

Gets Hardware Info

Example Response:

{
    "64bit": true,
    "os": "Windows 10",
    "os_version_number": "10.0.0.17763",
    "graphics_devices": [
        {
            "name": "NVIDIA GeForce RTX 2070",
            "vendor_id": 4318,
            "video_memory": 3221225472
        },
        {
            "name": "Microsoft Basic Render Driver",
            "vendor_id": 5140,
            "video_memory": 0
        }
    ]
}

/size_estimate

To do!

/admin_command

POST

Requires Agent to be started with the --allowcommands argument. Always returns a status code of 200 if the body of your request contains JSON data. Otherwise, returns "400 bad request", and a response specifying an error code of 2311.

Example Request

{
  "command": "help" 
}

Actual command structure is unknown.

/gce_state

POST

Example Request

 {
   "set_state": "Uninstalled"
 }

To do!

/content/??

To do!