View previous topic :: View next topic |
Author |
Message |
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Tue Aug 13, 2013 20:21 Post subject: Baby Got Back? |
|
|
I'm trying to use the nwnx_systemdata32 to backup characters by moving them to another folder for 7 days before they're actually deleted. The part that checks the folder(on server startup) works without a hitch, but ACTUALLY moving the file to the other folder always seems to fail no matter what I do. Log below:
NWNX Systemdata V.2.2
Created By Terra_777
o 225 <- STRFTIME( ~j, 0, , , );
o 13 <- STRFTIME( ~H, 0, , , );
o NeverwinterNightsNWNsavesCharacter Backup <- GETFIRSTFILE( C:NeverwinterNightsNWNsavesCharacter Backup, , , , );
o 1376424315 <- GETFILEUNIX( 1, NeverwinterNightsNWNsavesCharacter Backup, , , );
o 225 <- STRFTIME( ~j, 1376424315, , , );
o 0 <- GETNEXTFILE( , , , , );
o 0 <- GETLASTUSEDFILE( C:NeverwinterNightsNWNservervaulthighv priest, , , , );
o 0 <- COPYFILE( 0, C:NeverwinterNightsNWNsavesCharacter Backup, 0, , );
The paths are:
Original folder = C:\NeverwinterNights\NWN\servervault
Destination folder = C:\NeverwinterNights\NWN\saves\Character Backup
Code involved here:
Code: | void ClearBackup(string SystemDay, string SystemHour)
{
string sPath = "C:\NeverwinterNights\NWN\saves\Character Backup\";
string sFirst = NWNX_GetFirstFile(sPath);
int Stamp;
int nSystemDay = StringToInt(SystemDay);
int nSystemHour = StringToInt(SystemHour)+6;
while(sFirst != "0")
{
Stamp = NWNX_GetTimeStampFromFile(1, sFirst);
if(nSystemDay >= StringToInt(NWNX_RealLifeClock("%j", Stamp))+7)
{
if(nSystemHour >= StringToInt(NWNX_RealLifeClock("%H", Stamp)))
{
NWNX_DeleteFile(sFirst);
}
}
sFirst = NWNX_GetNextFile();
}
} |
Code: | string BicFile = GetBicPath(oPC);
string sGuild = GetGuildName(oPC);
string sOrigin = NWNX_GetLatestUsedFile("C:\NeverwinterNights\NWN\servervault\"+GetPCPlayerName(oPC)+"\");
if(GetItemPossessedBy(oPC, "Storage_Box1") != OBJECT_INVALID)
{
StoreBoxes(oPC);
}
if(GetStringLeft(GetName(oPC), 6) != "<TEST>")
{
if(sGuild != "")
{
string sPrivateXP = RetrieveGuildBankAmount(sGuild, 0, 1, oPC);
string sPrivateGP = RetrieveGuildBankAmount(sGuild, 0, 0, oPC);
int nPrivateXP = StringToInt(sPrivateXP);
int nPrivateGP = StringToInt(sPrivateGP);
SetGuildBankAmount(sGuild, 0, 1, nPrivateXP+GetXP(oPC), oPC);
SetGuildBankAmount(sGuild, 0, 0, nPrivateGP+GetGold(oPC), oPC);
}
NWNX_CopyFile(sOrigin, "C:\NeverwinterNights\NWN\saves\Character Backup\");
}[quote][/quote] |
|
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Tue Aug 20, 2013 20:29 Post subject: |
|
|
Now I'm having a different issue. After you specified that I did some more testing and found multiple issues in my implementation of it.
o 232 <- STRFTIME( ~j, 0, , , );
o 13 <- STRFTIME( ~H, 0, , , );
o loreklenner.bic <- GETFIRSTFILE( C:/NeverwinterNights/NWN/saves/Character Backup/*.bic, , , , );
o 0 <- GETFILEUNIX( 3, loreklenner.bic, , , );
o 232 <- STRFTIME( ~j, 0, , , );
o reaper.bic <- GETNEXTFILE( , , , , );
o 0 <- GETFILEUNIX( 3, reaper.bic, , , );
o 232 <- STRFTIME( ~j, 0, , , );
o 0 <- GETNEXTFILE( , , , , );
The copy function now works great(thanks for the help there), but as you can see GETFILEUNIX ALWAYS gets 0... but I can't understand why because the file is valid. |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Tue Aug 20, 2013 21:25 Post subject: |
|
|
Missing the filepath to loreklenner.bic _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|