mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-29 00:26:15 -04:00
Do not change the direct color field of players, only change in the spawn packet.
This commit is contained in:
parent
e34e306363
commit
90c4dedf27
@ -33,7 +33,6 @@ namespace MCGalaxy.Commands {
|
|||||||
if (p.referee) {
|
if (p.referee) {
|
||||||
p.referee = false;
|
p.referee = false;
|
||||||
LevelPermission perm = Group.findPlayerGroup(name).Permission;
|
LevelPermission perm = Group.findPlayerGroup(name).Permission;
|
||||||
Player.GlobalDespawn(p, false);
|
|
||||||
Player.SendChatFrom(p, p.FullName + " %Sis no longer a referee", false);
|
Player.SendChatFrom(p, p.FullName + " %Sis no longer a referee", false);
|
||||||
|
|
||||||
if (Server.zombie.RoundInProgress) {
|
if (Server.zombie.RoundInProgress) {
|
||||||
@ -44,7 +43,6 @@ namespace MCGalaxy.Commands {
|
|||||||
Server.zombie.Infected.Remove(p);
|
Server.zombie.Infected.Remove(p);
|
||||||
Server.zombie.Alive.Add(p);
|
Server.zombie.Alive.Add(p);
|
||||||
Server.zombie.UpdateAllPlayerStatus();
|
Server.zombie.UpdateAllPlayerStatus();
|
||||||
p.color = p.group.color;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
p.referee = true;
|
p.referee = true;
|
||||||
@ -53,7 +51,6 @@ namespace MCGalaxy.Commands {
|
|||||||
Server.zombie.Alive.Remove(p);
|
Server.zombie.Alive.Remove(p);
|
||||||
Server.zombie.Infected.Remove(p);
|
Server.zombie.Infected.Remove(p);
|
||||||
Server.zombie.UpdateAllPlayerStatus();
|
Server.zombie.UpdateAllPlayerStatus();
|
||||||
p.color = p.group.color;
|
|
||||||
if (Server.zombie.RoundInProgress)
|
if (Server.zombie.RoundInProgress)
|
||||||
Server.zombie.AssignFirstZombie();
|
Server.zombie.AssignFirstZombie();
|
||||||
}
|
}
|
||||||
|
@ -38,13 +38,13 @@ namespace MCGalaxy.Commands
|
|||||||
|
|
||||||
if (who.group.Permission >= p.group.Permission)
|
if (who.group.Permission >= p.group.Permission)
|
||||||
{
|
{
|
||||||
Player.SendChatFrom(p, p.color + p.DisplayName + " " + Server.DefaultColor + "tried to votekick " + who.color + who.DisplayName + " " + Server.DefaultColor + "but failed!", false);
|
Player.SendChatFrom(p, p.color + p.DisplayName + " %Stried to votekick " + who.color + who.DisplayName + " %Sbut failed!", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Chat.GlobalMessageOps(p.color + p.DisplayName + Server.DefaultColor + " used &a/votekick");
|
Chat.GlobalMessageOps(p.color + p.DisplayName + " %Sused &a/votekick");
|
||||||
Player.GlobalMessage("&9A vote to kick " + who.color + who.DisplayName + " " + Server.DefaultColor + "has been called!");
|
Player.GlobalMessage("&9A vote to kick " + who.color + who.DisplayName + " %Shas been called!");
|
||||||
Player.GlobalMessage("&9Type &aY " + Server.DefaultColor + "or &cN " + Server.DefaultColor + "to vote.");
|
Player.GlobalMessage("&9Type &aY %Sor &cN %Sto vote.");
|
||||||
|
|
||||||
// 1/3rd of the players must vote or nothing happens
|
// 1/3rd of the players must vote or nothing happens
|
||||||
// Keep it at 0 to disable min number of votes
|
// Keep it at 0 to disable min number of votes
|
||||||
@ -88,7 +88,7 @@ namespace MCGalaxy.Commands
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Player.GlobalMessage(who.color + who.DisplayName + " " + Server.DefaultColor + "shall remain!");
|
Player.GlobalMessage(who.color + who.DisplayName + " %Sshall remain!");
|
||||||
}
|
}
|
||||||
|
|
||||||
voteTimer.Dispose();
|
voteTimer.Dispose();
|
||||||
|
@ -49,7 +49,7 @@ namespace MCGalaxy.Commands {
|
|||||||
} else if (who.warn == 1) {
|
} else if (who.warn == 1) {
|
||||||
Player.SendMessage(who, "Do it one more time and you will get kicked!");
|
Player.SendMessage(who, "Do it one more time and you will get kicked!");
|
||||||
} else if (who.warn == 2) {
|
} else if (who.warn == 2) {
|
||||||
Player.GlobalMessage(who.color + who.DisplayName + " " + "%Swas warn-kicked by " + warnedby);
|
Player.GlobalMessage(who.color + who.DisplayName + " %Swas warn-kicked by " + warnedby);
|
||||||
who.Kick("KICKED BECAUSE " + reason + "");
|
who.Kick("KICKED BECAUSE " + reason + "");
|
||||||
}
|
}
|
||||||
who.warn++;
|
who.warn++;
|
||||||
|
@ -130,10 +130,7 @@ namespace MCGalaxy.Games {
|
|||||||
|
|
||||||
Player[] online = PlayerInfo.Online.Items;
|
Player[] online = PlayerInfo.Online.Items;
|
||||||
foreach (Player p in online) {
|
foreach (Player p in online) {
|
||||||
if (p.referee) {
|
if (!p.referee && p.level.name.CaselessEq(CurrentLevelName)) {
|
||||||
p.color = p.group.color;
|
|
||||||
} else if (p.level.name.CaselessEq(CurrentLevelName)) {
|
|
||||||
p.color = p.group.color;
|
|
||||||
players.Add(p);
|
players.Add(p);
|
||||||
nonRefPlayers++;
|
nonRefPlayers++;
|
||||||
}
|
}
|
||||||
@ -203,8 +200,8 @@ namespace MCGalaxy.Games {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void UpdatePlayerColor(Player p, string color) {
|
static void UpdatePlayerColor(Player p, string color) {
|
||||||
if (p.color == color) return;
|
if (p.lastSpawnColor == color) return;
|
||||||
p.color = color;
|
p.lastSpawnColor = color;
|
||||||
Player.GlobalDespawn(p, false);
|
Player.GlobalDespawn(p, false);
|
||||||
Player.GlobalSpawn(p, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1], false);
|
Player.GlobalSpawn(p, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1], false);
|
||||||
}
|
}
|
||||||
@ -273,7 +270,6 @@ namespace MCGalaxy.Games {
|
|||||||
pl.playersInfected = 0;
|
pl.playersInfected = 0;
|
||||||
pl.money += money;
|
pl.money += money;
|
||||||
pl.infected = false;
|
pl.infected = false;
|
||||||
pl.color = pl.group.color;
|
|
||||||
if (pl.referee) {
|
if (pl.referee) {
|
||||||
pl.SendMessage("You gained one " + Server.moneys + " because you're a ref. Would you like a medal as well?");
|
pl.SendMessage("You gained one " + Server.moneys + " because you're a ref. Would you like a medal as well?");
|
||||||
pl.money++;
|
pl.money++;
|
||||||
@ -289,10 +285,8 @@ namespace MCGalaxy.Games {
|
|||||||
p.infected = false;
|
p.infected = false;
|
||||||
p.playersInfected = 0;
|
p.playersInfected = 0;
|
||||||
|
|
||||||
if (p.level.name.CaselessEq(CurrentLevelName)) {
|
if (p.level.name.CaselessEq(CurrentLevelName))
|
||||||
p.color = p.group.color;
|
playersString += p.color + p.DisplayName + Colors.white + ", ";
|
||||||
playersString += p.group.color + p.DisplayName + Colors.white + ", ";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChooseNextLevel() {
|
void ChooseNextLevel() {
|
||||||
|
@ -133,7 +133,7 @@ namespace MCGalaxy.Games {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Player zombie = alive[index];
|
Player zombie = alive[index];
|
||||||
Player.GlobalMessage(zombie.FullName + " %Scontinued the infection!");
|
CurrentLevel.ChatLevel(zombie.FullName + " %Scontinued the infection!");
|
||||||
InfectPlayer(zombie);
|
InfectPlayer(zombie);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,15 +156,16 @@ namespace MCGalaxy.Games {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ChangeLevel(string next) {
|
void ChangeLevel(string next) {
|
||||||
|
if (CurrentLevel != null) {
|
||||||
|
CurrentLevel.ChatLevel("The next map has been chosen - " + Colors.red + next.ToLower());
|
||||||
|
CurrentLevel.ChatLevel("Please wait while you are transfered.");
|
||||||
|
}
|
||||||
|
|
||||||
CurrentLevelName = next;
|
CurrentLevelName = next;
|
||||||
queLevel = false;
|
queLevel = false;
|
||||||
nextLevel = "";
|
nextLevel = "";
|
||||||
Command.all.Find("load").Use(null, next.ToLower() + " 0");
|
Command.all.Find("load").Use(null, next.ToLower() + " 0");
|
||||||
CurrentLevel = LevelInfo.Find(next);
|
CurrentLevel = LevelInfo.Find(next);
|
||||||
|
|
||||||
Player.GlobalMessage("The next map has been chosen - " + Colors.red + next.ToLower());
|
|
||||||
Player.GlobalMessage("Please wait while you are transfered.");
|
|
||||||
string oldLevel = Server.mainLevel.name;
|
|
||||||
if (Server.ZombieOnlyServer)
|
if (Server.ZombieOnlyServer)
|
||||||
Server.mainLevel = CurrentLevel;
|
Server.mainLevel = CurrentLevel;
|
||||||
|
|
||||||
|
@ -198,6 +198,7 @@ namespace MCGalaxy {
|
|||||||
public bool aka = false;
|
public bool aka = false;
|
||||||
public bool flipHead = true;
|
public bool flipHead = true;
|
||||||
public int playersInfected = 0;
|
public int playersInfected = 0;
|
||||||
|
internal string lastSpawnColor = "";
|
||||||
|
|
||||||
//Tnt Wars
|
//Tnt Wars
|
||||||
public bool PlayingTntWars = false;
|
public bool PlayingTntWars = false;
|
||||||
@ -488,6 +489,7 @@ namespace MCGalaxy {
|
|||||||
public static void GlobalSpawn(Player p, ushort x, ushort y, ushort z,
|
public static void GlobalSpawn(Player p, ushort x, ushort y, ushort z,
|
||||||
byte rotx, byte roty, bool self, string possession = "") {
|
byte rotx, byte roty, bool self, string possession = "") {
|
||||||
Player[] players = PlayerInfo.Online.Items;
|
Player[] players = PlayerInfo.Online.Items;
|
||||||
|
p.lastSpawnColor = p.infected ? Colors.red : p.color;
|
||||||
foreach (Player other in players) {
|
foreach (Player other in players) {
|
||||||
if (other.Loading && p != other) continue;
|
if (other.Loading && p != other) continue;
|
||||||
if (p.level != other.level || (p.hidden && !self)) continue;
|
if (p.level != other.level || (p.hidden && !self)) continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user