mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Made /skin and /model use PlayersExtList.
This commit is contained in:
parent
c87c60fa35
commit
f8f54b278e
@ -81,9 +81,10 @@ namespace MCGalaxy.Commands.CPE {
|
|||||||
else
|
else
|
||||||
Player.Message(who, "Changed your own model to a &c" + model);
|
Player.Message(who, "Changed your own model to a &c" + model);
|
||||||
|
|
||||||
Server.Models.DeleteStartsWith(who.name + " ");
|
Server.models.Remove(who.name);
|
||||||
if (model != "humanoid")
|
if (model != "humanoid")
|
||||||
Server.Models.Append(who.name + " " + model);
|
Server.models.Add(who.name, model);
|
||||||
|
Server.models.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace MCGalaxy.Commands.CPE {
|
namespace MCGalaxy.Commands.CPE {
|
||||||
|
|
||||||
public sealed class CmdReachDistance : Command {
|
public sealed class CmdReachDistance : Command {
|
||||||
|
|
||||||
public override string name { get { return "reachdistance"; } }
|
public override string name { get { return "reachdistance"; } }
|
||||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands.CPE {
|
|||||||
|
|
||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string message) {
|
||||||
if (CheckSuper(p, message, "player or bot name")) return;
|
if (CheckSuper(p, message, "player or bot name")) return;
|
||||||
message = p.truename;
|
if (message == "") message = p.truename;
|
||||||
|
|
||||||
Player who = p;
|
Player who = p;
|
||||||
PlayerBot pBot = null;
|
PlayerBot pBot = null;
|
||||||
@ -73,9 +73,10 @@ namespace MCGalaxy.Commands.CPE {
|
|||||||
else
|
else
|
||||||
Player.Message(who, "Changed your own skin to &c" + skin);
|
Player.Message(who, "Changed your own skin to &c" + skin);
|
||||||
|
|
||||||
Server.Skins.DeleteStartsWith(who.name + " ");
|
Server.skins.Remove(who.name);
|
||||||
if (skin != who.truename)
|
if (skin != who.truename)
|
||||||
Server.Skins.Append(who.name + " " + skin);
|
Server.skins.Add(who.name, skin);
|
||||||
|
Server.skins.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -602,24 +602,16 @@ namespace MCGalaxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LoadCpeData() {
|
void LoadCpeData() {
|
||||||
try {
|
string line = Server.skins.Find(name);
|
||||||
foreach (string line in Server.Skins.Find(name)) {
|
if (line != null) {
|
||||||
string[] parts = line.Split(trimChars, 2);
|
int sep = line.IndexOf(' ');
|
||||||
if (parts.Length == 1) continue;
|
if (sep >= 0) skinName = line.Substring(sep + 1);
|
||||||
skinName = parts[1];
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Server.ErrorLog(ex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
line = Server.models.Find(name);
|
||||||
foreach (string line in Server.Models.Find(name)) {
|
if (line != null) {
|
||||||
string[] parts = line.Split(trimChars, 2);
|
int sep = line.IndexOf(' ');
|
||||||
if (parts.Length == 1) continue;
|
if (sep >= 0) model = line.Substring(sep + 1);
|
||||||
model = parts[1];
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Server.ErrorLog(ex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
int space = line.IndexOf(' ');
|
int space = line.IndexOf(' ');
|
||||||
string name = space >= 0 ? line.Substring(0, space) : line;
|
string name = space >= 0 ? line.Substring(0, space) : line;
|
||||||
list.players.Add(line);
|
list.players.Add(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
@ -72,6 +72,8 @@ namespace MCGalaxy {
|
|||||||
frozen = PlayerList.Load("frozen.txt");
|
frozen = PlayerList.Load("frozen.txt");
|
||||||
hidden = PlayerList.Load("hidden.txt");
|
hidden = PlayerList.Load("hidden.txt");
|
||||||
jailed = PlayerExtList.Load("ranks/jailed.txt");
|
jailed = PlayerExtList.Load("ranks/jailed.txt");
|
||||||
|
models = PlayerExtList.Load("extra/models.txt");
|
||||||
|
skins = PlayerExtList.Load("extra/skins.txt");
|
||||||
|
|
||||||
foreach (Group grp in Group.GroupList)
|
foreach (Group grp in Group.GroupList)
|
||||||
grp.playerList = PlayerList.Load(grp.fileName);
|
grp.playerList = PlayerList.Load(grp.fileName);
|
||||||
|
@ -70,8 +70,6 @@ namespace MCGalaxy
|
|||||||
public static PlayersFile RankInfo = new PlayersFile("text/rankinfo.txt");
|
public static PlayersFile RankInfo = new PlayersFile("text/rankinfo.txt");
|
||||||
public static PlayersFile TempRanks = new PlayersFile("text/tempranks.txt");
|
public static PlayersFile TempRanks = new PlayersFile("text/tempranks.txt");
|
||||||
public static PlayersFile Notes = new PlayersFile("text/notes.txt");
|
public static PlayersFile Notes = new PlayersFile("text/notes.txt");
|
||||||
public static PlayersFile Skins = new PlayersFile("extra/skins.txt");
|
|
||||||
public static PlayersFile Models = new PlayersFile("extra/models.txt");
|
|
||||||
public static Version Version { get { return System.Reflection.Assembly.GetAssembly(typeof(Server)).GetName().Version; } }
|
public static Version Version { get { return System.Reflection.Assembly.GetAssembly(typeof(Server)).GetName().Version; } }
|
||||||
|
|
||||||
public static string VersionString {
|
public static string VersionString {
|
||||||
@ -100,7 +98,7 @@ namespace MCGalaxy
|
|||||||
public static bool ServerSetupFinished = false;
|
public static bool ServerSetupFinished = false;
|
||||||
public static Auto_CTF ctf = null;
|
public static Auto_CTF ctf = null;
|
||||||
public static PlayerList bannedIP, whiteList, ircControllers, muted, ignored, frozen, hidden;
|
public static PlayerList bannedIP, whiteList, ircControllers, muted, ignored, frozen, hidden;
|
||||||
public static PlayerExtList jailed;
|
public static PlayerExtList jailed, models, skins;
|
||||||
|
|
||||||
public static readonly List<string> Devs = new List<string>(), Mods = new List<string>();
|
public static readonly List<string> Devs = new List<string>(), Mods = new List<string>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user