Merge branch 'master' of github.com:Hetal728/MCGalaxy

This commit is contained in:
UnknownShadow200 2016-03-21 11:09:27 +11:00
commit 47911b6e29
6 changed files with 21 additions and 10 deletions

View File

@ -21,9 +21,9 @@ using System.Threading;
namespace MCGalaxy.Commands {
public sealed class CmdMapAuthor : Command {
public override string name { get { return "mapauthors"; } }
public override string shortcut { get { return "authors"; } }
public sealed class CmdMapSet : Command {
public override string name { get { return "mapset"; } }
public override string shortcut { get { return "mset"; } }
public override string type { get { return CommandTypes.Games; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
@ -31,14 +31,20 @@ namespace MCGalaxy.Commands {
public override void Use(Player p, string message) {
if (p == null) { MessageInGameOnly(p); return; }
p.level.Authors = message;
Player.SendMessage(p, "Sets the authors of the map to: " + message.Replace(" ", "%S, "));
if (message == "") {
Player.SendMessage(p, "Map authors: " + p.level.Authors);
Player.SendMessage(p, "Pillaring allowed: " + p.level.Pillaring);
}
p.level.Authors = message.Replace(" ", "%S, ")
Player.SendMessage(p, "Sets the authors of the map to: " + message);
}
public override void Help(Player p) {
Player.SendMessage(p, "%T/mapauthors [name1] <name2>...");
Player.SendMessage(p, "%T/mapset author [name1] <name2>...");
Player.SendMessage(p, "%HSets the authors of the current map. " +
"This is shown to players at the start of rounds in various games.");
Player.SendMessage(p, "%T/mapset pillaring [true/false]");
Player.SendMessage(p, "%HSets whether players can pillar on this map in various games.");
}
}
}

View File

@ -24,7 +24,7 @@ namespace MCGalaxy.Games {
public override bool HandlesManualChange(Player p, ushort x, ushort y, ushort z,
byte action, byte tile, byte b) {
if (action == 1 && noPillaring && !p.referee) {
if (action == 1 && !CurrentLevel.Pillaring && !p.referee) {
if (p.lastYblock == y - 1 && p.lastXblock == x && p.lastZblock == z ) {
p.blocksStacked++;
} else {
@ -133,7 +133,7 @@ namespace MCGalaxy.Games {
p.SendMessage("This map has &a" + CurrentLevel.Likes +
" likes %Sand &c" + CurrentLevel.Dislikes + " dislikes");
if (CurrentLevel.Authors != "")
p.SendMessage("It was created by " + CurrentLevel.Authors.Replace(" ", "%S, "));
p.SendMessage("It was created by " + CurrentLevel.Authors);
p.SendCpeMessage(CpeMessageType.BottomRight1, "%SYou have &a" + p.money + " %S" + Server.moneys);
UpdatePlayerStatus(p);
return;

View File

@ -83,6 +83,7 @@ namespace MCGalaxy.Levels.IO {
writer.WriteLine("Likes = " + level.Likes);
writer.WriteLine("Dislikes = " + level.Dislikes);
writer.WriteLine("Authors = " + level.Authors);
writer.WriteLine("Pillaring = " + level.Pillaring);
}
static string GetName(LevelPermission perm) {
@ -225,6 +226,8 @@ namespace MCGalaxy.Levels.IO {
level.Dislikes = int.Parse(value); break;
case "authors":
level.Authors = value; break;
case "pillaring":
level.Pillaring = bool.Parse(value); break;
}
}

View File

@ -204,8 +204,10 @@ namespace MCGalaxy
BufferedBlockSender bulkSender;
public List<C4.C4s> C4list = new List<C4.C4s>();
// Games fields
public int Likes, Dislikes;
public string Authors = "";
public bool Pillaring = !Server.zombie.noPillaring;
public Level(string n, ushort x, ushort y, ushort z, string type, int seed = 0, bool useSeed = false)
{

View File

@ -181,7 +181,7 @@
<Compile Include="Commands\Fun\CmdFlipHeads.cs" />
<Compile Include="Commands\Fun\CmdGun.cs" />
<Compile Include="Commands\Fun\CmdLavaSurvival.cs" />
<Compile Include="Commands\Fun\CmdMapAuthors.cs" />
<Compile Include="Commands\Fun\CmdMapSet.cs" />
<Compile Include="Commands\Fun\CmdMissile.cs" />
<Compile Include="Commands\Fun\CmdSlap.cs" />
<Compile Include="Commands\Fun\CmdTeam.cs" />

View File

@ -412,7 +412,7 @@ namespace MCGalaxy
if (File.Exists("externalurl.txt")) File.Move("externalurl.txt", "text/externalurl.txt");
if (File.Exists("autoload.txt")) File.Move("autoload.txt", "text/autoload.txt");
if (File.Exists("IRC_Controllers.txt")) File.Move("IRC_Controllers.txt", "ranks/IRC_Controllers.txt");
if (useWhitelist) if (File.Exists("whitelist.txt")) File.Move("whitelist.txt", "ranks/whitelist.txt");
if (useWhitelist && File.Exists("whitelist.txt")) File.Move("whitelist.txt", "ranks/whitelist.txt");
}
catch { }
Chat.LoadCustomTokens();