SetWarningMessageHook() public static method

API warning handling

'int' is the severity; 0 for msg, 1 for warning

'const char *' is the text of the message

callbacks will occur directly after the API function is called that generated the warning or message.

public static SetWarningMessageHook ( SteamAPIWarningMessageHook_t pFunction ) : void
pFunction SteamAPIWarningMessageHook_t
return void
        // This should only ever get called on first load and after an Assembly reload, You should never Disable the Steamworks Manager yourself.
        protected virtual void OnEnable()
        {
            if (s_instance == null)
            {
                s_instance = this;
            }

            if (!m_bInitialized)
            {
                return;
            }

            if (m_SteamAPIWarningMessageHook == null)
            {
                // Set up our callback to receive warning messages from Steam.
                // You must launch with "-debug_steamapi" in the launch args to receive warnings.
                m_SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook);
                SteamClient.SetWarningMessageHook(m_SteamAPIWarningMessageHook);
            }
        }