mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-13 09:15:59 -04:00
Modularise Player sql database calls and online player searching into separate PlayerInfo class.
This commit is contained in:
parent
3185e0ca5f
commit
2e53946e4d
@ -25,7 +25,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (message.Split(' ').Length > 1)
|
||||
{
|
||||
targetPlayer = Player.Find(message.Split(' ')[0].Trim());
|
||||
targetPlayer = PlayerInfo.Find(message.Split(' ')[0].Trim());
|
||||
if (targetPlayer == null)
|
||||
{
|
||||
Player.SendMessage(p, "Player \"" + message.Split(' ')[0].Trim() + "\" does not exist");
|
||||
@ -46,7 +46,7 @@ namespace MCGalaxy.Commands
|
||||
p.model = model;
|
||||
}
|
||||
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
{
|
||||
if (pl.level == targetPlayer.level && pl.HasCpeExt(CpeExt.ChangeModel))
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
if (!canDeleteForce) {
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (pl != p && pl.Chatroom == room) {
|
||||
Player.SendMessage(p, "Sorry, someone else is in the chatroom");
|
||||
return;
|
||||
@ -144,7 +144,7 @@ namespace MCGalaxy.Commands {
|
||||
HandleLeave(p);
|
||||
Server.Chatrooms.Remove(room);
|
||||
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (pl.Chatroom == room) {
|
||||
pl.Chatroom = null;
|
||||
Player.SendMessage(pl, "You left the chatroom '" + room + "' because it is being deleted");
|
||||
@ -199,7 +199,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
string name = parts[1], room = parts[2];
|
||||
Player pl = Player.Find(name);
|
||||
Player pl = PlayerInfo.Find(name);
|
||||
if (pl == null) {
|
||||
Player.SendMessage(p, "There is no online player with the name '" + name + "'");
|
||||
return;
|
||||
@ -236,7 +236,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
string name = parts[1];
|
||||
Player pl = Player.Find(name);
|
||||
Player pl = PlayerInfo.Find(name);
|
||||
if (pl == null) {
|
||||
Player.SendMessage(p, "There is no online player with the name '" + name + "'");
|
||||
return;
|
||||
@ -272,7 +272,7 @@ namespace MCGalaxy.Commands {
|
||||
string room = parts[0];
|
||||
if (Server.Chatrooms.Contains(room)) {
|
||||
Player.SendMessage(p, "Players in room '" + room + "' :");
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (pl.Chatroom == room)
|
||||
Player.SendMessage(p, pl.color + pl.name);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands
|
||||
int i = 0;
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
Player.players.ForEach(delegate(Player p1) { BlankMessage(p1); });
|
||||
PlayerInfo.players.ForEach(delegate(Player p1) { BlankMessage(p1); });
|
||||
}
|
||||
Player.GlobalMessage("%4Global Chat Cleared.");
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null || who.hidden) {
|
||||
Player.SendMessage(p, "Could not find player specified."); return;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null || who.hidden) {
|
||||
Player.SendMessage(p, "Could not find player specified."); return;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
return;
|
||||
}
|
||||
Player who = Player.Find(message.Split(' ')[0]);
|
||||
Player who = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player specified!");
|
||||
|
@ -57,7 +57,7 @@ namespace MCGalaxy.Commands
|
||||
Player.SendMessage(p, "Could not find group specified!");
|
||||
return;
|
||||
}
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
{
|
||||
if (pl.group.name == findgroup.name)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null) { p.whisperTo = ""; p.whisper = false; Player.SendMessage(p, "Could not find player."); return; }
|
||||
if (who.hidden)
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ namespace MCGalaxy.Commands
|
||||
} else if (cmd == "ZONE") {
|
||||
HandleZoneCommand(p, arg, arg2);
|
||||
} else if (cmd == "KICKALL") {
|
||||
Player.players.ForEach(
|
||||
PlayerInfo.players.ForEach(
|
||||
delegate(Player pl)
|
||||
{
|
||||
if (pl.level == p.level && pl.name != p.name)
|
||||
@ -98,7 +98,7 @@ namespace MCGalaxy.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
Player kicked = Player.Find(arg);
|
||||
Player kicked = PlayerInfo.Find(arg);
|
||||
if (kicked == null) {
|
||||
p.SendMessage("Error: Player not found.");
|
||||
} else {
|
||||
@ -296,7 +296,7 @@ namespace MCGalaxy.Commands
|
||||
if (value == "") {
|
||||
Player.SendMessage(p, "You did not specify a name to blacklist from your map."); return;
|
||||
}
|
||||
Player blocked = Player.Find(value);
|
||||
Player blocked = PlayerInfo.Find(value);
|
||||
if (blocked.name.StartsWith(p.name)) { Player.SendMessage(p, "You can't blacklist yourself"); return; }
|
||||
if (blocked == null) { Player.SendMessage(p, "Cannot find player."); return; }
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
Player who = null;
|
||||
if (message == "") { who = p; message = p.name; } else { who = Player.Find(message); }
|
||||
if (message == "") { who = p; message = p.name; } else { who = PlayerInfo.Find(message); }
|
||||
if (Server.YesVotes >= 1 || Server.NoVotes >= 1)
|
||||
{
|
||||
Player.SendMessage(p, Colors.green + "Y: " + Server.YesVotes + Colors.red + " N: " + Server.NoVotes);
|
||||
|
@ -43,7 +43,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
|
||||
string foundPlayer = message.Split(' ')[0];
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who != null) foundPlayer = who.name;
|
||||
string awardName = message.Substring(message.IndexOf(' ') + 1);
|
||||
if (!Awards.awardExists(awardName))
|
||||
|
@ -42,7 +42,7 @@ namespace MCGalaxy.Commands
|
||||
if (message.Split(' ').Length == 2)
|
||||
{
|
||||
foundPlayer = message.Split(' ')[0];
|
||||
Player who = Player.Find(foundPlayer);
|
||||
Player who = PlayerInfo.Find(foundPlayer);
|
||||
if (who != null) foundPlayer = who.name;
|
||||
try
|
||||
{
|
||||
@ -65,14 +65,14 @@ namespace MCGalaxy.Commands
|
||||
catch
|
||||
{
|
||||
foundPlayer = message;
|
||||
Player who = Player.Find(foundPlayer);
|
||||
Player who = PlayerInfo.Find(foundPlayer);
|
||||
if (who != null) foundPlayer = who.name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foundPlayer = message;
|
||||
Player who = Player.Find(foundPlayer);
|
||||
Player who = PlayerInfo.Find(foundPlayer);
|
||||
if (who != null) foundPlayer = who.name;
|
||||
}
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ namespace MCGalaxy.Commands {
|
||||
case "amount":
|
||||
Economy.EcoStats ecostats;
|
||||
if (par1 != string.Empty && par1 != null && par1 != "") {
|
||||
Player who = Player.Find(par1); //is player online?
|
||||
Player who = PlayerInfo.Find(par1); //is player online?
|
||||
if (who == null) { //player is offline
|
||||
ecostats = Economy.RetrieveEcoStats(par1);
|
||||
Player.SendMessage(p, "%3===Economy stats for: %f" + ecostats.playerName + "%7(offline)%3===");
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
var split = message.Split(' ');
|
||||
|
||||
Player who = Player.Find(split[0]);
|
||||
Player who = PlayerInfo.Find(split[0]);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, Server.DefaultColor + "Player not found!");
|
||||
|
@ -43,13 +43,13 @@ namespace MCGalaxy.Commands
|
||||
catch { Player.SendMessage(p, "%cInvalid amount"); return; }
|
||||
if (amountGiven < 0) { Player.SendMessage(p, "%cCannot give negative %3" + Server.moneys); return; }
|
||||
|
||||
Player who = Player.Find(message.Split(' ')[0]);
|
||||
Player who = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
Economy.EcoStats ecos;
|
||||
|
||||
if (who == null)
|
||||
{ //player is offline
|
||||
Player.OfflinePlayer off = Player.FindOffline(message.Split()[0]);
|
||||
if (off.name == "") { Player.SendMessage(p, "%cThe player %f" + message.Split()[0] + Server.DefaultColor + "(offline)%c does not exist or has never logged on to this server"); return; }
|
||||
OfflinePlayer off = PlayerInfo.FindOffline(message.Split()[0]);
|
||||
if (off == null) { Player.SendMessage(p, "%cThe player %f" + message.Split()[0] + Server.DefaultColor + "(offline)%c does not exist or has never logged on to this server"); return; }
|
||||
|
||||
ecos = Economy.RetrieveEcoStats(message.Split()[0]);
|
||||
if (ReachedMax(p, ecos.money, amountGiven)) return;
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else if (message.Split().Length == 1)
|
||||
{
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{ //player is offline
|
||||
Economy.EcoStats ecos = Economy.RetrieveEcoStats(message);
|
||||
|
@ -33,7 +33,7 @@ namespace MCGalaxy.Commands
|
||||
if (message.IndexOf(' ') == -1) { Help(p); return; }
|
||||
if (message.Split(' ').Length != 2) { Help(p); return; }
|
||||
|
||||
Player who = Player.Find(message.Split(' ')[0]);
|
||||
Player who = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
Economy.EcoStats payer;
|
||||
Economy.EcoStats receiver;
|
||||
|
||||
@ -44,8 +44,8 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (who == null)
|
||||
{ //player is offline
|
||||
Player.OfflinePlayer off = Player.FindOffline(message.Split()[0]);
|
||||
if (off.name == "") { Player.SendMessage(p, "%cThe player %f" + message.Split()[0] + Server.DefaultColor + "(offline)%c does not exist or has never logged on to this server"); return; }
|
||||
OfflinePlayer off = PlayerInfo.FindOffline(message.Split()[0]);
|
||||
if (off == null) { Player.SendMessage(p, "%cThe player %f" + message.Split()[0] + Server.DefaultColor + "(offline)%c does not exist or has never logged on to this server"); return; }
|
||||
|
||||
payer = Economy.RetrieveEcoStats(p.name);
|
||||
receiver = Economy.RetrieveEcoStats(message.Split()[0]);
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands
|
||||
ushort x = p.pos[0], y = p.pos[1], z = p.pos[2];
|
||||
|
||||
p.Loading = true;
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
if (p.level == pl.level && p != pl) p.SendDespawn(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots)
|
||||
if (p.level == b.level) p.SendDespawn(b.id);
|
||||
@ -50,7 +50,7 @@ namespace MCGalaxy.Commands
|
||||
p.SendPos(0xFF, x, y, z, p.level.rotx, p.level.roty);
|
||||
}
|
||||
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (pl.level != p.level || p == pl || pl.hidden || pl.referee)
|
||||
continue;
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
Player who = null;
|
||||
if (message == "") { who = p; message = p.name; } else { who = Player.Find(message); }
|
||||
if (message == "") { who = p; message = p.name; } else { who = PlayerInfo.Find(message); }
|
||||
if (ZombieGame.alive.Count == 0)
|
||||
{
|
||||
Player.SendMessage(p, "No one is alive.");
|
||||
|
@ -241,7 +241,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else if (!String.IsNullOrEmpty(par2))
|
||||
{
|
||||
Player who = Player.Find(par2);
|
||||
Player who = PlayerInfo.Find(par2);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, "That wasn't an online player.");
|
||||
|
@ -27,7 +27,7 @@ namespace MCGalaxy.Commands {
|
||||
public CmdDisInfect() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
Player who = message == "" ? p : Player.Find(message);
|
||||
Player who = message == "" ? p : PlayerInfo.Find(message);
|
||||
if (who == null) {
|
||||
Player.SendMessage(p, "There is no player \"" + message + "\"!"); return;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace MCGalaxy.Commands {
|
||||
public CmdInfect() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
Player who = message == "" ? p : Player.Find(message);
|
||||
Player who = message == "" ? p : PlayerInfo.Find(message);
|
||||
if (who == null) {
|
||||
Player.SendMessage(p, "There is no player \"" + message + "\"!"); return;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
Player who = null;
|
||||
if (message == "") { who = p; message = p.name; } else { who = Player.Find(message); }
|
||||
if (message == "") { who = p; message = p.name; } else { who = PlayerInfo.Find(message); }
|
||||
if (ZombieGame.infectd.Count == 0)
|
||||
{
|
||||
Player.SendMessage(p, "No one is infected");
|
||||
|
@ -33,7 +33,7 @@ namespace MCGalaxy.Commands
|
||||
string value = args[1];
|
||||
|
||||
if (args[0] == "zombie") {
|
||||
Player who = Player.Find(value);
|
||||
Player who = PlayerInfo.Find(value);
|
||||
if (who == null) {
|
||||
p.SendMessage(value + " is not online.");
|
||||
} else {
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
if (message == "") { Help(p); return; }
|
||||
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
|
||||
if (who == null)
|
||||
{
|
||||
@ -43,7 +43,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
{
|
||||
if (pl.level == which && pl.group.Permission < p.group.Permission)
|
||||
{
|
||||
|
@ -246,7 +246,7 @@ namespace MCGalaxy.Commands
|
||||
case "everyone":
|
||||
if ((int)p.group.Permission >= CommandOtherPerms.GetPerm(this, 1))
|
||||
{
|
||||
foreach (Player who in Player.players)
|
||||
foreach (Player who in PlayerInfo.players)
|
||||
{
|
||||
Player.SendMessage(who, "TNT Wars Rules: (sent to all players by " + p.color + p.name + Server.DefaultColor + " )");
|
||||
Player.SendMessage(who, "The aim of the game is to blow up people using TNT!");
|
||||
@ -312,7 +312,7 @@ namespace MCGalaxy.Commands
|
||||
default:
|
||||
if (text[1] != null && (int)p.group.Permission >= CommandOtherPerms.GetPerm(this, 1))
|
||||
{
|
||||
Player who = Player.Find(text[1]);
|
||||
Player who = PlayerInfo.Find(text[1]);
|
||||
if (who != null)
|
||||
{
|
||||
Player.SendMessage(who, "TNT Wars Rules: (sent to you by " + p.color + p.name + Server.DefaultColor + " )");
|
||||
|
@ -37,7 +37,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
string originalName = message.ToLower();
|
||||
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player. Searching Player DB.");
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
if ((int)p.group.Permission < CommandOtherPerms.GetPerm(this))
|
||||
{ Player.SendMessage(p, "You can't send the FAQ to another player!"); return; }
|
||||
who = Player.Find(message);
|
||||
who = PlayerInfo.Find(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
if (message == "")
|
||||
{
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
{
|
||||
if (pl.lastCMD.Contains("setpass") || pl.lastCMD.Contains("pass"))
|
||||
{
|
||||
@ -48,7 +48,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null || who.group.Permission > p.group.Permission && who.hidden) { Player.SendMessage(p, "Could not find player entered"); return; }
|
||||
if (who.lastCMD.Contains("setpass") || who.lastCMD.Contains("pass"))
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ namespace MCGalaxy.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Player.Find(split[0]);
|
||||
Player player = PlayerInfo.Find(split[0]);
|
||||
if (player == null) { Player.SendMessage(p, "Could not find player \"" + split[0] + "\"!"); return; }
|
||||
foreach (string t in lines)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ namespace MCGalaxy.Commands
|
||||
Player who = null;
|
||||
if (message != "")
|
||||
{
|
||||
who = Player.Find(message);
|
||||
who = PlayerInfo.Find(message);
|
||||
if (p.group.Permission < who.group.Permission) { Player.SendMessage(p, "You cant send /oprules to another player!"); return; }
|
||||
}
|
||||
else
|
||||
|
@ -43,7 +43,7 @@ namespace MCGalaxy.Commands {
|
||||
if (message != "")
|
||||
spanStart = message.ToLower();
|
||||
} else {
|
||||
target = Player.Find(args[0]);
|
||||
target = PlayerInfo.Find(args[0]);
|
||||
if (args.Length > 1 && ValidTimespan(args[1].ToLower()))
|
||||
spanStart = args[1].ToLower();
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
Dictionary<string, List<Player>> clients = new Dictionary<string, List<Player>>();
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (!pl.hidden || p == null || p.group.Permission > LevelPermission.Operator) {
|
||||
string appName = pl.appName;
|
||||
if (String.IsNullOrEmpty(appName))
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Commands
|
||||
int playerCount = 0;
|
||||
int hiddenCount = 0;
|
||||
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
{
|
||||
if (!pl.hidden || p == null || p.group.Permission > LevelPermission.AdvBuilder)
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ namespace MCGalaxy.Commands
|
||||
string title = ":" + grp.color + GetPlural(grp.trueName) + ":";
|
||||
Section rankSec = MakeSection(grp, title);
|
||||
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (pl.group != grp) continue;
|
||||
if (!pl.hidden || p == null || p.group.Permission > LevelPermission.Operator) {
|
||||
string name = Colors.StripColours(pl.DisplayName);
|
||||
@ -74,7 +74,7 @@ namespace MCGalaxy.Commands
|
||||
Section gcModsSec = MakeSection("#%6MCGalaxy GCMods:" + Server.DefaultColor);
|
||||
int totalPlayers = 0;
|
||||
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (!pl.hidden || p == null || p.group.Permission > LevelPermission.Operator) {
|
||||
totalPlayers++;
|
||||
string name = Colors.StripColours(pl.DisplayName);
|
||||
|
@ -44,7 +44,7 @@ namespace MCGalaxy.Commands
|
||||
Player.SendMessage(p, "You can't send /rules to another player!");
|
||||
return;
|
||||
}
|
||||
who = Player.Find(message);
|
||||
who = PlayerInfo.Find(message);
|
||||
} else {
|
||||
who = p;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ namespace MCGalaxy.Commands
|
||||
if (type.ToLower().Contains("player"))
|
||||
{
|
||||
string players = "";
|
||||
foreach (Player who in Player.players)
|
||||
foreach (Player who in PlayerInfo.players)
|
||||
{
|
||||
if (who.name.ToLower().Contains(keyword.ToLower()))
|
||||
{
|
||||
|
@ -31,12 +31,12 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (message == "") { Help(p); return; }
|
||||
if (Player.FindNick(message) == null)
|
||||
if (PlayerInfo.FindNick(message) == null)
|
||||
{
|
||||
Player.SendMessage(p, "The player is not online.");
|
||||
return;
|
||||
}
|
||||
Player.SendMessage(p, "This player's real username is " + Player.FindNick(message).name);
|
||||
Player.SendMessage(p, "This player's real username is " + PlayerInfo.FindNick(message).name);
|
||||
}
|
||||
|
||||
public override void Help(Player p)
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
Player who = null;
|
||||
if (message == "") { who = p; message = p.name; } else { who = Player.Find(message); }
|
||||
if (message == "") { who = p; message = p.name; } else { who = PlayerInfo.Find(message); }
|
||||
if (who != null && !who.hidden)
|
||||
{
|
||||
Player.SendMessage(p, who.color + who.name + Server.DefaultColor + " (" + who.DisplayName + ") " + Server.DefaultColor + " is on &b" + who.level.name);
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (message == "") { Help(p); return; }
|
||||
Player pl = Player.Find(message);
|
||||
Player pl = PlayerInfo.Find(message);
|
||||
if (pl != null && !pl.hidden)
|
||||
{
|
||||
Player.SendMessage(p, pl.color + pl.name + Server.DefaultColor + " is online, using /whois instead.");
|
||||
|
@ -45,7 +45,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
if (lvl.guns) {
|
||||
Player.GlobalMessage("&9Gun usage has been disabled on &c" + lvl.name + "&9!");
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
if (pl.level.name.ToLower() == lvl.name.ToLower())
|
||||
pl.aiming = false;
|
||||
} else {
|
||||
|
@ -48,7 +48,7 @@ namespace MCGalaxy.Commands {
|
||||
string banReason = reason == "-" ? "" : " (" + reason + ")";
|
||||
if (reason == "-") reason = "&c-";
|
||||
reason = reason.Replace(" ", "%20");
|
||||
Player who = Player.Find(args[0]);
|
||||
Player who = PlayerInfo.Find(args[0]);
|
||||
|
||||
string target = who == null ? args[0] : who.name;
|
||||
if (!Player.ValidName(target)) {
|
||||
|
@ -36,7 +36,7 @@ namespace MCGalaxy.Commands {
|
||||
string name = "";
|
||||
if (message[0] == '@') {
|
||||
message = message.Remove(0, 1).Trim();
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
|
||||
if (who == null) {
|
||||
DataTable ip;
|
||||
@ -66,7 +66,7 @@ namespace MCGalaxy.Commands {
|
||||
message = who.ip;
|
||||
}
|
||||
} else {
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who != null) {
|
||||
name = who.name.ToLower();
|
||||
message = who.ip;
|
||||
@ -81,7 +81,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
// Check if IP belongs to an op+
|
||||
// First get names of active ops+ with that ip
|
||||
List<string> opNamesWithThatIP = (from pl in Player.players where (pl.ip == message && pl.@group.Permission >= LevelPermission.Operator) select pl.name).ToList();
|
||||
List<string> opNamesWithThatIP = (from pl in PlayerInfo.players where (pl.ip == message && pl.@group.Permission >= LevelPermission.Operator) select pl.name).ToList();
|
||||
// Next, add names from the database
|
||||
Database.AddParams("@IP", message);
|
||||
DataTable dbnames = Database.fillData("SELECT Name FROM Players WHERE IP = @IP");
|
||||
@ -126,7 +126,7 @@ namespace MCGalaxy.Commands {
|
||||
Server.bannedIP.Save("banned-ip.txt", false);
|
||||
|
||||
/*
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (message == pl.ip) { pl.Kick("Kicked by ipban"); }
|
||||
}*/
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ namespace MCGalaxy.Commands
|
||||
Block.BlockList[Block.BlockList.FindIndex(bL => bL.type == foundBlock)] = newBlock;
|
||||
|
||||
Block.SaveBlocks(Block.BlockList);
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (!pl.HasCpeExt(CpeExt.BlockPermissions)) continue;
|
||||
|
||||
int count = pl.hasCustomBlocks ? Block.CpeCount : Block.OriginalCount;
|
||||
|
@ -115,7 +115,7 @@ namespace MCGalaxy.Commands
|
||||
private static void SendEstimation(Player p)
|
||||
{
|
||||
Player.SendMessage(p, String.Format("{0} blocks every {1} milliseconds = {2} blocks per second.", BlockQueue.blockupdates, BlockQueue.time, BlockQueue.blockupdates * (1000 / BlockQueue.time)));
|
||||
Player.SendMessage(p, String.Format("Using ~{0}KB/s times {1} player(s) = ~{2}KB/s", (BlockQueue.blockupdates * (1000 / BlockQueue.time) * 8) / 1000, Player.players.Count, Player.players.Count * ((BlockQueue.blockupdates * (1000 / BlockQueue.time) * 8) / 1000)));
|
||||
Player.SendMessage(p, String.Format("Using ~{0}KB/s times {1} player(s) = ~{2}KB/s", (BlockQueue.blockupdates * (1000 / BlockQueue.time) * 8) / 1000, PlayerInfo.players.Count, PlayerInfo.players.Count * ((BlockQueue.blockupdates * (1000 / BlockQueue.time) * 8) / 1000)));
|
||||
}
|
||||
public override void Help(Player p)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace MCGalaxy.Commands
|
||||
return;
|
||||
}
|
||||
string alltempranks = "";
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
foreach (string line in File.ReadAllLines("text/tempranks.txt"))
|
||||
{
|
||||
if (line.Contains(message))
|
||||
|
@ -17,7 +17,7 @@ namespace MCGalaxy.Commands {
|
||||
string[] args = message.Split(trimChars, 2);
|
||||
Player target = null;
|
||||
|
||||
if (args.Length == 0 || (target = Player.Find(args[0])) == null) {
|
||||
if (args.Length == 0 || (target = PlayerInfo.Find(args[0])) == null) {
|
||||
Help(p); return;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
Player who = null;
|
||||
if (message == "") { who = p; message = p.name; } else { who = Player.Find(message); }
|
||||
if (message == "") { who = p; message = p.name; } else { who = PlayerInfo.Find(message); }
|
||||
if (Server.zombie.GameInProgess())
|
||||
{
|
||||
Server.zombie.HandOutRewards();
|
||||
|
@ -37,7 +37,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
ushort x, y, z;
|
||||
if (args.Length == 1) {
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null || who.hidden) {
|
||||
Player.SendMessage(p, "The specified player does not exist!"); return;
|
||||
}
|
||||
|
@ -64,14 +64,14 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
}
|
||||
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (message == "" && p.following == "") {
|
||||
Help(p);
|
||||
return;
|
||||
}
|
||||
else if (message == "" && p.following != "" || message == p.following)
|
||||
{
|
||||
who = Player.Find(p.following);
|
||||
who = PlayerInfo.Find(p.following);
|
||||
p.following = "";
|
||||
if (p.hidden)
|
||||
{
|
||||
@ -105,10 +105,10 @@ namespace MCGalaxy.Commands
|
||||
if (p.level != who.level) Command.all.Find("tp").Use(p, who.name);
|
||||
if (p.following != "")
|
||||
{
|
||||
who = Player.Find(p.following);
|
||||
who = PlayerInfo.Find(p.following);
|
||||
p.SendSpawn(who.id, who.color + who.name, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1]);
|
||||
}
|
||||
who = Player.Find(message);
|
||||
who = PlayerInfo.Find(message);
|
||||
p.following = who.name;
|
||||
Player.SendMessage(p, "Following " + who.color + who.DisplayName + Server.DefaultColor + ". Use \"/follow\" to stop.");
|
||||
p.SendDespawn(who.id);
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (message == "") { Help(p); return; }
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null) { Player.SendMessage(p, "Could not find player."); return; }
|
||||
else if (who == p) { Player.SendMessage(p, "Cannot freeze yourself."); return; }
|
||||
else if (p != null) { if (who.group.Permission >= p.group.Permission) { Player.SendMessage(p, "Cannot freeze someone of equal or greater rank."); return; } }
|
||||
|
@ -66,7 +66,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (seconds == 0) seconds = 5400;
|
||||
|
||||
who = Player.Find(message.Split(' ')[0]);
|
||||
who = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
if (who != null)
|
||||
{
|
||||
message = who.name + " " + seconds;
|
||||
|
@ -38,7 +38,7 @@ namespace MCGalaxy
|
||||
}
|
||||
else
|
||||
{
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who != null)
|
||||
{
|
||||
if (!who.jailed)
|
||||
|
@ -38,7 +38,7 @@ namespace MCGalaxy.Commands
|
||||
Server.s.Log("Stealth joker attempted");
|
||||
}
|
||||
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player.");
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (message == "") { Help(p); return; }
|
||||
Player who = Player.Find(message.Split(' ')[0]);
|
||||
Player who = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
if (who == null) { Player.SendMessage(p, "Could not find player specified."); return; }
|
||||
if (message.Split(' ').Length > 1)
|
||||
message = message.Substring(message.IndexOf(' ') + 1);
|
||||
|
@ -33,7 +33,7 @@ namespace MCGalaxy.Commands
|
||||
Player who = null;
|
||||
string searchip = "";
|
||||
string name;
|
||||
who = Player.Find(message);
|
||||
who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, Colors.red + "Could not find player " + message + " ...searching in database");
|
||||
|
@ -29,9 +29,9 @@ namespace MCGalaxy.Commands
|
||||
Level level = Level.Find(message.Split(' ')[0]);
|
||||
if (level == null) { Player.SendMessage(p, "There is no level named '" + message.Split(' ')[0] + "'."); return; }
|
||||
if (p == null)
|
||||
foreach (Player pl in Player.players) { Command.all.Find("move").Use(null, pl.name + " " + level.name); }
|
||||
foreach (Player pl in PlayerInfo.players) { Command.all.Find("move").Use(null, pl.name + " " + level.name); }
|
||||
else
|
||||
foreach (Player pl in Player.players) { if (pl.group.Permission < p.group.Permission) Command.all.Find("move").Use(p, pl.name + " " + level.name); else Player.SendMessage(p, "You cannot move " + pl.color + pl.name + Server.DefaultColor + " because they are of equal or higher rank"); }
|
||||
foreach (Player pl in PlayerInfo.players) { if (pl.group.Permission < p.group.Permission) Command.all.Find("move").Use(p, pl.name + " " + level.name); else Player.SendMessage(p, "You cannot move " + pl.color + pl.name + Server.DefaultColor + " because they are of equal or higher rank"); }
|
||||
}
|
||||
public override void Help(Player p) { Player.SendMessage(p, "/moveall <level> - Moves all players to the level specified."); }
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (message == "" || message.Split(' ').Length > 2) { Help(p); return; }
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
|
||||
if (who == null)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
if (message == "") { Help(p); return; }
|
||||
message = message.Split(' ')[0];
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player.");
|
||||
|
@ -42,8 +42,8 @@ namespace MCGalaxy.Commands
|
||||
int pos = message.IndexOf(' ');
|
||||
string t = message.Substring(0, pos).ToLower();
|
||||
string s = message.Substring(pos + 1).ToLower();
|
||||
Player who = Player.Find(t);
|
||||
Player who2 = Player.Find(s);
|
||||
Player who = PlayerInfo.Find(t);
|
||||
Player who2 = PlayerInfo.Find(s);
|
||||
if (who == null)
|
||||
{
|
||||
if (who2 == null)
|
||||
|
@ -47,7 +47,7 @@ namespace MCGalaxy.Commands
|
||||
Player.SendMessage(p, "Are you stupid? =S You can't use this in the console!");
|
||||
return;
|
||||
}
|
||||
List<string> getpatrol = (from pl in Player.players where (int) pl.@group.Permission <= CommandOtherPerms.GetPerm(this) select pl.name).ToList();
|
||||
List<string> getpatrol = (from pl in PlayerInfo.players where (int) pl.@group.Permission <= CommandOtherPerms.GetPerm(this) select pl.name).ToList();
|
||||
if (getpatrol.Count <= 0)
|
||||
{
|
||||
Player.SendMessage(p, "There must be at least one guest online to use this command!");
|
||||
@ -56,7 +56,7 @@ namespace MCGalaxy.Commands
|
||||
Random random = new Random();
|
||||
int index = random.Next(getpatrol.Count);
|
||||
string value = getpatrol[index];
|
||||
Player who = Player.Find(value);
|
||||
Player who = PlayerInfo.Find(value);
|
||||
Command.all.Find("tp").Use(p, who.name);
|
||||
Player.SendMessage(p, "You are now visiting " + who.color + who.name + "!");
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands {
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
string[] args = message.Split(' ');
|
||||
Player who = Player.Find(args[0]);
|
||||
Player who = PlayerInfo.Find(args[0]);
|
||||
if (who == null) {
|
||||
Database.AddParams("@Name", args[0]);
|
||||
string syntax = Server.useMySQL ? "SELECT * FROM players WHERE Name=@Name COLLATE utf8_general_ci" :
|
||||
|
@ -45,7 +45,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
Player who = Player.Find(p.possess);
|
||||
Player who = PlayerInfo.Find(p.possess);
|
||||
if (who == null)
|
||||
{
|
||||
p.possess = "";
|
||||
@ -67,7 +67,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else if (message == p.possess)
|
||||
{
|
||||
Player who = Player.Find(p.possess);
|
||||
Player who = PlayerInfo.Find(p.possess);
|
||||
if (who == null)
|
||||
{
|
||||
p.possess = "";
|
||||
@ -93,7 +93,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player.");
|
||||
@ -116,7 +116,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
if (p.possess != "")
|
||||
{
|
||||
Player oldwho = Player.Find(p.possess);
|
||||
Player oldwho = PlayerInfo.Find(p.possess);
|
||||
if (oldwho != null)
|
||||
{
|
||||
oldwho.following = "";
|
||||
|
@ -17,7 +17,7 @@ namespace MCGalaxy.Commands {
|
||||
string[] args = message.Split( trimChars, 2 );
|
||||
Player target = null;
|
||||
|
||||
if (args.Length == 0 || (target = Player.Find(args[0])) == null) {
|
||||
if (args.Length == 0 || (target = PlayerInfo.Find(args[0])) == null) {
|
||||
Help(p); return;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
string target = who == null ? message : who.name;
|
||||
|
||||
Player.SendMessage(p, "&1Rank Information of " + target);
|
||||
|
@ -48,12 +48,12 @@ namespace MCGalaxy.Commands {
|
||||
Player.SendMessage(p, "Reserved for " + Group.findPermInt(CommandOtherPerms.GetPerm(this)).name + "+"); return;
|
||||
}
|
||||
|
||||
foreach (Player who in Player.players.ToArray()) {
|
||||
foreach (Player who in PlayerInfo.players.ToArray()) {
|
||||
if (who.level == lvl)
|
||||
ReloadMap(p, who, true);
|
||||
}
|
||||
} else {
|
||||
Player who = Player.Find(parts[0]);
|
||||
Player who = PlayerInfo.Find(parts[0]);
|
||||
if (who == null) {
|
||||
Player.SendMessage(p, "Could not find player."); return;
|
||||
} else if (who.group.Permission > p.group.Permission && p != who) {
|
||||
@ -67,7 +67,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
internal static void ReloadMap(Player p, Player who, bool showMessage) {
|
||||
who.Loading = true;
|
||||
foreach (Player pl in Player.players.ToArray()) if (who.level == pl.level && who != pl) who.SendDespawn(pl.id);
|
||||
foreach (Player pl in PlayerInfo.players.ToArray()) if (who.level == pl.level && who != pl) who.SendDespawn(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots.ToArray()) if (who.level == b.level) who.SendDespawn(b.id);
|
||||
|
||||
ushort x = who.pos[0], y = who.pos[1], z = who.pos[2];
|
||||
@ -79,7 +79,7 @@ namespace MCGalaxy.Commands {
|
||||
else
|
||||
who.SendPos(0xFF, x, y, z, who.level.rotx, who.level.roty);
|
||||
|
||||
foreach (Player pl in Player.players.ToArray())
|
||||
foreach (Player pl in PlayerInfo.players.ToArray())
|
||||
if (pl.level == who.level && who != pl && !pl.hidden)
|
||||
who.SendSpawn(pl.id, pl.color + pl.name, pl.pos[0], pl.pos[1], pl.pos[2], pl.rot[0], pl.rot[1]);
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
if(message == "") { Help(p); return; }
|
||||
|
||||
Player pl = Player.Find(message);
|
||||
Player pl = PlayerInfo.Find(message);
|
||||
if (pl != null && !pl.hidden)
|
||||
{
|
||||
Player.SendMessage(p, pl.color + pl.name + Server.DefaultColor + " is currently online.");
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message) {
|
||||
string[] args = message.Split(trimChars, 3);
|
||||
if (args.Length < 2) { Help(p); return; }
|
||||
Player who = Player.Find(args[0]);
|
||||
Player who = PlayerInfo.Find(args[0]);
|
||||
Group newRank = Group.Find(args[1]);
|
||||
|
||||
string reason = args.Length > 2 ? args[2] : "Congratulations!";
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands
|
||||
if (message == "") { Help(p); return; }
|
||||
if (message.IndexOf(' ') == -1) message = message + " 60";
|
||||
|
||||
Player who = Player.Find(message.Split(' ')[0]);
|
||||
Player who = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
if (who == null) { Player.SendMessage(p, "Could not find player"); return; }
|
||||
if (p != null && who.group.Permission >= p.group.Permission) { Player.SendMessage(p, "Cannot ban someone of the same rank"); return; }
|
||||
int minutes;
|
||||
|
@ -39,7 +39,7 @@ namespace MCGalaxy.Commands
|
||||
Help(p);
|
||||
}
|
||||
|
||||
Player who = Player.Find(player);
|
||||
Player who = PlayerInfo.Find(player);
|
||||
|
||||
|
||||
if (player == "") { Player.SendMessage(p, "&cYou have to enter a player!"); return; }
|
||||
@ -91,7 +91,7 @@ namespace MCGalaxy.Commands
|
||||
Player.SendMessage(p, "&cYou cannot assign yourself a temporary rank!");
|
||||
return;
|
||||
}
|
||||
Player who3 = Player.Find(player);
|
||||
Player who3 = PlayerInfo.Find(player);
|
||||
if (who3.group.Permission >= p.group.Permission)
|
||||
{
|
||||
Player.SendMessage(p, "Cannot change the temporary rank of someone equal or higher to yourself.");
|
||||
@ -142,7 +142,7 @@ namespace MCGalaxy.Commands
|
||||
Group newgroup = Group.Find(rank);
|
||||
Command.all.Find("setrank").Use(null, who.name + " " + newgroup.name);
|
||||
Player.SendMessage(p, "Temporary rank (" + rank + ") is assigned succesfully to " + player + " for " + period + " hours");
|
||||
Player who2 = Player.Find(player);
|
||||
Player who2 = PlayerInfo.Find(player);
|
||||
Player.SendMessage(who2, "Your Temporary rank (" + rank + ") is assigned succesfully for " + period + " hours");
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
if (message == "" || message.IndexOf(' ') != -1) { Help(p); return; }
|
||||
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player specified");
|
||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (message == "") { Help(p); return; }
|
||||
|
||||
Player who = Player.Find(message.Split(' ')[0]);
|
||||
Player who = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
string msg = message.Split(' ')[0];
|
||||
if (who != null)
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Commands
|
||||
message = message.Remove(0, 1).Trim();
|
||||
}
|
||||
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
|
||||
if (who == null)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ namespace MCGalaxy.Commands
|
||||
if (message[0] == '@')
|
||||
{
|
||||
message = message.Remove(0, 1).Trim();
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{
|
||||
DataTable ip;
|
||||
|
@ -35,7 +35,7 @@ namespace MCGalaxy.Commands
|
||||
if (split[0] == "add")
|
||||
{
|
||||
if (split.Length < 2) { Help(p); return; }
|
||||
Player pl = Player.Find(split[1]);
|
||||
Player pl = PlayerInfo.Find(split[1]);
|
||||
if (pl != null) split[1] = pl.name;
|
||||
if (VIP.Find(split[1])) Player.SendMessage(p, (pl == null ? "" : pl.color) + split[1] + " is already a VIP!");
|
||||
else
|
||||
@ -48,7 +48,7 @@ namespace MCGalaxy.Commands
|
||||
else if (split[0] == "remove")
|
||||
{
|
||||
if (split.Length < 2) { Help(p); return; }
|
||||
Player pl = Player.Find(split[1]);
|
||||
Player pl = PlayerInfo.Find(split[1]);
|
||||
if (pl != null) split[1] = pl.name;
|
||||
if (!VIP.Find(split[1])) Player.SendMessage(p, (pl == null ? "" : pl.color) + split[1] + " is not a VIP!");
|
||||
else
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (message == "") { Help(p); return; }
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who != null)
|
||||
{
|
||||
if (who.voice)
|
||||
|
@ -33,7 +33,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (Server.voteKickInProgress) { Player.SendMessage(p, "Please wait for the current vote to finish!"); return; }
|
||||
|
||||
Player who = Player.Find(message);
|
||||
Player who = PlayerInfo.Find(message);
|
||||
if (who == null)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player specified!");
|
||||
@ -52,7 +52,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
// 1/3rd of the players must vote or nothing happens
|
||||
// Keep it at 0 to disable min number of votes
|
||||
Server.voteKickVotesNeeded = 3; //(int)(Player.players.Count / 3) + 1;
|
||||
Server.voteKickVotesNeeded = 3; //(int)(PlayerInfo.players.Count / 3) + 1;
|
||||
Server.voteKickInProgress = true;
|
||||
|
||||
System.Timers.Timer voteTimer = new System.Timers.Timer(30000);
|
||||
@ -66,7 +66,7 @@ namespace MCGalaxy.Commands
|
||||
int votesYes = 0;
|
||||
int votesNo = 0;
|
||||
|
||||
Player.players.ForEach(delegate(Player pl)
|
||||
PlayerInfo.players.ForEach(delegate(Player pl)
|
||||
{
|
||||
// Tally the votes
|
||||
if (pl.voteKickChoice == VoteKickChoice.Yes) votesYes++;
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (message == "") { Help(p); return; }
|
||||
|
||||
Player who = Player.Find(message.Split(' ')[0]);
|
||||
Player who = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
|
||||
// Make sure we have a valid player
|
||||
if (who == null)
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands {
|
||||
if (message == "") { Help(p); return; }
|
||||
|
||||
string name = message.Split(' ')[0];
|
||||
Player who = Player.Find(name);
|
||||
Player who = PlayerInfo.Find(name);
|
||||
Command.all.Find("ban").Use(p, message);
|
||||
Command.all.Find("banip").Use(p, "@" + name);
|
||||
if (who != null)
|
||||
|
@ -42,7 +42,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
|
||||
var split = message.Split(' ');
|
||||
Player muter = Player.Find(split[0]);
|
||||
Player muter = PlayerInfo.Find(split[0]);
|
||||
if (muter == null)
|
||||
{
|
||||
Player.SendMessage(p, "Player not found.");
|
||||
|
@ -106,7 +106,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (message.Split(' ')[0].ToLower() == "add")
|
||||
{
|
||||
Player foundPlayer = Player.Find(message.Split(' ')[1]);
|
||||
Player foundPlayer = PlayerInfo.Find(message.Split(' ')[1]);
|
||||
if (foundPlayer == null)
|
||||
cpos.Owner = message.Split(' ')[1].ToString();
|
||||
else
|
||||
|
@ -118,7 +118,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
void SendEnvColorPackets(Player p, byte envType, string value) {
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (pl.level == p.level)
|
||||
SendEnvColorPacket(pl, envType, value);
|
||||
}
|
||||
@ -160,7 +160,7 @@ namespace MCGalaxy.Commands {
|
||||
p.SendMessage(string.Format("&aSet weather for {0}&a to {1} ({2}&a)", p.level.name, weather, weatherType));
|
||||
|
||||
// Send the changed colour to all players affected by the command.
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (pl.level == p.level && pl.HasCpeExt(CpeExt.EnvWeatherType))
|
||||
pl.SendSetMapWeather(weather);
|
||||
}
|
||||
@ -187,7 +187,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
void SendCurrentMapAppearance(Level lvl) {
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
bool hasExt = pl.HasCpeExt(CpeExt.EnvMapAppearance) || pl.HasCpeExt(CpeExt.EnvMapAppearance, 2);
|
||||
if (hasExt && pl.level == lvl)
|
||||
pl.SendCurrentMapAppearance();
|
||||
|
@ -86,7 +86,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
p.Loading = true;
|
||||
foreach (Player pl in Player.players) if (p.level == pl.level && p != pl) p.SendDespawn(pl.id);
|
||||
foreach (Player pl in PlayerInfo.players) if (p.level == pl.level && p != pl) p.SendDespawn(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots) if (p.level == b.level) p.SendDespawn(b.id);
|
||||
|
||||
Player.GlobalDespawn(p, true);
|
||||
@ -104,7 +104,7 @@ namespace MCGalaxy.Commands {
|
||||
else
|
||||
p.SendPos(0xFF, x, y, z, lvl.rotx, lvl.roty);
|
||||
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
if (pl.level == p.level && p != pl && !pl.hidden)
|
||||
p.SendSpawn(pl.id, pl.color + pl.name, pl.pos[0], pl.pos[1], pl.pos[2], pl.rot[0], pl.rot[1]);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots)
|
||||
@ -114,7 +114,7 @@ namespace MCGalaxy.Commands {
|
||||
p.Loading = false;
|
||||
bool unloadOld = true;
|
||||
if (oldLevel.unload && !oldLevel.name.Contains("&cMuseum ")) {
|
||||
foreach (Player pl in Player.players) if (pl.level == oldLevel) { unloadOld = false; break; }
|
||||
foreach (Player pl in PlayerInfo.players) if (pl.level == oldLevel) { unloadOld = false; break; }
|
||||
if (unloadOld && Server.AutoLoad) oldLevel.Unload(true);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (param[0] == "player")
|
||||
{
|
||||
Player who = Player.Find(param[1]);
|
||||
Player who = PlayerInfo.Find(param[1]);
|
||||
|
||||
if (who == null)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ namespace MCGalaxy.Commands
|
||||
level.jailrotx = level.rotx; level.jailroty = level.roty;
|
||||
|
||||
p.Loading = true;
|
||||
foreach (Player pl in Player.players) if (p.level == pl.level && p != pl) p.SendDespawn(pl.id);
|
||||
foreach (Player pl in PlayerInfo.players) if (p.level == pl.level && p != pl) p.SendDespawn(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots) if (p.level == b.level) p.SendDespawn(b.id);
|
||||
|
||||
Player.GlobalDespawn(p, true);
|
||||
|
@ -42,7 +42,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.SendMessage(p, "You cannot reload the main level."); return;
|
||||
}
|
||||
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (pl.level.name.ToLower() != name.ToLower()) continue;
|
||||
CmdReveal.ReloadMap(p, pl, false);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
void UpdateGlobally(Player p, bool zip) {
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
bool hasExt = pl.HasCpeExt(CpeExt.EnvMapAppearance) || pl.HasCpeExt(CpeExt.EnvMapAppearance, 2);
|
||||
string url = zip ? pl.level.texturePackUrl : pl.level.terrainUrl;
|
||||
if (hasExt && url == "")
|
||||
@ -94,7 +94,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
void UpdateLevel(Player p, bool zip) {
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
bool hasExt = pl.HasCpeExt(CpeExt.EnvMapAppearance) || pl.HasCpeExt(CpeExt.EnvMapAppearance, 2);
|
||||
if (hasExt && pl.level == p.level)
|
||||
pl.SendCurrentMapAppearance();
|
||||
|
@ -68,7 +68,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
if (param[0] == "player")
|
||||
{
|
||||
Player who = Player.Find(param[1]);
|
||||
Player who = PlayerInfo.Find(param[1]);
|
||||
{
|
||||
if (who != null)
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
string[] parts = message.Split(' ');
|
||||
bool undoPhysics = parts[0].ToLower() == "physics";
|
||||
Player who = undoPhysics ? null : Player.Find(parts[0]);
|
||||
Player who = undoPhysics ? null : PlayerInfo.Find(parts[0]);
|
||||
long seconds = GetSeconds(p, who, parts.Length > 1 ? parts[1] : "30");
|
||||
|
||||
if (parts.Length > 1 && parts[1].ToLower() == "update") {
|
||||
|
@ -378,7 +378,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
BlockDefinition.Add(def, defs, p == null ? null : p.level);
|
||||
foreach (Player pl in Player.players) {
|
||||
foreach (Player pl in PlayerInfo.players) {
|
||||
if (!pl.HasCpeExt(CpeExt.BlockDefinitions)) continue;
|
||||
if (pl.level == null || !pl.level.HasCustomBlocks) continue;
|
||||
if (!global && p.level != pl.level) continue;
|
||||
|
@ -71,7 +71,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
Player player = Player.Find(split[0]);
|
||||
Player player = PlayerInfo.Find(split[0]);
|
||||
if (player == null)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player \"" + split[0] + "\"!");
|
||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands {
|
||||
if (message == "") { Help(p); return; }
|
||||
string[] args = message.Split(' ');
|
||||
|
||||
Player who = Player.Find(args[0]);
|
||||
Player who = PlayerInfo.Find(args[0]);
|
||||
if (who == null) { Player.SendMessage(p, "Could not find player."); return; }
|
||||
if (p != null && who.group.Permission > p.group.Permission) {
|
||||
Player.SendMessage(p, "Cannot change the color of someone of greater rank"); return;
|
||||
|
@ -33,7 +33,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (message == ""){Help(p); return;}
|
||||
|
||||
Player plr = Player.Find(message.Split (' ')[0]);
|
||||
Player plr = PlayerInfo.Find(message.Split (' ')[0]);
|
||||
Group grp = Group.Find(message.Split (' ')[1]);
|
||||
|
||||
if (plr == null)
|
||||
|
@ -242,7 +242,7 @@ namespace MCGalaxy.Commands
|
||||
allBlocks.Add(pos);
|
||||
|
||||
bool comeOut = false;
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
{
|
||||
if (pl.level == p.level)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ namespace MCGalaxy.Commands
|
||||
if ((message == "")) { this.Help(p); }
|
||||
else
|
||||
{
|
||||
Player player = Player.Find(message.Split(' ')[0]);
|
||||
Player player = PlayerInfo.Find(message.Split(' ')[0]);
|
||||
if (player != null)
|
||||
{
|
||||
if (p == null) { this.SendIt(p, message, player); }
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands
|
||||
Player who;
|
||||
if (message != String.Empty)
|
||||
{
|
||||
who = Player.Find(message);
|
||||
who = PlayerInfo.Find(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands
|
||||
string killer = p == null ? "(console)" : p.color + p.DisplayName;
|
||||
string[] args = message.Split(trimChars, 2);
|
||||
|
||||
Player who = Player.Find(args[0]);
|
||||
Player who = PlayerInfo.Find(args[0]);
|
||||
if (args.Length >= 2) {
|
||||
if(args[1].ToLower() == "explode") {
|
||||
deathMessage = " was exploded by " + killer;
|
||||
|
@ -36,7 +36,7 @@ namespace MCGalaxy.Commands {
|
||||
string[] args = message.Split(trimChars, 2);
|
||||
if (args.Length < 2) { Help(p); return; }
|
||||
|
||||
Player target = Player.Find(args[0]);
|
||||
Player target = PlayerInfo.Find(args[0]);
|
||||
string name = target != null ? target.name : args[0];
|
||||
|
||||
if (!File.Exists("text/login/" + name + ".txt")) {
|
||||
|
@ -36,7 +36,7 @@ namespace MCGalaxy.Commands {
|
||||
string[] args = message.Split(trimChars, 2);
|
||||
if (args.Length < 2) { Help(p); return; }
|
||||
|
||||
Player target = Player.Find(args[0]);
|
||||
Player target = PlayerInfo.Find(args[0]);
|
||||
string name = target != null ? target.name : args[0];
|
||||
|
||||
if (!File.Exists("text/logout/" + name + ".txt")) {
|
||||
|
@ -237,7 +237,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
|
||||
bool comeInner = false;
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
{
|
||||
if (pl.level == p.level && pl != p)
|
||||
{
|
||||
@ -308,7 +308,7 @@ namespace MCGalaxy.Commands
|
||||
allBlocks.Add(pos);
|
||||
|
||||
bool comeOut = false;
|
||||
foreach (Player pl in Player.players)
|
||||
foreach (Player pl in PlayerInfo.players)
|
||||
{
|
||||
if (pl.level == p.level && pl != p)
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user