Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zeng-github01 committed Jul 15, 2024
1 parent da222e6 commit f216c48
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CDK/CDKCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private void ExecuteUconomy(UnturnedPlayer player, CDKData cdkdata)
Uconomy.Instance.Database.IncreaseBalance(player.Id, cdkdata.Money.Value);
UnturnedChat.Say(player,
Main.Instance.Translate("uconomy_gain", cdkdata.Money.Value,
Uconomy.Instance.Configuration.Instance.MoneyName));
Uconomy.Instance.Configuration.Instance.MoneyName), Main.Instance.Configuration.Instance.EnableRichText);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion CDK/Data/CDKData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class CDKData
public string Items { get; internal set; }
public string Amount { get; internal set; }
public string Vehicle { get; internal set; }
public ushort? Experience { get; internal set; }
public uint? Experience { get; internal set; }
public decimal? Money { get; internal set; }
public int? Reputation { get; internal set; }
public string GrantPermissionGroup { get; internal set; }
Expand Down
12 changes: 10 additions & 2 deletions CDK/DatabaseManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal void CheckValid(UnturnedPlayer player)
{
CDKData cDKData = GetCDKData(log.CDK);
R.Permissions.RemovePlayerFromGroup(cDKData.GrantPermissionGroup, player);
UnturnedChat.Say(player, Main.Instance.Translate("key_expired", log.CDK));
UnturnedChat.Say(player, Main.Instance.Translate("key_expired", log.CDK), Main.Instance.Configuration.Instance.EnableRichText);
}
}
}
Expand Down Expand Up @@ -223,7 +223,7 @@ private void CheckSchema() // intial mysql table
{
ExecuteQuery(true,
$"ALTER TABLE `{Main.Instance.Configuration.Instance.DatabaseRedeemLogTableName}` ADD foreign key(`CDK`) references {Main.Instance.Configuration.Instance.DatabaseCDKTableName}(`CDK`) on DELETE cascade on update cascade ");
Main.Instance.Configuration.Instance.MySQLTableVer = 5;
Main.Instance.Configuration.Instance.MySQLTableVer++;
Main.Instance.Configuration.Save();
}

Expand All @@ -234,6 +234,14 @@ private void CheckSchema() // intial mysql table
Main.Instance.Configuration.Instance.MySQLTableVer++;
Main.Instance.Configuration.Save();
}

if(Main.Instance.Configuration.Instance.MySQLTableVer == 6)
{
ExecuteQuery(true,
$"ALTER TABLE `{Main.Instance.Configuration.Instance.DatabaseCDKTableName}` MODIFY `Experience` INT(32) UNSIGNED");
Main.Instance.Configuration.Instance.MySQLTableVer++;
Main.Instance.Configuration.Save();
}
}

private MySqlConnection CreateConnection()
Expand Down

0 comments on commit f216c48

Please sign in to comment.