mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-08-02 16:13:17 -05:00
Filter out your own pokemon from search results
This commit is contained in:
parent
334e63466e
commit
007c15b78b
|
|
@ -325,7 +325,7 @@ namespace PokeFoundations.GTS
|
|||
if (data.Length > 11) country = data[11];
|
||||
|
||||
if (resultsCount > 7) resultsCount = 7; // stop DDOS
|
||||
GtsDatagram4[] datagrams = DataAbstract.Instance.GtsSearch4(species, gender, minLevel, maxLevel, country, resultsCount);
|
||||
GtsDatagram4[] datagrams = DataAbstract.Instance.GtsSearch4(pid, species, gender, minLevel, maxLevel, country, resultsCount);
|
||||
foreach (GtsDatagram4 datagram in datagrams)
|
||||
{
|
||||
context.Response.OutputStream.Write(datagram.Save(), 0, 292);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace PokeFoundations.Data
|
|||
public abstract bool GtsTradePokemon4(int pidSrc, int pidDest);
|
||||
public abstract bool GtsTradePokemon4(GtsDatagram4 upload, GtsDatagram4 result);
|
||||
|
||||
public abstract GtsDatagram4[] GtsSearch4(ushort species, Genders gender, byte minLevel, byte maxLevel, byte country, int count);
|
||||
public abstract GtsDatagram4[] GtsSearch4(int pid, ushort species, Genders gender, byte minLevel, byte maxLevel, byte country, int count);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,12 +203,13 @@ namespace PokeFoundations.Data
|
|||
}
|
||||
}
|
||||
|
||||
public override GtsDatagram4[] GtsSearch4(ushort species, Genders gender, byte minLevel, byte maxLevel, byte country, int count)
|
||||
public override GtsDatagram4[] GtsSearch4(int pid, ushort species, Genders gender, byte minLevel, byte maxLevel, byte country, int count)
|
||||
{
|
||||
using (MySqlConnection db = CreateConnection())
|
||||
{
|
||||
List<MySqlParameter> _params = new List<MySqlParameter>();
|
||||
String where = "WHERE Species = @species";
|
||||
String where = "WHERE pid != @pid AND Species = @species";
|
||||
_params.Add(new MySqlParameter("@pid", pid));
|
||||
_params.Add(new MySqlParameter("@species", species));
|
||||
|
||||
if (gender != Genders.Either)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user