logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SteamSaveResponseReader

    Parses a Steam newachievement or saveachievement response body.

    Inheritance
    object
    SteamSaveResponseReader
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Steam.Infrastructure
    Assembly: Serenity.Steam.Infrastructure.dll
    Syntax
    public static class SteamSaveResponseReader
    Remarks

    Both are undocumented, internal endpoints of the partner site's own achievement editor; the shapes below are the ones observed live (2026-10-05) and read from the editor's own script. The reader stays defensive about everything beyond them:

    • A JSON object response carries an explicit success/ok/result flag — a boolean, a number (1 is true, any other number false) or a "0"/"1"/"true"/"false" string. A false flag is a failure, reported with the error (or message/detail) text. Without any flag the answer is a failure too: a bare error (a string or an object) names itself, and a body that says nothing at all — {} — confirms nothing, so it is never taken for a stored save. An explicit true outranks error text beside it, but a saved flag that is false beside a true one is a failure quoting the body.
    • newachievement answers {success, maxstatid, maxbitid, achievement} with the freshly assigned stat/bit id inside achievement (stat_id/bit_id), and saveachievement answers {success, saved, achievement} — the shape the partner site's own editor script reads. A creation answer without both ids is a failure, because a save posted with empty ids would not address the placeholder it was meant to finish.
    • A bare JSON boolean root (rather than an object) is accepted as a legacy-PHP-style success/failure signal for a save, with no further detail; for a creation it carries no ids and so fails.

    An icon upload's answer is read by ReadUploadAcknowledgement(string) instead, which only refuses an explicit failure indicator (a false flag, or a bare error) and otherwise accepts whatever a 2xx carried. Login-page detection mirrors SteamAchievementResponseReader exactly, since an expired session answers every partner-site endpoint the same way.

    Methods

    Read(string)

    Reads a saveachievement response body into a save result.

    Declaration
    public static SteamSaveResult Read(string responseBody)
    Parameters
    Type Name Description
    string responseBody

    The raw HTTP response body.

    Returns
    Type Description
    SteamSaveResult

    ReadNewAchievement(string)

    Reads a newachievement response body: a save-style answer that must also carry the stat and bit ids Steam assigned, since the save that finishes the placeholder addresses it by them.

    Declaration
    public static SteamSaveResult ReadNewAchievement(string responseBody)
    Parameters
    Type Name Description
    string responseBody

    The raw HTTP response body.

    Returns
    Type Description
    SteamSaveResult

    ReadUploadAcknowledgement(string)

    Reads an images/uploadachievement response body. Unlike Read(string) it is lenient about shape — an empty, non-JSON or non-object 2xx body is a plain acknowledgement, since the upload may answer with nothing but its status — and strict only about an explicit failure indicator: a success/ok/result flag that is false, or (with no flag) a bare error — a string or an object. An explicit true outranks any text beside it, and message/detail mean failure only beside a false flag; with neither flag nor error the body is acknowledged unread (the wire trace is where its meaning gets checked).

    Declaration
    public static SteamSaveResult ReadUploadAcknowledgement(string responseBody)
    Parameters
    Type Name Description
    string responseBody

    The raw HTTP response body of a 2xx answer.

    Returns
    Type Description
    SteamSaveResult
    In this article
    © 2026 Serenity. All Rights Reserved