Spawning in nexus without perms
While I was testing out some custom items, I noticed that a kid was spawning in the nexus, even though he was rank 0(Default). This has already happened with 2 accounts. When I get on my alt, I cant spawn.
- - - Updated - - -
Nevermind not only random people can spawn. If anyone does /spawn 1(or any number) Hermit God, it will spawn. If anyone does /spawn Hermit God it wont.
/spawn code
Code:
internal class SpawnCommand : Command
{
public SpawnCommand()
: base("spawn", 0)
{
}
protected override bool Process(Player player, RealmTime time, string[] args)
{
int num;
if (args.Length > 0 && int.TryParse(args[0], out num)) //multi
{
string name = string.Join(" ", args.Skip(1).ToArray());
ushort objType;
//creates a new case insensitive dictionary based on the XmlDatas
Dictionary<string, ushort> icdatas = new Dictionary<string, ushort>(
player.Manager.GameData.IdToObjectType,
StringComparer.OrdinalIgnoreCase);
if (!icdatas.TryGetValue(name, out objType) ||
!player.Manager.GameData.ObjectDescs.ContainsKey(objType))
{
player.SendInfo("Unknown entity!");
return false;
}
int c = int.Parse(args[0]);
if (!(player.Client.Account.Rank > 2) && c > 200)
{
player.SendError("Maximum spawn count is set to 200!");
return false;
}
if (player.Client.Account.Rank > 2 && c > 200)
{
player.SendInfo("Bypass made!");
}
for (int i = 0; i < num; i++)
{
Entity entity = Entity.Resolve(player.Manager, objType);
entity.Move(player.X, player.Y);
player.Owner.EnterWorld(entity);
}
player.SendInfo("Success!");
}
else
{
string name = string.Join(" ", args);
ushort objType;
//creates a new case insensitive dictionary based on the XmlDatas
Dictionary<string, ushort> icdatas = new Dictionary<string, ushort>(
player.Manager.GameData.IdToObjectType,
StringComparer.OrdinalIgnoreCase);
if (!icdatas.TryGetValue(name, out objType) ||
!player.Manager.GameData.ObjectDescs.ContainsKey(objType))
{
player.SendHelp("Usage: /spawn <entityname>");
return false;
}
if (player.Client.Account.Rank != 3 && player.Client.Account.Rank != 1)
{
return false;
}
Entity entity = Entity.Resolve(player.Manager, objType);
entity.Move(player.X, player.Y);
player.Owner.EnterWorld(entity);
}
return true;
}
}
- - - Updated - - -
Nevermind not only random people can spawn. If anyone does /spawn 1(or any number) Hermit God, it will spawn. If anyone does /spawn Hermit God it wont.