mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -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);
|
||||
} else {
|
||||
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");
|
||||
|
||||
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);
|
||||
if (data != null)
|
||||
Player.Message(p, " is banned for " + data[1] + " by " + data[0]);
|
||||
|
@ -486,24 +486,24 @@ Next: continue;
|
||||
}
|
||||
|
||||
public void TntAtATime() {
|
||||
new Thread(() => {
|
||||
CurrentAmountOfTnt += 1;
|
||||
switch ( TntWarsGame.GetTntWarsGame(this).GameDifficulty ) {
|
||||
case TntWarsGame.TntWarsDifficulty.Easy:
|
||||
Thread.Sleep(3250);
|
||||
break;
|
||||
CurrentAmountOfTnt++;
|
||||
int delay = 0;
|
||||
|
||||
case TntWarsGame.TntWarsDifficulty.Normal:
|
||||
Thread.Sleep(2250);
|
||||
break;
|
||||
|
||||
case TntWarsGame.TntWarsDifficulty.Hard:
|
||||
case TntWarsGame.TntWarsDifficulty.Extreme:
|
||||
Thread.Sleep(1250);
|
||||
break;
|
||||
}
|
||||
CurrentAmountOfTnt -= 1;
|
||||
}).Start();
|
||||
switch (TntWarsGame.GetTntWarsGame(this).GameDifficulty) {
|
||||
case TntWarsGame.TntWarsDifficulty.Easy:
|
||||
delay = 3250; break;
|
||||
case TntWarsGame.TntWarsDifficulty.Normal:
|
||||
delay = 2250; break;
|
||||
case TntWarsGame.TntWarsDifficulty.Hard:
|
||||
case TntWarsGame.TntWarsDifficulty.Extreme:
|
||||
delay = 1250; break;
|
||||
}
|
||||
Server.MainScheduler.QueueOnce(AllowMoreTntTask, null,
|
||||
TimeSpan.FromMilliseconds(delay));
|
||||
}
|
||||
|
||||
void AllowMoreTntTask(SchedulerTask task) {
|
||||
CurrentAmountOfTnt--;
|
||||
}
|
||||
|
||||
public static bool BlacklistCheck(string name, string foundLevel) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user