mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Don't spin up a pointless thread that just increments a variable, sleeps for up to 3 seconds, then just decrements that variable again. Use a ask instead.
This commit is contained in:
parent
e3f2875111
commit
81735196ac
@ -116,7 +116,7 @@ namespace MCGalaxy.Commands {
|
|||||||
Player.Message(p, "The chatoom '{0}' already exists", room);
|
Player.Message(p, "The chatoom '{0}' already exists", room);
|
||||||
} else {
|
} else {
|
||||||
Server.Chatrooms.Add(room);
|
Server.Chatrooms.Add(room);
|
||||||
Player.GlobalMessage("A new chat room '{0}' has been created", room);
|
Player.GlobalMessage("A new chat room '" + room + "' has been created");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ namespace MCGalaxy.Commands {
|
|||||||
+ "%S, and is currently &aonline");
|
+ "%S, and is currently &aonline");
|
||||||
|
|
||||||
Player.Message(p, " Logged in &a{0} %Stimes, &c{1} %Sof which ended in a kick", who.Logins, who.Kicks);
|
Player.Message(p, " Logged in &a{0} %Stimes, &c{1} %Sof which ended in a kick", who.Logins, who.Kicks);
|
||||||
if (who.Rank == LevelPermission.Banned) {
|
if (who.Group.Permission == LevelPermission.Banned) {
|
||||||
string[] data = Ban.GetBanData(who.Name);
|
string[] data = Ban.GetBanData(who.Name);
|
||||||
if (data != null)
|
if (data != null)
|
||||||
Player.Message(p, " is banned for " + data[1] + " by " + data[0]);
|
Player.Message(p, " is banned for " + data[1] + " by " + data[0]);
|
||||||
|
@ -486,24 +486,24 @@ Next: continue;
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void TntAtATime() {
|
public void TntAtATime() {
|
||||||
new Thread(() => {
|
CurrentAmountOfTnt++;
|
||||||
CurrentAmountOfTnt += 1;
|
int delay = 0;
|
||||||
|
|
||||||
switch (TntWarsGame.GetTntWarsGame(this).GameDifficulty) {
|
switch (TntWarsGame.GetTntWarsGame(this).GameDifficulty) {
|
||||||
case TntWarsGame.TntWarsDifficulty.Easy:
|
case TntWarsGame.TntWarsDifficulty.Easy:
|
||||||
Thread.Sleep(3250);
|
delay = 3250; break;
|
||||||
break;
|
|
||||||
|
|
||||||
case TntWarsGame.TntWarsDifficulty.Normal:
|
case TntWarsGame.TntWarsDifficulty.Normal:
|
||||||
Thread.Sleep(2250);
|
delay = 2250; break;
|
||||||
break;
|
|
||||||
|
|
||||||
case TntWarsGame.TntWarsDifficulty.Hard:
|
case TntWarsGame.TntWarsDifficulty.Hard:
|
||||||
case TntWarsGame.TntWarsDifficulty.Extreme:
|
case TntWarsGame.TntWarsDifficulty.Extreme:
|
||||||
Thread.Sleep(1250);
|
delay = 1250; break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
CurrentAmountOfTnt -= 1;
|
Server.MainScheduler.QueueOnce(AllowMoreTntTask, null,
|
||||||
}).Start();
|
TimeSpan.FromMilliseconds(delay));
|
||||||
|
}
|
||||||
|
|
||||||
|
void AllowMoreTntTask(SchedulerTask task) {
|
||||||
|
CurrentAmountOfTnt--;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool BlacklistCheck(string name, string foundLevel) {
|
public static bool BlacklistCheck(string name, string foundLevel) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user