mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-04-24 15:26:48 -05:00
Check savefile bans the same way as mac bans.
This commit is contained in:
parent
e8910ea3f6
commit
545cfa383e
|
|
@ -66,13 +66,6 @@ namespace PkmnFoundations.GTS
|
|||
Array.Copy(data, 0, profileBinary, 0, 100);
|
||||
TrainerProfile4 profile = new TrainerProfile4(pid, profileBinary, IpAddressHelper.GetIpAddress(context.Request));
|
||||
Database.Instance.GamestatsSetProfile4(profile);
|
||||
|
||||
BanStatus ban = Database.Instance.CheckBanStatus(profile);
|
||||
if (ban != null && ban.Level > BanLevels.Restricted)
|
||||
{
|
||||
ShowError(context, 403);
|
||||
return;
|
||||
}
|
||||
#if !DEBUG
|
||||
}
|
||||
catch { }
|
||||
|
|
|
|||
|
|
@ -16,8 +16,10 @@ namespace PkmnFoundations.GTS
|
|||
BanStatus pidBan = Database.Instance.CheckBanStatus(pid);
|
||||
BanStatus ipBan = Database.Instance.CheckBanStatus(IpAddress);
|
||||
BanStatus macBan = null;
|
||||
BanStatus saveBan = null;
|
||||
BanStatus ipRangeBan = null;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
switch (generation)
|
||||
|
|
@ -26,12 +28,14 @@ namespace PkmnFoundations.GTS
|
|||
{
|
||||
var profile = Database.Instance.GamestatsGetProfile4(pid);
|
||||
macBan = Database.Instance.CheckBanStatus(profile.MacAddress);
|
||||
saveBan = Database.Instance.CheckBanStatus(profile);
|
||||
break;
|
||||
}
|
||||
case Generations.Generation5:
|
||||
{
|
||||
var profile = Database.Instance.GamestatsGetProfile5(pid);
|
||||
macBan = Database.Instance.CheckBanStatus(profile.MacAddress);
|
||||
saveBan = Database.Instance.CheckBanStatus(profile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -49,7 +53,7 @@ namespace PkmnFoundations.GTS
|
|||
{
|
||||
}
|
||||
|
||||
return new[] { pidBan, ipBan, macBan, ipRangeBan }.Where(ban => ban != null).OrderBy(ban => ban.Level).LastOrDefault();
|
||||
return new[] { pidBan, ipBan, macBan, saveBan, ipRangeBan }.Where(ban => ban != null).OrderBy(ban => ban.Level).LastOrDefault();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -66,13 +66,6 @@ namespace PkmnFoundations.GTS
|
|||
Array.Copy(request, 0, profileBinary, 0, 100);
|
||||
TrainerProfile5 profile = new TrainerProfile5(pid, profileBinary, IpAddressHelper.GetIpAddress(context.Request));
|
||||
Database.Instance.GamestatsSetProfile5(profile);
|
||||
|
||||
BanStatus ban = Database.Instance.CheckBanStatus(profile);
|
||||
if (ban != null && ban.Level > BanLevels.Restricted)
|
||||
{
|
||||
ShowError(context, 403);
|
||||
return;
|
||||
}
|
||||
#if !DEBUG
|
||||
}
|
||||
catch { }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user