Steam API Debugging

Source: Internet
Author: User

Overview

Over the years, Steam has grown into a large application offering a variety of individual modules and methods for debugging. This article will try to present you with these modules and methods to help you take full advantage of Steam and steamworks to reduce your annoyance.

Steam automatically outputs several debug results to a 日志 folder, and other results are enabled via Steam command line parameters or Console_commands.

Isteamutils::setwarningmessagehook allows the Steamworks application to register a function that, in the case of an error, causes the Steamworks API to send developer-readable error messages to the application. Most Stem APIs Use this function, so remember to make this connection easy to check on errors.

Steam Command Line Parameters

Steam uses command-line parameters to provide developer details.

    • -console – Enable the Steam console. The console provides additional debugging information, and you can also use Steam console commands in the console. You can enable the steam console by entering Steam://open/console in the browser address bar or by using the Windows Execution dialog box.
    • -debug_steamapi – Enable Steamworks API debugging. If you want to use Isteamutils::setwarningmessagehook, you must use this command!
    • -lognetapi – Writes all peer-to network information log/netapi_log.txt .
    • -log_voice – writes voice chat data to a logs/voice_log.txt file.
    • -installer_test – When installing a retail version of the game, all files are sent to install_validate/ the folder instead of the Steam cache.
Steam Console Commands

In addition to an additional output error report or error log, the steam console can also be used to send a command to a steam client or server. The following are some of the commands that can be useful when debugging:

    • Find <string> – found other handy commands.
    • Set_spew_level – allows you to set higher levels of output in the Steam console and log files, such as "Set_spew_level 4 4", which provides the most detailed logging and is extremely useful in troubleshooting.
    • App_info_print < appid> – Displays all the information that the Steam server provides for the game.
    • Enable/disable_license < packageid> – can test the ownership of the application, usually the ownership of DLC.
    • Testappcloudpaths < appid> – Test your automatic cloud configuration before allowing all customers to start an automated cloud. This command can only be used for a single AppID at a time and must be performed on all clients that are undergoing testing.
    • log_callbacks <first callbackid> <last callbackid> – Record all callbacks into the console.
    • log_matchmaking_callbacks <0|1> – Enable or disable matching callback records.
    • LOG_IPC <counts|verbose> <filter> – see Steamworks API Record
Steamworks API Record

The LOG_IPC command (entered in the steam console) dumps all IPC calls made to the Steam client's internal interface. This command uses the filter parameter, which is the name of the interface or process you want to monitor. Note that the names provided do not always match the isteam* version 1:1, but are usually very similar. You can optionally specify "counts" or "verbose", which defaults to "counts".

The default flow usually looks like this:

00000009 My_exe_name.exe:> iclientuser::getsteamid () = [U:2:172006],00000009 My_exe_name.exe:05 > Iclientuser::bloggedon () = 1, 00000009 my_exe_name.exe:05 > Iclientnetworking::i Sp2ppacketavailable (0,) = 0,0,< Span class= "Hljs-number" >00000009 my_exe_name.exe:05 > Iclientnetworking::i Sp2ppacketavailable (1,) = 0,0,< Span class= "Hljs-number" >00000009 my_exe_name.exe:05 > Iclientfriends::getpersonaname () = "user", 00000009 My_exe_name.exe: 05 > Iclientuser::getsteamid () = [U: 2: 123456], Monitoring specific interfaces

If you want to track specific issues, filter specific interfaces in LOG_IPC.

Such as:log_ipc IClientUser

Output Example:

00000009 my_exe_name.exe:> Iclientuser::getsteamid () = [U:2:172006],00000009 my_exe_ Name.exe:> Iclientuser::bloggedon () = 1,00000009 my_exe_name.exe:> Iclientuser:: Getsteamid () = [U:2:123456], IPC reports

In the Steam client, a summary report can be obtained via LOG_IPC.

You can quickly read the summary of the IPC call in the summary report. The example below shows that calling Getsteamid/bloggedon/getpersonanam is too frequent. The report is output when the record is deactivated or restarted, so if you want to get the reports, follow these steps:

    • Enter "LOG_IPC My_exe_name.exe".
    • Wait, or interact with the game to try to reproduce the problem, and so on
    • Enter "LOG_IPC 0".


Output Example:

CallsOverTheLast 42144MillisecondsProcessMethodcallsFirstLast---------------------------------------------------------------------------------------My_exe_name. exeIclientnetworking:: isp2ppacketavailable 15272 9 42145My_exe_name. exeIclientuser:: Getsteamid 42652 9 42145My_exe_name. exeiclientuser::bloggedon42652 9 42145my_exe_name.exe Iclientfriends::getpersonaname38209 42145my_ Exe_name.exe iclientuser::requestencryptedappticket2 21032441my_exe_name.exe iclientutils ::getapicallresult2 21252441my_exe_name.exe iclientuser :: GetEncryptedAppTicket1 21362136 IPC Log Output

The full IPC log will be output to your Steam installation directory: logs\\ipc_SteamClient.log .

Steam API Debugging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.