mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-25 22:30:52 -04:00
Fix money changes from zombie survival not being saved.
This commit is contained in:
parent
b171a9776d
commit
bdf297c4c1
@ -109,7 +109,7 @@ namespace MCGalaxy.Eco {
|
||||
case "maximumrank":
|
||||
Group grp = Group.Find(args[2]);
|
||||
if (grp == null) { Player.SendMessage(p, "%cThat wasn't a rank!"); return; }
|
||||
if (p.group.Permission < grp.Permission) { Player.SendMessage(p, "%cCan't set a maxrank that is higher than yours!"); return; }
|
||||
if (p != null && p.group.Permission < grp.Permission) { Player.SendMessage(p, "%cCan't set a maxrank that is higher than yours!"); return; }
|
||||
MaxRank = args[2].ToLower();
|
||||
Player.SendMessage(p, "%aSuccessfully set max rank to: " + grp.color + grp.name);
|
||||
UpdatePrices();
|
||||
|
@ -173,8 +173,8 @@ namespace MCGalaxy.Games {
|
||||
if (lastPlayerToInfect == pKiller.name) {
|
||||
infectCombo++;
|
||||
if (infectCombo >= 2) {
|
||||
pKiller.SendMessage("You gained " + (4 + infectCombo) + " " + Server.moneys);
|
||||
pKiller.money += 4 + infectCombo;
|
||||
pKiller.SendMessage("You gained " + (2 + infectCombo) + " " + Server.moneys);
|
||||
pKiller.money += 2 + infectCombo;
|
||||
pKiller.OnMoneyChanged();
|
||||
CurrentLevel.ChatLevel(pKiller.FullName + " is on a rampage! " + (infectCombo + 1) + " infections in a row!");
|
||||
}
|
||||
@ -321,8 +321,6 @@ namespace MCGalaxy.Games {
|
||||
playersString += p.color + p.DisplayName + Colors.white + ", ";
|
||||
}
|
||||
|
||||
static string Eq(string src, string a, string b) { return src == a || src == b; }
|
||||
|
||||
void ChooseNextLevel() {
|
||||
if (QueuedLevel != null) { ChangeLevel(QueuedLevel); return; }
|
||||
if (!ChangeLevels) return;
|
||||
|
@ -140,7 +140,7 @@ namespace MCGalaxy {
|
||||
//Using for anything else can cause unintended effects!
|
||||
public bool canBuild = true;
|
||||
|
||||
public int money = 0;
|
||||
public int money = 0, loginMoney = 0;
|
||||
public long overallBlocks = 0;
|
||||
|
||||
public int loginBlocks = 0;
|
||||
@ -372,7 +372,7 @@ namespace MCGalaxy {
|
||||
|
||||
public void save() {
|
||||
//safe against SQL injects because no user input is provided
|
||||
string commandString =
|
||||
string query =
|
||||
"UPDATE Players SET IP='" + ip + "'" +
|
||||
", LastLogin='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'" +
|
||||
", totalLogin=" + totalLogins +
|
||||
@ -383,13 +383,18 @@ namespace MCGalaxy {
|
||||
", TimeSpent='" + time.ToDBTime() +
|
||||
"' WHERE Name='" + name + "'";
|
||||
if ( MySQLSave != null )
|
||||
MySQLSave(this, commandString);
|
||||
OnMySQLSaveEvent.Call(this, commandString);
|
||||
MySQLSave(this, query);
|
||||
OnMySQLSaveEvent.Call(this, query);
|
||||
if ( cancelmysql ) {
|
||||
cancelmysql = false;
|
||||
return;
|
||||
}
|
||||
Database.executeQuery(commandString);
|
||||
Database.executeQuery(query);
|
||||
if (Economy.Enabled && loginMoney != money) {
|
||||
Economy.EcoStats ecos = Economy.RetrieveEcoStats(name);
|
||||
ecos.money = money;
|
||||
Economy.UpdateEcoStats(ecos);
|
||||
}
|
||||
|
||||
try {
|
||||
if ( !smileySaved ) {
|
||||
|
@ -158,6 +158,7 @@ namespace MCGalaxy {
|
||||
p.overallBlocks = long.Parse(row["totalBlocks"].ToString().Trim());
|
||||
//money = int.Parse(playerDb.Rows[0]["Money"].ToString());
|
||||
p.money = Economy.RetrieveEcoStats(p.name).money;
|
||||
p.loginMoney = p.money;
|
||||
p.totalKicked = int.Parse(row["totalKicked"].ToString());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user