Move some code, now reserved slots should work with user accounts.
This commit is contained in:
parent
da5de78155
commit
456a7eb4bc
2 changed files with 34 additions and 37 deletions
|
|
@ -320,6 +320,40 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool HandleGetSection(GetDataHandlerArgs args)
|
||||||
|
{
|
||||||
|
if (args.Player.RequestedSection)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
args.Player.RequestedSection = true;
|
||||||
|
if (TShock.HackedHealth(args.Player))
|
||||||
|
{
|
||||||
|
TShock.Utils.ForceKick(args.Player, "You have Hacked Health/Mana, Please use a different character.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TShock.Utils.ActivePlayers() + 1 > TShock.Config.MaxSlots && !args.Player.Group.HasPermission(Permissions.reservedslot))
|
||||||
|
{
|
||||||
|
TShock.Utils.ForceKick(args.Player, TShock.Config.ServerFullReason);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
NetMessage.SendData((int)PacketTypes.TimeSet, -1, -1, "", 0, 0, Main.sunModY, Main.moonModY);
|
||||||
|
|
||||||
|
if (TShock.Config.EnableGeoIP && TShock.Geo != null)
|
||||||
|
{
|
||||||
|
Log.Info(string.Format("{0} ({1}) from '{2}' group from '{3}' joined. ({4}/{5})", args.Player.Name, args.Player.IP, args.Player.Group.Name, args.Player.Country, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots));
|
||||||
|
TShock.Utils.Broadcast(args.Player.Name + " has joined from the " + args.Player.Country, Color.Yellow);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Info(string.Format("{0} ({1}) from '{2}' group joined. ({3}/{4})", args.Player.Name, args.Player.IP, args.Player.Group.Name, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots));
|
||||||
|
TShock.Utils.Broadcast(args.Player.Name + " has joined", Color.Yellow);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TShock.Config.DisplayIPToAdmins)
|
||||||
|
TShock.Utils.SendLogs(string.Format("{0} has joined. IP: {1}", args.Player.Name, args.Player.IP), Color.Blue);
|
||||||
|
}
|
||||||
|
|
||||||
private static bool HandleSendTileSquare(GetDataHandlerArgs args)
|
private static bool HandleSendTileSquare(GetDataHandlerArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -1143,15 +1177,6 @@ namespace TShockAPI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool HandleGetSection(GetDataHandlerArgs args)
|
|
||||||
{
|
|
||||||
if (args.Player.RequestedSection)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
args.Player.RequestedSection = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool UpdateNPCHome(GetDataHandlerArgs args)
|
private static bool UpdateNPCHome(GetDataHandlerArgs args)
|
||||||
{
|
{
|
||||||
var id = args.Data.ReadInt16();
|
var id = args.Data.ReadInt16();
|
||||||
|
|
|
||||||
|
|
@ -604,18 +604,6 @@ namespace TShockAPI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HackedHealth(player))
|
|
||||||
{
|
|
||||||
TShock.Utils.ForceKick(player, "You have Hacked Health/Mana, Please use a different character.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TShock.Utils.ActivePlayers() + 1 > Config.MaxSlots && !player.Group.HasPermission(Permissions.reservedslot))
|
|
||||||
{
|
|
||||||
TShock.Utils.ForceKick(player, Config.ServerFullReason);
|
|
||||||
handler.Handled = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var nameban = Bans.GetBanByName(player.Name);
|
var nameban = Bans.GetBanByName(player.Name);
|
||||||
Ban ban = null;
|
Ban ban = null;
|
||||||
if (nameban != null && Config.EnableBanOnUsernames)
|
if (nameban != null && Config.EnableBanOnUsernames)
|
||||||
|
|
@ -627,22 +615,6 @@ namespace TShockAPI
|
||||||
handler.Handled = true;
|
handler.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NetMessage.SendData((int)PacketTypes.TimeSet, -1, -1, "", 0, 0, Main.sunModY, Main.moonModY);
|
|
||||||
|
|
||||||
if (TShock.Config.EnableGeoIP && TShock.Geo != null)
|
|
||||||
{
|
|
||||||
Log.Info(string.Format("{0} ({1}) from '{2}' group from '{3}' joined. ({3}/{4})", player.Name, player.IP, player.Group.Name, player.Country, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots));
|
|
||||||
TShock.Utils.Broadcast(player.Name + " has joined from the " + player.Country, Color.Yellow);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log.Info(string.Format("{0} ({1}) from '{2}' group joined. ({3}/{4})", player.Name, player.IP, player.Group.Name, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots));
|
|
||||||
TShock.Utils.Broadcast(player.Name + " has joined", Color.Yellow);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TShock.Config.DisplayIPToAdmins)
|
|
||||||
TShock.Utils.SendLogs(string.Format("{0} has joined. IP: {1}", player.Name, player.IP), Color.Blue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLeave(int ply)
|
private void OnLeave(int ply)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue