Exemplo n.º 1
0
DECL(int, FSFlushQuota, void *pClient, void *pCmd, const char* path, int error) {
    int client = GetCurClient(pClient);
    if (client != -1) {
        // log
        //fs_log_string(bss.socket_fs[client], path, BYTE_REMOVE);
        char buffer[200];
        __os_snprintf(buffer, sizeof(buffer), "FSFlushQuota: %s", path);
        fs_log_string(bss.global_sock, buffer, BYTE_LOG_STR);

        // change path if it is a save folder
        int pathType = getPathType(path);
        if (pathType == PATH_TYPE_SAVE) {
            int len = strlen(path);
            int len_base = getNewPathLen(pathType);
            char new_path[len + len_base + 1];
            compute_new_path(new_path, path, len, pathType);

            // log new path
            fs_log_string(bss.socket_fs[client], new_path, BYTE_LOG_STR);

            return real_FSFlushQuota(pClient, pCmd, new_path, error);
        }
    }
    return real_FSFlushQuota(pClient, pCmd, path, error);
}
Exemplo n.º 2
0
DECL(int, FSFlushQuota, void *pClient, void *pCmd, char* path, int error) {
    int client = GetCurClient(pClient);
    if (client != -1) {
        // log
        //log_string(bss.socket_fs[client], path, BYTE_REMOVE);
        char buffer[200];
        __os_snprintf(buffer, sizeof(buffer), "FSFlushQuota: %s", path);
        log_string(bss.global_sock, buffer, BYTE_LOG_STR);

        // change path if it is a save folder
        if (is_savefile(path)) {
            int len = strlen(path);
            int len_base = (strlen(bss.save_base) + 8);
            char new_path[len + len_base + 1];
            compute_new_path(new_path, path, len, 1);

            // log new path
            log_string(bss.socket_fs[client], new_path, BYTE_LOG_STR);

            return real_FSFlushQuota(pClient, pCmd, new_path, error);
        }
    }
    return real_FSFlushQuota(pClient, pCmd, path, error);
}