mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-09-08 10:15:13 -05:00
Fixed database regression causing a comm error when you try to take your pokemon out of the GTS.
This commit is contained in:
@@ -135,18 +135,18 @@ namespace PkmnFoundations.Data
|
||||
}
|
||||
}
|
||||
|
||||
public int GtsGetDepositId4(int pid, MySqlTransaction tran)
|
||||
public ulong GtsGetDepositId4(int pid, MySqlTransaction tran)
|
||||
{
|
||||
object o = tran.ExecuteScalar("SELECT id FROM GtsPokemon4 WHERE pid = @pid " +
|
||||
"ORDER BY IsExchanged DESC, TimeExchanged, TimeDeposited LIMIT 1",
|
||||
new MySqlParameter("@pid", pid));
|
||||
if (o == null || o == DBNull.Value) return 0;
|
||||
return (int)((uint)o);
|
||||
return Convert.ToUInt64(o);
|
||||
}
|
||||
|
||||
public bool GtsDeletePokemon4(MySqlTransaction tran, int pid)
|
||||
{
|
||||
int pkmnId = GtsGetDepositId4(pid, tran);
|
||||
ulong pkmnId = GtsGetDepositId4(pid, tran);
|
||||
if (pkmnId == 0) return false;
|
||||
|
||||
tran.ExecuteNonQuery("DELETE FROM GtsPokemon4 WHERE id = @id",
|
||||
@@ -974,18 +974,18 @@ namespace PkmnFoundations.Data
|
||||
}
|
||||
}
|
||||
|
||||
public int GtsGetDepositId5(int pid, MySqlTransaction tran)
|
||||
public ulong GtsGetDepositId5(int pid, MySqlTransaction tran)
|
||||
{
|
||||
object o = tran.ExecuteScalar("SELECT id FROM GtsPokemon5 WHERE pid = @pid " +
|
||||
"ORDER BY IsExchanged DESC, TimeExchanged, TimeDeposited LIMIT 1",
|
||||
new MySqlParameter("@pid", pid));
|
||||
if (o == null || o == DBNull.Value) return 0;
|
||||
return (int)((uint)o);
|
||||
return Convert.ToUInt64(o);
|
||||
}
|
||||
|
||||
public bool GtsDeletePokemon5(MySqlTransaction tran, int pid)
|
||||
{
|
||||
int pkmnId = GtsGetDepositId5(pid, tran);
|
||||
ulong pkmnId = GtsGetDepositId5(pid, tran);
|
||||
if (pkmnId == 0) return false;
|
||||
|
||||
tran.ExecuteNonQuery("DELETE FROM GtsPokemon5 WHERE id = @id",
|
||||
|
||||
Reference in New Issue
Block a user