Managing Inactive accounts
#1

Hi guys i have a server and today when i logged in to my vps i say 13k files in my users folder so is there any way to delete inactive users .The server lags a bit when there are 40+ players because of these extra files.

I use ladmin and examples of .sav files

Код:
password_hash=182845945
ip=216.172.142.176
registered=1
RegisteredDate=27/5/2015
Nick=$$M@ster$$
loggedin=0
banned=0
level=0
LastOn=27/5/2015
money=86207
Score=47
kills=2
deaths=0
hours=1
minutes=52
seconds=40
dRank=0
Help Operator=0
Donor=0
x1=165
y1=1971
z1=19
interior1=0
weap1=24
weap1ammo=100
weap2=27
weap2ammo=279
weap3=0
weap3ammo=0
weap4=31
weap4ammo=163
weap5=0
weap5ammo=0
weap6=0
weap6ammo=0
health=100
armour=1
TimesOnServer=2
My code for saving

Код:
	if (udb_Exists(PlayerName2(playerid)))
    {
	  if(PlayerInfo[playerid][LoggedIn] == 0)
	  {

	      ShowPlayerDialog(playerid, 125, DIALOG_STYLE_PASSWORD, ""cred"Account Login",""ccolor"This account is registered!"cgreen" Please login To continue","Login","Kick");
      }
    }
    if (!udb_Exists(PlayerName2(playerid)))
	{
      if(PlayerInfo[playerid][Registered] == 0)
	  {
	      new string[200];
		  format(string, sizeof(string),""cgreen"Welcome To Real World At War 2™ "cred"%s "ccolor"You are not Registered\n"corange"Please Enter a password to register an account", PlayerName2(playerid));
	      ShowPlayerDialog(playerid, 126, DIALOG_STYLE_PASSWORD, "Register",string,"Register","Kick");
      }
    }
    if(PlayerInfo[playerid][LoggedIn] == 1)
    {
        new pname[128];
	    new file[128];
	    GetPlayerName(playerid, pname, sizeof(pname));
        format(file, sizeof(file), savefolder,pname);
        if(!dini_Exists(file))
		{
	        dini_Create(file);
	        dini_IntSet(file, "Score", 0);
	        dini_IntSet(file, "Money", 0);
	        SetPlayerScore(playerid, dini_Int(file, "Score"));
	        SetPlayerMoney(playerid, dini_Int(file, "Money"));
        }

        else
		{
	        SetPlayerScore(playerid, dini_Int(file, "Score"));
	        SetPlayerMoney(playerid, dini_Int(file, "Money"));
	    }
	}
Reply
#2

So can someone make a cmd to delete the inactive users i mean if last login less more that 10 days
Reply
#3

Because you use files, it is too inefficient to do it in Pawn. Write a shell script that deletes files that were modified more than X days in the past.

And oh, server lag isn't created by files just sitting there doing nothing. The lag is more than likely caused by this outdated and slow contraption known as dini, which opens and closes the file each time it writes a value.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Because you use files, it is too inefficient to do it in Pawn. Write a shell script that deletes files that were modified more than X days in the past.

And oh, server lag isn't created by files just sitting there doing nothing. The lag is more than likely caused by this outdated and slow contraption known as dini, which opens and closes the file each time it writes a value.
That seems like a quick and very easy way to do it on the other hand as you mentioned how outdated dini is the issues go deeper than deleting files.
http://www.howtogeek.com/howto/ubunt...days-on-linux/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)