Use name without + in SpawnEntity packets, also add /os map texturezip. (Thanks goodlyay)

This commit is contained in:
UnknownShadow200 2016-03-30 10:17:43 +11:00
parent d1764a7ee0
commit 4b2db7195b
6 changed files with 17 additions and 14 deletions

View File

@ -245,13 +245,15 @@ namespace MCGalaxy.Commands
Command.all.Find("pervisit").Use(p, rank);
} else if (cmd == "TEXTURE") {
if (value == "") {
Player.SendMessage(p, "Removing current texture.");
Command.all.Find("texture").Use(p, "level normal");
} else if (!value.EndsWith(".png")) {
Player.SendMessage(p, "Your texture image must end in .png");
} else {
Command.all.Find("texture").Use(p, "level " + value);
Player.SendMessage(p, "Your texture has been updated!");
}
} else if (cmd == "TEXTUREZIP") {
if (value == "") {
Command.all.Find("texture").Use(p, "levelzip normal");
} else {
Command.all.Find("texture").Use(p, "levelzip " + value);
}
} else {
Player.SendMessage(p, "/os map add [type - default is flat] -- Creates your map (128x64x128)");
@ -262,7 +264,8 @@ namespace MCGalaxy.Commands
Player.SendMessage(p, "/os map motd -- Changes the motd of your map");
Player.SendMessage(p, "/os map guns -- Toggles if guns can be used on your map");
Player.SendMessage(p, "/os map pervisit %b[default is " + Server.defaultRank + "]%S -- Changes the pervisit of you map");
Player.SendMessage(p, "/os map texture -- Add a texture to your map");
Player.SendMessage(p, "/os map texture -- Sets terrain.png url for your map");
Player.SendMessage(p, "/os map texturezip -- Sets texture pack .zip url for your map");
Player.SendMessage(p, " Textures: If your URL is too long, use the \"<\" symbol to continue it on another line.");
Player.SendMessage(p, " Map Types: Desert, flat, forest, island, mountians, ocean, pixel, empty and space");
Player.SendMessage(p, " Motd: If no message is provided, the default message will be used.");

View File

@ -74,7 +74,7 @@ namespace MCGalaxy.Commands
if (p.hidden)
{
if (who != null)
p.SendSpawn(who.id, who.color + who.name, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1]);
p.SendSpawn(who.id, who.color + who.truename, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1]);
if (!stealth)
{
Command.all.Find("hide").Use(p, "");
@ -104,7 +104,7 @@ namespace MCGalaxy.Commands
if (p.following != "")
{
who = PlayerInfo.Find(p.following);
p.SendSpawn(who.id, who.color + who.name, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1]);
p.SendSpawn(who.id, who.color + who.truename, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1]);
}
who = PlayerInfo.Find(message);
p.following = who.name;

View File

@ -89,7 +89,7 @@ namespace MCGalaxy.Games
ushort y1 = (ushort)((1 + y) * 32);
ushort z1 = (ushort)((0.5 + z) * 32);
rotx = spawns[rnd].rotx;
p.SendSpawn((byte)0xFF, p.name, x1, y1, z1, (byte)rotx, 0);
p.SendSpawn(0xFF, p.name, x1, y1, z1, (byte)rotx, 0);
//p.health = 100;
}
else

View File

@ -65,7 +65,7 @@ namespace MCGalaxy.Games {
player.SendMessage("Sending you to the correct map.");
Command.all.Find("goto").Use(player, mapon.name);
}
player.SendSpawn(0xFF, player.name, x1, y1, z1, (byte)0, (byte)0);
player.SendSpawn(0xFF, player.color + player.truename, x1, y1, z1, (byte)0, (byte)0);
}
squaresLeft.Clear();

View File

@ -999,7 +999,7 @@ return;
checkpointX = x; checkpointY = y; checkpointZ = z;
int index = level.PosToInt(x, y, z);
if (index != lastCheckpointIndex) {
SendSpawn(0xFF, color + name, pos[0], (ushort)((y - 1) * 32 + 51), pos[2], rot[0], rot[1]);
SendSpawn(0xFF, color + truename, pos[0], (ushort)((y - 1) * 32 + 51), pos[2], rot[0], rot[1]);
lastCheckpointIndex = index;
}
} else if ( b1 == Block.checkpoint ) {
@ -1007,7 +1007,7 @@ return;
checkpointX = x; checkpointY = (ushort)(y + 1); checkpointZ = z;
int index = level.PosToInt(x, (ushort)(y - 1), z);
if (index != lastCheckpointIndex) {
SendSpawn(0xFF, color + name, pos[0], (ushort)((y - 1) * 32 + 51), pos[2], rot[0], rot[1]);
SendSpawn(0xFF, color + truename, pos[0], (ushort)((y - 1) * 32 + 51), pos[2], rot[0], rot[1]);
lastCheckpointIndex = index;
}
}

View File

@ -58,7 +58,7 @@ namespace MCGalaxy {
public static bool storeHelp = false;
public static string storedHelp = "";
private string truename;
internal string truename;
internal bool dontmindme = false;
public Socket socket;
System.Timers.Timer timespent = new System.Timers.Timer(1000);
@ -486,13 +486,13 @@ namespace MCGalaxy {
internal static void SpawnEntity(Player p, Player dst, byte id, ushort x, ushort y, ushort z,
byte rotx, byte roty, string possession = "") {
if (!Server.zombie.Running || !p.Game.Infected) {
dst.SendSpawn(id, p.color + p.name + possession, x, y, z, rotx, roty); return;
dst.SendSpawn(id, p.color + p.truename + possession, x, y, z, rotx, roty); return;
}
if (Server.zombie.ZombieName != "" && !dst.Game.Aka)
dst.SendSpawn(id, Colors.red + Server.zombie.ZombieName + possession, x, y, z, rotx, roty);
else
dst.SendSpawn(id, Colors.red + p.name + possession, x, y, z, rotx, roty);
dst.SendSpawn(id, Colors.red + p.truename + possession, x, y, z, rotx, roty);
if (dst.HasCpeExt(CpeExt.ChangeModel) && id != 0xFF)
dst.SendChangeModel(id, "zombie");
}