interpreter.js
/*
If no script_name is given, then the api will use the buffer as reference
for the script name to load. If a script_name is given, the api will use
the buffer and the len passed as the script buffer, without calling the
script reader.
*/
If no script_name is given, then the api will use the buffer as reference
for the script name to load. If a script_name is given, the api will use
the buffer and the len passed as the script buffer, without calling the
script reader.
If no script_name is given then the api will use the buffer as reference for the script name to load . If a script_name is given the api will use the buffer and the len passed as the script buffer without calling the script reader .
function load_script(scriptBuffer, len, script_name) {
    if (!scriptBuffer) {
        return OPERATION_FAIL;
    }
    no_action++; 
    error = luaL_loadbuffer(current_state, scriptBuffer, len, script_name) || lua_pcall(current_state, 0, 0, 0);
    if (error) {
        pduel.handle_message(pduel.handle_message_payload, lua_tostring(current_state, -1), OCG_LOG_TYPE_ERROR);
        lua_pop(current_state, 1);
        no_action--;
        return OPERATION_FAIL;
    }
    no_action--;
    return OPERATION_SUCCESS;
}
function load_script ( scriptBuffer , len , script_name ) { if ( ! scriptBuffer ) { return OPERATION_FAIL ; } no_action ++ ; error = luaL_loadbuffer ( current_state , scriptBuffer , len , script_name ) || lua_pcall ( current_state , 0 , 0 , 0 ) ; if ( error ) { pduel . handle_message ( pduel . handle_message_payload , lua_tostring ( current_state , - 1 ) , OCG_LOG_TYPE_ERROR ) ; lua_pop ( current_state , 1 ) ; no_action -- ; return OPERATION_FAIL ; } no_action -- ; return OPERATION_SUCCESS ; }
If no script_name is given, then the api will use the buffer as reference
for the script name to load.
If no script_name is given then the api will use the buffer as reference for the script name to load .
// should refactor this to be just a script call. // the hell is this?