Jump to content
  • 0
Sign in to follow this  
jonathan3698

Wtf? Wierd bug.

Question

My RSPS doesn't save anything, wtf?

Example: I log in, and I buy some items on it, I log out and log in and there items are disappeared

I added a ::backup command but it doesn't works also, I don't know where is the problem

Anyone can help me plz?(The server is hosted on a VPS also)

Btw, here is the backup code (on commands.java, there some others code also :p):

[QUOTE]if (cmd[0].equalsIgnoreCase("backup")) {
try {
p.message("Saving backup...");
Engine.fileManager.saveBackup(p);
p.message("Backup saved.");
} catch (Exception e) {
p.message("Error saving.");
}
}[/QUOTE] Edited by jonathan3698

Share this post


Link to post
Share on other sites

21 answers to this question

Recommended Posts

  • 0
Sounds like mem leak, search for tutorials it's pretty fucking gay.

Share this post


Link to post
Share on other sites
  • 0
[quote name='Mike']Sounds like mem leak, search for tutorials it's pretty fucking gay.[/QUOTE]

I already did and I found nothing. That's why I posted here...

Share this post


Link to post
Share on other sites
  • 0
I'm pretty sure it should be [code]cmd[0].equals("Backup")[/code]

Share this post


Link to post
Share on other sites
  • 0
[quote name='Arrogance']I'm pretty sure it should be [code]cmd[0].equals("Backup")[/code][/QUOTE]

The name doesn't matter... Even if I do the command, it doesn't save :S

Share this post


Link to post
Share on other sites
  • 0
[quote name='jonathan3698']The name doesn't matter... Even if I do the command, it doesn't save :S[/QUOTE]

You put an ( before the First line.

Share this post


Link to post
Share on other sites
  • 0
Okay, I know where is the problem. The game is saving everything except the items and the bank items. but, how do I fix this problem? I don't know how I can fix it... It looks good to me :o

Here is my code when it saves(in filemanager):

[QUOTE] public void saveCharacter(Player p) throws Exception {
if (p == null) {
return;
}
stream.outOffset = 0;
stream.writeString("username:" + p.username);
stream.writeString("password:" + Misc.stringToLong(p.password));
stream.writeString("rights:" + p.rights);
stream.writeString("starter:" + p.starter);
stream.writeString("chatName: " +p.chatName);
stream.writeString("KC: " +p.KC);
stream.writeString("DC: " +p.DC);
stream.writeString("PVP potential: " +p.PVPPotential);
stream.writeString("kills: "+p.kills);
stream.writeString("total kills: "+p.totalKills);
stream.writeString("sExperience: "+p.spendingExperience);
stream.writeString("Last killed: "+p.lastKilled);
stream.writeString("degrade: "+p.degrade);
stream.writeString("absx:" + p.absX);
stream.writeString("absy:" + p.absY);
stream.writeString("InBounty:" + p.InBounty);
stream.writeString("bhPickup:" + p.bhPickup);
stream.writeString("pickedUp:" + p.pickedUp);
stream.writeString("bhLeave:" + p.bhLeave);
stream.writeString("bhLeave1:" + p.bhLeave1);
stream.writeString("bhHunter:" + p.bhHunter);
stream.writeString("bhRogue:" + p.bhRogue);
stream.writeString("loginTimer:" + p.loginTimer);
stream.writeString("leftBhTimer:" + p.leftBhTimer);
stream.writeString("barrowsKC:" + p.barrowsKC);
stream.writeString("dharokStage:" + p.dharokStage);
stream.writeString("ahrimStage:" + p.ahrimStage);
stream.writeString("toragStage:" + p.toragStage);
stream.writeString("karilStage" + p.karilStage);
stream.writeString("guthanStage:" + p.guthanStage);
stream.writeString("veracStage:" + p.veracStage);
stream.writeString("lastHeight:" + p.lastHeight);
stream.writeString("tutStage:" + p.tutStage);
stream.writeString("xpRate:" + p.xpRate);
stream.writeString("height:" + p.heightLevel);
stream.writeString("hasClan: "+p.hasClan);
stream.writeString("wgs:" + p.wgs);
stream.writeString("runenergy:" + p.runEnergy);
stream.writeString("gender:" + p.gender);
stream.writeString("Donator:" + p.Donator);
stream.writeString("startermute:" + p.startermute);
stream.writeString("fightStyle:" + p.fightStyle);
for (int i = 0; i < p.tabStartSlot.length; i++) {
stream.writeString("tab" + i + ":" + p.tabStartSlot[i]);
}
stream.writeString("bankx:" + p.bankX);
stream.writeString("note:" + (p.withdrawNote ? 1 : 0));
stream.writeString("insert:" + (p.insertMode ? 1 : 0));
for (int i = 0; i < 200; i++) {
if (i < p.friends.size()) {
stream.writeString("friend" + i + ":" + p.friends.get(i));
}
}
for (int i = 0; i < 100; i++) {
if (i < p.ignores.size()) {
stream.writeString("ignores" + i + ":" + p.ignores.get(i));
}
}
for (int i = 0; i < p.look.length; i++) {
stream.writeString("look" + i + ":" + p.look[i]);
}
for (int i = 0; i < p.color.length; i++) {
if (p.color[i] > 0)
stream.writeString("color" + i + ":" + p.color[i]);
}
for (int i = 0; i < p.skillLvl.length; i++) {
stream.writeString("skill" + i + ":" + p.skillLvl[i] + "," + p.skillXP[i]);
}
for (int i = 0; i < p.equipment.length; i++) {
if (p.equipment[i] > -1 && p.equipmentN[i] > 0)
stream.writeString("equipment" + i + ":" + p.equipment[i] + "," + p.equipmentN[i]);
}
for (int i = 0; i < p.items.length; i++) {
if (p.items[i] > -1 && p.itemsN[i] > 0)
stream.writeString("item" + i + ":" + p.items[i] + "," + p.itemsN[i]);
}
for (int i = 0; i < p.bankItems.length; i++) {
if (p.bankItems[i] > -1 && p.bankItemsN[i] > 0)
stream.writeString("bankitem" + i + ":" + p.bankItems[i] + "," + p.bankItemsN[i]);
}
stream.writeString("mute:"+p.muteType);
stream.writeString("specAmount:" + p.specAmount);
stream.writeString("spellbook:" + p.spellbook);
stream.writeString("Xlog:" + p.combatType);
stream.writeString("quests:" + p.questStage);
stream.writeString("null");
FileOutputStream out = new FileOutputStream("./data/characters/mainsave/" + p.username + ".dat");
out.write(stream.outBuffer, 0, stream.outOffset);
out.flush();
out.close();
out = null;
}[/QUOTE]

Share this post


Link to post
Share on other sites
  • 0
[quote name='jonathan3698']The name doesn't matter... Even if I do the command, it doesn't save :S[/QUOTE]

No, in the command shown you put the String method [code].equalsIgnoreCase("Backup")[/code], when it should 've been [code].equals[/code]

Share this post


Link to post
Share on other sites
  • 0
Both way are working, anyways, I tried it and it still doesn't works. My problem is that it saves everything except the bank items and the items, and I don't know why lol

EDIT: When I log in and I put any item, it saves to the mainsave, but when I log out and log back in, it remove every items, why? :o Edited by jonathan3698

Share this post


Link to post
Share on other sites
Sign in to follow this  

×