mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-09-10 11:15:14 -05:00
Added abstract GtsRecordBase.Validate(is_exchanged)
This commit is contained in:
@@ -226,7 +226,7 @@ namespace PkmnFoundations.GTS
|
||||
byte[] recordBinary = new byte[292];
|
||||
Array.Copy(data, 0, recordBinary, 0, 292);
|
||||
GtsRecord4 record = new GtsRecord4(pokedex, recordBinary);
|
||||
if (!record.Validate())
|
||||
if (!record.Validate(false))
|
||||
{
|
||||
// hack check failed
|
||||
SessionManager.Remove(session);
|
||||
@@ -357,7 +357,7 @@ namespace PkmnFoundations.GTS
|
||||
}
|
||||
|
||||
// enforce request requirements server side
|
||||
if (!upload.Validate() || !upload.CanTrade(result))
|
||||
if (!upload.Validate(true) || !upload.CanTrade(result))
|
||||
{
|
||||
// todo: find the correct codes for these
|
||||
SessionManager.Remove(session);
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace PkmnFoundations.GTS
|
||||
// appears to be 4 bytes of 00, 128 bytes of stuff, 4 bytes of 80 00 00 00
|
||||
// probably a pkvldtprod signature
|
||||
|
||||
if (!record.Validate())
|
||||
if (!record.Validate(false))
|
||||
{
|
||||
// hack check failed
|
||||
// todo: test that 0c 00 is the correct code for GenV
|
||||
@@ -356,7 +356,7 @@ namespace PkmnFoundations.GTS
|
||||
}
|
||||
|
||||
// enforce request requirements server side
|
||||
if (!upload.Validate() || !upload.CanTrade(result))
|
||||
if (!upload.Validate(true) || !upload.CanTrade(result))
|
||||
{
|
||||
// todo: find the correct codes for these
|
||||
SessionManager.Remove(session);
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace PkmnFoundations.Structures
|
||||
return new GtsRecord4(m_pokedex, Save());
|
||||
}
|
||||
|
||||
public bool Validate()
|
||||
public override bool Validate(bool is_exchanged)
|
||||
{
|
||||
// todo: a. legitimacy check, and b. check that pkm data matches metadata
|
||||
return true;
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace PkmnFoundations.Structures
|
||||
return new GtsRecord5(m_pokedex, Save());
|
||||
}
|
||||
|
||||
public bool Validate()
|
||||
public override bool Validate(bool is_exchanged)
|
||||
{
|
||||
// todo: a. legitimacy check, and b. check that pkm data matches metadata
|
||||
return true;
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace PkmnFoundations.Structures
|
||||
public byte TrainerRegion;
|
||||
public byte TrainerClass;
|
||||
|
||||
public abstract String TrainerName
|
||||
public abstract string TrainerName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
@@ -80,6 +80,8 @@ namespace PkmnFoundations.Structures
|
||||
public byte TrainerVersion;
|
||||
public byte TrainerLanguage;
|
||||
|
||||
public abstract bool Validate(bool is_exchanged);
|
||||
|
||||
public static bool CheckLevels(byte min, byte max, byte other)
|
||||
{
|
||||
if (max == 0) max = 255;
|
||||
|
||||
Reference in New Issue
Block a user