Ini files not being written
#1

I have set up my server on streamline servers hosting, everything seems to be working fine except the user saving system. The server creates a user file like it should but does not save anything inside it, making the file blank. Im using all the exact same files and configuration on this hosting as Im using on my localhost, where the saving system works perfectly fine. Im not sure what could be the issue. Thanks.
Reply
#2

Forgot to mention - all plugins/includes are there and they are working fine.
Reply
#3

Might be a permission issue, double check the scriptfiles folder permissions. Also, is it a shared host (aka game server hosting) or a VPS?
Reply
#4

Also configured the permissions already. It is game server hosting.
Reply
#5

Which INI system do you use? Are you sure the code isn't crashing after the file is created for some reason? (check with debug lines if you aren't sure)
Reply
#6

Y_Ini. Checked, not crashing. I tried saving just one line on player disconnect, still does not write anything to the file.
Reply
#7

What's your saving path (for scriptfiles folder) that you use with y_ini open function please?
Reply
#8

Код:
#define USER_PATH "/Users/%s.ini"
Код:
UserPath(playerid){

    // Declare our variables used in this function
    new
        str[36], // 'str' will be our variable used to format a string, the size of that string will never exceed 36 characters.
        name[MAX_PLAYER_NAME]; // 'name' will be our variable used to store the player's name in the scope of this function. MAX_PLAYER_NAME is defined as 24.

    // Get the player's name.
    GetPlayerName(playerid, name, sizeof(name));

    // Format USER_PATH with the name that we got with GetPlayerName.
    format(str, sizeof(str), USER_PATH, name); // USER_PATH has been defined as: "/Users/%s.ini", %s will be replaced the player's name.
    return str;
}
Код:
new INI:file = INI_Open(UserPath(playerid));
                INI_SetTag(file, "PlayerData");
                INI_WriteString(file, "Password", PlayerInfo[playerid][Password]);
                INI_Close(file);
Reply
#9

Quote:
Originally Posted by matje
Посмотреть сообщение
Код:
#define USER_PATH "/Users/%s.ini"
This might be the issue, try removing the first slash, so it becomes:

PHP код:
#define USER_PATH "Users/%s.ini" 
The reason is, Linux systems handle the trailing / differently, in Linux the path becomes /Users/whatever.ini when there's a trailing slash while it's supposed to be /path/to/scriptfiles/Users/whatever.ini.
Reply
#10

Quote:
Originally Posted by iKarim
Посмотреть сообщение
This might be the issue, try removing the first slash, so it becomes:

PHP код:
#define USER_PATH "Users/%s.ini" 
The reason is, Linux systems handle the trailing / differently, in Linux the path becomes /Users/whatever.ini when there's a trailing slash while it's supposed to be /path/to/scriptfiles/Users/whatever.ini.
Unfortunately, no luck. I've opened a ticket to their support team, but I doubt they will be able to help me. Thanks anyways
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)