engine/crash/src/script_crash.cpp
/*# stores user-defined string value
     *
     * Store a user value that will get written to a crash dump when
     * a crash occurs. This can be user id:s, breadcrumb data etc.
     * There are 32 slots indexed from 0. Each slot stores at most 255 characters.
     *
     * @name crash.set_user_field
     * @param index [type:number] slot index. 0-indexed
     * @param value [type:string] string value to store
     */
stores user-defined string value
Store a user value that will get written to a crash dump when
a crash occurs. This can be user id:s, breadcrumb data etc.
There are 32 slots indexed from 0. Each slot stores at most 255 characters.

@name crash.set_user_field
@param index [type:number] slot index. 0-indexed
@param value [type:string] string value to store
stores user - defined string value Store a user value that will get written to a crash dump when a crash occurs . This can be user id : s breadcrumb data etc . There are 32 slots indexed from 0 . Each slot stores at most 255 characters . @name crash . set_user_field @param index [ type : number ] slot index . 0 - indexed @param value [ type : string ] string value to store
static int Crash_SetUserField(lua_State* L)
    {
        int index = luaL_checkint(L, 1);
        const char* value = luaL_checkstring(L, 2);
        if (index < 0 || index >= (int)AppState::USERDATA_SLOTS)
        {
            return luaL_error(L, "User data slot index out of range. Max elements is %d", AppState::USERDATA_SLOTS);
        }
        if (strlen(value) > (int)(AppState::USERDATA_SIZE-1))
        {
            dmLogWarning("Userdata value will be truncated to max length %d", AppState::USERDATA_SIZE-1);
        }
        SetUserField(index, value);
        return 0;
    }
static int Crash_SetUserField ( lua_State * L ) { int index = luaL_checkint ( L , 1 ) ; const char * value = luaL_checkstring ( L , 2 ) ; if ( index < 0 || index >= ( int ) AppState :: USERDATA_SLOTS ) { return luaL_error ( L , " " , AppState :: USERDATA_SLOTS ) ; } if ( strlen ( value ) > ( int ) ( AppState :: USERDATA_SIZE - 1 ) ) { dmLogWarning ( " " , AppState :: USERDATA_SIZE - 1 ) ; } SetUserField ( index , value ) ; return 0 ; }
stores user-defined string value
 Store a user value that will get written to a crash dump when
 a crash occurs.
stores user - defined string value Store a user value that will get written to a crash dump when a crash occurs .