mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-13 09:15:59 -04:00
Rename SendDie to more logical CmdDespawn, kill off /fetch as it was completely obsoleted by /summon.
This commit is contained in:
parent
0cdb123519
commit
ade9b3b9af
@ -93,7 +93,6 @@ namespace MCGalaxy
|
||||
all.Add(new CmdFakePay());
|
||||
all.Add(new CmdFakeRank());
|
||||
all.Add(new CmdFaq());
|
||||
all.Add(new CmdFetch());
|
||||
all.Add(new CmdFill());
|
||||
all.Add(new CmdFixGrass());
|
||||
all.Add(new CmdFlipHead());
|
||||
|
@ -92,7 +92,6 @@ namespace MCGalaxy.Commands
|
||||
new CommandKeywords((new CmdFakePay()), "fake troll pay " + Server.moneys);
|
||||
new CommandKeywords((new CmdFakeRank()), "rank mod fake troll");
|
||||
new CommandKeywords((new CmdFaq()), "freq ask question");
|
||||
new CommandKeywords((new CmdFetch()), "summon move");
|
||||
new CommandKeywords((new CmdFill()), "cuboid edit");
|
||||
new CommandKeywords((new CmdFixGrass()), "grass fix");
|
||||
new CommandKeywords((new CmdFlipHead()), "head fix flip troll");
|
||||
|
@ -299,13 +299,10 @@ namespace MCGalaxy.Commands
|
||||
while (p.Loading) { Thread.Sleep(250); }
|
||||
p.level.permissionbuild = LevelPermission.Nobody;
|
||||
p.level.motd = "Welcome to the Countdown map!!!! -hax";
|
||||
ushort x = System.Convert.ToUInt16(8);
|
||||
ushort y = System.Convert.ToUInt16(23);
|
||||
ushort z = System.Convert.ToUInt16(17);
|
||||
x *= 32; x += 16;
|
||||
y *= 32; y += 32;
|
||||
z *= 32; z += 16;
|
||||
unchecked { p.SendPos((byte)-1, x, y, z, p.rot[0], p.rot[1]); }
|
||||
const ushort x = 8 * 32 + 16;
|
||||
const ushort y = 23 * 32 + 32;
|
||||
const ushort z = 17 * 32 + 16;
|
||||
p.SendPos(0xFF, x, y, z, p.rot[0], p.rot[1]);
|
||||
}
|
||||
|
||||
else if (par0 == "enable")
|
||||
|
@ -35,16 +35,16 @@ namespace MCGalaxy.Commands
|
||||
|
||||
p.Loading = true;
|
||||
foreach (Player pl in Player.players)
|
||||
if (p.level == pl.level && p != pl) p.SendDie(pl.id);
|
||||
if (p.level == pl.level && p != pl) p.SendDespawn(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots)
|
||||
if (p.level == b.level) p.SendDie(b.id);
|
||||
if (p.level == b.level) p.SendDespawn(b.id);
|
||||
|
||||
Player.GlobalDie(p, true);
|
||||
Player.GlobalDespawn(p, true);
|
||||
p.SendUserMOTD();
|
||||
p.SendMap();
|
||||
|
||||
if (!p.hidden) {
|
||||
Player.GlobalDie(p, false);
|
||||
Player.GlobalDespawn(p, false);
|
||||
Player.GlobalSpawn(p, x, y, z, p.level.rotx, p.level.roty, true);
|
||||
} else {
|
||||
p.SendPos(0xFF, x, y, z, p.level.rotx, p.level.roty);
|
||||
|
@ -121,7 +121,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
who.group = Group.findPerm(LevelPermission.Banned);
|
||||
who.color = who.group.color;
|
||||
Player.GlobalDie(who, false);
|
||||
Player.GlobalDespawn(who, false);
|
||||
Player.GlobalSpawn(who, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1], false);
|
||||
Group.findPerm(LevelPermission.Banned).playerList.Add(who.name);
|
||||
Ban.Banplayer(p, who.name.ToLower(), reason, stealth, oldgroup);
|
||||
|
@ -1,72 +0,0 @@
|
||||
/*
|
||||
Copyright 2011 MCGalaxy
|
||||
|
||||
Author: SebbiUltimate
|
||||
|
||||
Dual-licensed under the Educational Community License, Version 2.0 and
|
||||
the GNU General Public License, Version 3 (the "Licenses"); you may
|
||||
not use this file except in compliance with the Licenses. You may
|
||||
obtain a copy of the Licenses at
|
||||
|
||||
http://www.opensource.org/licenses/ecl2.php
|
||||
http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the Licenses are distributed on an "AS IS"
|
||||
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
or implied. See the Licenses for the specific language governing
|
||||
permissions and limitations under the Licenses.
|
||||
*/
|
||||
using System.Threading;
|
||||
namespace MCGalaxy.Commands
|
||||
{
|
||||
public sealed class CmdFetch : Command
|
||||
{
|
||||
public override string name { get { return "fetch"; } }
|
||||
public override string shortcut { get { return "fb"; } }
|
||||
public override string type { get { return CommandTypes.Moderation; } }
|
||||
public override bool museumUsable { get { return false; } }
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (p == null)
|
||||
{
|
||||
Player.SendMessage(p, "Console cannot use this command. Try using /move instead.");
|
||||
return;
|
||||
}
|
||||
|
||||
Player who = Player.Find(message);
|
||||
if (who == null || who.hidden)
|
||||
{
|
||||
Player.SendMessage(p, "Could not find player.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (p.group.Permission <= who.group.Permission)
|
||||
{
|
||||
Player.SendMessage(p, "You cannot fetch a player of equal or greater rank!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (p.level != who.level)
|
||||
{
|
||||
Player.SendMessage(p, who.DisplayName + " is in a different Level. Forcefetching has started!");
|
||||
Level where = p.level;
|
||||
Command.all.Find("goto").Use(who, where.name);
|
||||
Thread.Sleep(1000);
|
||||
// Sleep for a bit while they load
|
||||
while (who.Loading) { Thread.Sleep(250); }
|
||||
}
|
||||
|
||||
unchecked
|
||||
{
|
||||
who.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
|
||||
}
|
||||
}
|
||||
public override void Help(Player p)
|
||||
{
|
||||
Player.SendMessage(p, "/fetch <player> - Fetches Player forced!");
|
||||
Player.SendMessage(p, "Moves Player to your Level first");
|
||||
}
|
||||
}
|
||||
}
|
@ -115,7 +115,7 @@ namespace MCGalaxy.Commands
|
||||
who = Player.Find(message);
|
||||
p.following = who.name;
|
||||
Player.SendMessage(p, "Following " + who.color + who.DisplayName + Server.DefaultColor + ". Use \"/follow\" to stop.");
|
||||
p.SendDie(who.id);
|
||||
p.SendDespawn(who.id);
|
||||
}
|
||||
catch (Exception e) { Server.ErrorLog(e); Player.SendMessage(p, "Error occured"); }
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ namespace MCGalaxy.Commands
|
||||
p.hidden = !p.hidden;
|
||||
if (p.hidden)
|
||||
{
|
||||
Player.GlobalDie(p, true);
|
||||
Player.GlobalDespawn(p, true);
|
||||
Chat.GlobalMessageOps("To Ops -" + p.color + p.DisplayName + Server.DefaultColor + "- is now &finvisible" + Server.DefaultColor + ".");
|
||||
Player.GlobalChat(p, "&c- " + p.color + p.prefix + p.DisplayName + Server.DefaultColor + " " +
|
||||
(File.Exists("text/logout/" + p.name + ".txt") ? CP437Reader.ReadAllText("text/logout/" + p.name + ".txt") : "Disconnected."), false);
|
||||
|
@ -48,7 +48,7 @@ namespace MCGalaxy
|
||||
if (who.group.Permission >= p.group.Permission) { Player.SendMessage(p, "Cannot jail someone of equal or greater rank."); return; }
|
||||
Player.SendMessage(p, "You jailed " + who.DisplayName);
|
||||
}
|
||||
Player.GlobalDie(who, false);
|
||||
Player.GlobalDespawn(who, false);
|
||||
who.jailed = true;
|
||||
Player.GlobalSpawn(who, who.level.jailx, who.level.jaily, who.level.jailz, who.level.jailrotx, who.level.jailroty, true);
|
||||
if (!File.Exists("ranks/jailed.txt")) File.Create("ranks/jailed.txt").Close();
|
||||
|
@ -144,7 +144,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
return;
|
||||
}
|
||||
p.SendDie(who.id);
|
||||
p.SendDespawn(who.id);
|
||||
who.canBuild = false;
|
||||
Player.SendMessage(p, "Successfully possessed " + who.color + who.name + Server.DefaultColor + ".");
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
p.referee = false;
|
||||
LevelPermission perm = Group.findPlayerGroup(name).Permission;
|
||||
Player.GlobalDie(p, false);
|
||||
Player.GlobalDespawn(p, false);
|
||||
Player.GlobalChat(p, p.color + p.name + Server.DefaultColor + " is no longer a referee", false);
|
||||
if (Server.zombie.GameInProgess())
|
||||
{
|
||||
@ -40,7 +40,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
Player.GlobalDie(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);
|
||||
ZombieGame.infectd.Remove(p);
|
||||
ZombieGame.alive.Add(p);
|
||||
@ -51,7 +51,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
p.referee = true;
|
||||
Player.GlobalChat(p, p.color + p.name + Server.DefaultColor + " is now a referee", false);
|
||||
Player.GlobalDie(p, false);
|
||||
Player.GlobalDespawn(p, false);
|
||||
if (Server.zombie.GameInProgess())
|
||||
{
|
||||
p.color = p.group.color;
|
||||
|
@ -67,11 +67,11 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
void ReloadMap(Player p, Player who) {
|
||||
who.Loading = true;
|
||||
foreach (Player pl in Player.players.ToArray()) if (who.level == pl.level && who != pl) who.SendDie(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots.ToArray()) if (who.level == b.level) who.SendDie(b.id);
|
||||
foreach (Player pl in Player.players.ToArray()) if (who.level == pl.level && who != pl) who.SendDespawn(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots.ToArray()) if (who.level == b.level) who.SendDespawn(b.id);
|
||||
|
||||
ushort x = who.pos[0], y = who.pos[1], z = who.pos[2];
|
||||
Player.GlobalDie(who, true);
|
||||
Player.GlobalDespawn(who, true);
|
||||
who.SendUserMOTD(); who.SendMap();
|
||||
|
||||
if (!who.hidden)
|
||||
|
@ -119,7 +119,7 @@ namespace MCGalaxy.Commands
|
||||
who.color = who.group.color;
|
||||
who.SetPrefix();
|
||||
|
||||
Player.GlobalDie(who, false);
|
||||
Player.GlobalDespawn(who, false);
|
||||
|
||||
who.SendMessage("You are now ranked " + newRank.color + newRank.name + Server.DefaultColor + ", type /help for your new set of commands.");
|
||||
who.SendUserType(Block.canPlace(who.group.Permission, Block.blackrock));
|
||||
|
@ -135,7 +135,7 @@ namespace MCGalaxy.Commands
|
||||
Server.s.Log("UNBANNED: by console");
|
||||
Server.IRC.Say(message + " was unbanned by console.");
|
||||
}
|
||||
who.group = Group.standard; who.color = who.group.color; Player.GlobalDie(who, false);
|
||||
who.group = Group.standard; who.color = who.group.color; Player.GlobalDespawn(who, false);
|
||||
Player.GlobalSpawn(who, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1], false);
|
||||
Group.findPerm(LevelPermission.Banned).playerList.Remove(message);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ namespace MCGalaxy.Commands
|
||||
p.hidden = !p.hidden;
|
||||
if (p.hidden)
|
||||
{
|
||||
Player.GlobalDie(p, true);
|
||||
Player.GlobalDespawn(p, true);
|
||||
Player.GlobalChat(p, "&c- " + p.color + p.prefix + p.DisplayName + Server.DefaultColor + " " +
|
||||
(File.Exists("text/logout/" + p.name + ".txt") ? CP437Reader.ReadAllText("text/logout/" + p.name + ".txt") : "Disconnected."), false);
|
||||
Server.IRC.Say(p.name + " left the game (Disconnected.)");
|
||||
|
@ -54,10 +54,10 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
|
||||
p.Loading = true;
|
||||
foreach (Player pl in Player.players) if (p.level == pl.level && p != pl) p.SendDie(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots) if (p.level == b.level) p.SendDie(b.id);
|
||||
foreach (Player pl in Player.players) if (p.level == pl.level && p != pl) p.SendDespawn(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots) if (p.level == b.level) p.SendDespawn(b.id);
|
||||
|
||||
Player.GlobalDie(p, true);
|
||||
Player.GlobalDespawn(p, true);
|
||||
p.level = foundLevel; p.SendUserMOTD(); p.SendMap();
|
||||
|
||||
GC.Collect();
|
||||
@ -67,7 +67,7 @@ namespace MCGalaxy.Commands
|
||||
ushort z = (ushort)((0.5 + foundLevel.spawnz) * 32);
|
||||
|
||||
if (!p.hidden) Player.GlobalSpawn(p, x, y, z, foundLevel.rotx, foundLevel.roty, true, "");
|
||||
else unchecked { p.SendPos((byte)-1, x, y, z, foundLevel.rotx, foundLevel.roty); }
|
||||
else p.SendPos(0xFF, x, y, z, foundLevel.rotx, foundLevel.roty);
|
||||
|
||||
foreach (Player pl in Player.players)
|
||||
if (pl.level == p.level && p != pl && !pl.hidden)
|
||||
|
@ -58,10 +58,10 @@ namespace MCGalaxy.Commands
|
||||
level.jailrotx = level.rotx; level.jailroty = level.roty;
|
||||
|
||||
p.Loading = true;
|
||||
foreach (Player pl in Player.players) if (p.level == pl.level && p != pl) p.SendDie(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots) if (p.level == b.level) p.SendDie(b.id);
|
||||
foreach (Player pl in Player.players) if (p.level == pl.level && p != pl) p.SendDespawn(pl.id);
|
||||
foreach (PlayerBot b in PlayerBot.playerbots) if (p.level == b.level) p.SendDespawn(b.id);
|
||||
|
||||
Player.GlobalDie(p, true);
|
||||
Player.GlobalDespawn(p, true);
|
||||
|
||||
p.level = level;
|
||||
p.SendMotd();
|
||||
|
@ -64,7 +64,8 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
RevertAndClearState(p, x, y, z);
|
||||
CatchPos cpos = (CatchPos)p.blockchangeObject;
|
||||
unchecked { if (cpos.type != (byte)-1) { type = cpos.type; } }
|
||||
if (cpos.type != Block.Zero)
|
||||
type = cpos.type;
|
||||
List<Pos> buffer = new List<Pos>();
|
||||
Pos pos;
|
||||
|
||||
|
@ -49,7 +49,7 @@ namespace MCGalaxy.Commands
|
||||
if (p.level.GetTile(xpos, blockunder, zpos) != Block.air && p.level.GetTile(xpos, blockunder, zpos) != Block.air_switch && p.level.GetTile(xpos, blockunder, zpos) != Block.air_door && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_down && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_layer && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_up && p.level.GetTile(xpos, blockunder, zpos) != Block.air_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.redflower && p.level.GetTile(xpos, blockunder, zpos) != Block.yellowflower && p.level.GetTile(xpos, blockunder, zpos) != Block.finiteWater && p.level.GetTile(xpos, blockunder, zpos) != Block.finiteLava && p.level.GetTile(xpos, blockunder, zpos) != Block.fire && p.level.GetTile(xpos, blockunder, zpos) != Block.water && p.level.GetTile(xpos, blockunder, zpos) != Block.water_door && p.level.GetTile(xpos, blockunder, zpos) != Block.water_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.WaterDown && p.level.GetTile(xpos, blockunder, zpos) != Block.WaterFaucet && p.level.GetTile(xpos, blockunder, zpos) != Block.lava && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_door && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_fast && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.LavaDown && p.level.GetTile(xpos, blockunder, zpos) != Block.lavastill && p.level.GetTile(xpos, blockunder, zpos) != Block.Zero)
|
||||
{
|
||||
Player.SendMessage(p, "Teleported you up!");
|
||||
unchecked { p.SendPos((byte)-1, p.pos[0], (ushort)((posy + 1) * 32), p.pos[2], p.rot[0], p.rot[1]); }
|
||||
p.SendPos(0xFF, p.pos[0], (ushort)((posy + 1) * 32), p.pos[2], p.rot[0], p.rot[1]);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
if (p.level.name.ToLower() != p.beforeTeleportMap.ToLower())
|
||||
Command.all.Find("goto").Use(p, p.beforeTeleportMap);
|
||||
unchecked { p.SendPos((byte)-1, p.beforeTeleportPos[0], p.beforeTeleportPos[1], p.beforeTeleportPos[2], 0, 0); }
|
||||
p.SendPos(0xFF, p.beforeTeleportPos[0], p.beforeTeleportPos[1], p.beforeTeleportPos[2], 0, 0);
|
||||
}
|
||||
public override void Help(Player p)
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.GlobalChat(who, who.color + "*" + Name(who.DisplayName) + " color reverted to " + who.group.color + "their group's default" + Server.DefaultColor + ".", false);
|
||||
who.color = who.group.color;
|
||||
|
||||
Player.GlobalDie(who, false);
|
||||
Player.GlobalDespawn(who, false);
|
||||
Player.GlobalSpawn(who, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1], false);
|
||||
who.SetPrefix();
|
||||
return;
|
||||
@ -63,7 +63,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
who.color = color;
|
||||
|
||||
Player.GlobalDie(who, false);
|
||||
Player.GlobalDespawn(who, false);
|
||||
Player.GlobalSpawn(who, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1], false);
|
||||
who.SetPrefix();
|
||||
}
|
||||
@ -77,7 +77,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.GlobalChat(p, p.color + "*" + Name(p.DisplayName) + " color reverted to " + p.group.color + "their group's default" + Server.DefaultColor + ".", false);
|
||||
p.color = p.group.color;
|
||||
|
||||
Player.GlobalDie(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);
|
||||
p.SetPrefix();
|
||||
return;
|
||||
@ -93,7 +93,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.GlobalChat(p, p.color + "*" + Name(p.DisplayName) + " color changed to " + color + c.Name(color) + Server.DefaultColor + ".", false);
|
||||
p.color = color;
|
||||
|
||||
Player.GlobalDie(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);
|
||||
p.SetPrefix();
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ namespace MCGalaxy.Commands
|
||||
if (p.level.GetTile(xpos, blockunder, zpos) != Block.air && p.level.GetTile(xpos, blockunder, zpos) != Block.air_switch && p.level.GetTile(xpos, blockunder, zpos) != Block.air_door && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_down && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_layer && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_up && p.level.GetTile(xpos, blockunder, zpos) != Block.air_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.redflower && p.level.GetTile(xpos, blockunder, zpos) != Block.yellowflower && p.level.GetTile(xpos, blockunder, zpos) != Block.finiteWater && p.level.GetTile(xpos, blockunder, zpos) != Block.finiteLava && p.level.GetTile(xpos, blockunder, zpos) != Block.fire && p.level.GetTile(xpos, blockunder, zpos) != Block.water && p.level.GetTile(xpos, blockunder, zpos) != Block.water_door && p.level.GetTile(xpos, blockunder, zpos) != Block.water_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.WaterDown && p.level.GetTile(xpos, blockunder, zpos) != Block.WaterFaucet && p.level.GetTile(xpos, blockunder, zpos) != Block.lava && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_door && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_fast && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.LavaDown && p.level.GetTile(xpos, blockunder, zpos) != Block.lavastill && p.level.GetTile(xpos, blockunder, zpos) != Block.Zero)
|
||||
{
|
||||
Player.SendMessage(p, "Teleported you down!");
|
||||
unchecked { p.SendPos((byte)-1, p.pos[0], (ushort)((posy + 1) * 32), p.pos[2], p.rot[0], p.rot[1]); }
|
||||
p.SendPos(0xFF, p.pos[0], (ushort)((posy + 1) * 32), p.pos[2], p.rot[0], p.rot[1]);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ namespace MCGalaxy.Commands
|
||||
if (bp.ending == -1)
|
||||
try
|
||||
{
|
||||
unchecked { p.SendPos((byte)-1, (ushort)(previous[previous.Count - 3].x * 32), (ushort)(previous[previous.Count - 3].y * 32 + 32), (ushort)(previous[previous.Count - 3].z * 32), p.rot[0], p.rot[1]); }
|
||||
p.SendPos(0xFF, (ushort)(previous[previous.Count - 3].x * 32), (ushort)(previous[previous.Count - 3].y * 32 + 32), (ushort)(previous[previous.Count - 3].z * 32), p.rot[0], p.rot[1]);
|
||||
} catch { }
|
||||
if (bp.ending == 3) Thread.Sleep(400);
|
||||
|
||||
|
@ -86,7 +86,7 @@ namespace MCGalaxy.Commands
|
||||
x *= 32; x += 16;
|
||||
y *= 32; y += 32;
|
||||
z *= 32; z += 16;
|
||||
unchecked { who.SendPos((byte)-1, x, y, z, p.rot[0], p.rot[1]); }
|
||||
who.SendPos(0xFF, x, y, z, p.rot[0], p.rot[1]);
|
||||
if (p != who) Player.SendMessage(p, "Moved " + who.color + who.name);
|
||||
}
|
||||
catch { Player.SendMessage(p, "Invalid co-ordinates"); }
|
||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
who.DisplayName = who.name;
|
||||
Player.GlobalChat(who, who.color + who.prefix + who.DisplayName + "&g has reverted their nick to their original name.", false);
|
||||
Player.GlobalDie(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);
|
||||
return;
|
||||
}
|
||||
@ -40,7 +40,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (newName != "") Player.GlobalChat(who, who.color + who.DisplayName + "&g has changed their nick to " + newName + "&g.", false);
|
||||
who.DisplayName = newName;
|
||||
Player.GlobalDie(who, false);
|
||||
Player.GlobalDespawn(who, false);
|
||||
Player.GlobalSpawn(who, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1], false);
|
||||
PlayerDB.Save(who);
|
||||
}
|
||||
|
@ -104,9 +104,8 @@ namespace MCGalaxy.Commands
|
||||
who.level.ChatLevel(who.color + who.DisplayName + Server.DefaultColor + " was slapped sky high by " + "the Console.");
|
||||
}
|
||||
foundHeight = 1000;
|
||||
}
|
||||
|
||||
unchecked { who.SendPos((byte)-1, who.pos[0], (ushort)(foundHeight * 32), who.pos[2], who.rot[0], who.rot[1]); }
|
||||
}
|
||||
who.SendPos(0xFF, who.pos[0], (ushort)(foundHeight * 32), who.pos[2], who.rot[0], who.rot[1]);
|
||||
}
|
||||
public override void Help(Player p)
|
||||
{
|
||||
|
@ -54,13 +54,9 @@ namespace MCGalaxy.Commands
|
||||
return;
|
||||
}
|
||||
}
|
||||
unchecked
|
||||
{
|
||||
p.SendPos((byte)-1, x, y, z,
|
||||
p.level.rotx,
|
||||
p.level.roty);
|
||||
}
|
||||
p.SendPos(0xFF, x, y, z, p.level.rotx, p.level.roty);
|
||||
}
|
||||
|
||||
public override void Help(Player p)
|
||||
{
|
||||
Player.SendMessage(p, "/spawn - Teleports yourself to the spawn location.");
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
if (pl.level == p.level && pl != p && p.group.Permission > pl.group.Permission)
|
||||
{
|
||||
unchecked { pl.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0); }
|
||||
pl.SendPos(0xFF, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
|
||||
pl.SendMessage("You were summoned by " + p.color + p.DisplayName + Server.DefaultColor + ".");
|
||||
}
|
||||
}
|
||||
@ -63,14 +63,13 @@ namespace MCGalaxy.Commands
|
||||
if (p.level != who.level)
|
||||
{
|
||||
Player.SendMessage(p, who.DisplayName + " is in a different Level. Forcefetching has started!");
|
||||
Level where = p.level;
|
||||
Command.all.Find("goto").Use(who, where.name);
|
||||
Command.all.Find("goto").Use(who, p.level.name);
|
||||
Thread.Sleep(1000);
|
||||
// Sleep for a bit while they load
|
||||
while (who.Loading) { Thread.Sleep(250); }
|
||||
}
|
||||
|
||||
unchecked { who.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0); }
|
||||
who.SendPos(0xFF, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
|
||||
who.SendMessage("You were summoned by " + p.color + p.DisplayName + Server.DefaultColor + ".");
|
||||
}
|
||||
public override void Help(Player p)
|
||||
|
@ -74,7 +74,7 @@ namespace MCGalaxy.Commands
|
||||
while (who.Loading) { }
|
||||
}
|
||||
while (p.Loading) { } //Wait for player to spawn in new map
|
||||
unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0); }
|
||||
p.SendPos(0xFF, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -96,7 +96,7 @@ namespace MCGalaxy.Commands
|
||||
while (who.Loading) { }
|
||||
}
|
||||
while (p.Loading) { } //Wait for player to spawn in new map
|
||||
unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0); }
|
||||
p.SendPos(0xFF, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ namespace MCGalaxy.Commands
|
||||
while (who.Loading) { Thread.Sleep(250); }
|
||||
}
|
||||
|
||||
unchecked { who.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0); }
|
||||
who.SendPos(0xFF, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
|
||||
}
|
||||
}
|
||||
public override void Help(Player p)
|
||||
|
@ -88,7 +88,7 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
|
||||
Level.Zone zone = p.level.ZoneList[zoneID];
|
||||
unchecked { p.SendPos((byte)-1, (ushort)(zone.bigX * 32 + 16), (ushort)(zone.bigY * 32 + 32), (ushort)(zone.bigZ * 32 + 16), p.rot[0], p.rot[1]); }
|
||||
p.SendPos(0xFF, (ushort)(zone.bigX * 32 + 16), (ushort)(zone.bigY * 32 + 32), (ushort)(zone.bigZ * 32 + 16), p.rot[0], p.rot[1]);
|
||||
|
||||
Player.SendMessage(p, "Teleported to zone &c" + zoneID + " &b(" +
|
||||
zone.bigX + ", " + zone.bigY + ", " + zone.bigZ + ") &f" +
|
||||
|
@ -146,7 +146,7 @@ namespace MCGalaxy.Commands
|
||||
Command.all.Find("goto").Use(p, lvl.name);
|
||||
while (p.Loading) { Thread.Sleep(250); }
|
||||
}
|
||||
unchecked { p.SendPos((byte)-1, w.x, w.y, w.z, w.rotx, w.roty); }
|
||||
p.SendPos(0xFF, w.x, w.y, w.z, w.rotx, w.roty);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -36,7 +36,7 @@ namespace MCGalaxy.Commands
|
||||
Player.GlobalChat(p, p.color + "*" + p.DisplayName + Server.DefaultColor + "'s color reverted to " + p.group.color + "their group's default" + Server.DefaultColor + ".", false);
|
||||
p.color = p.group.color;
|
||||
|
||||
Player.GlobalDie(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);
|
||||
p.SetPrefix();
|
||||
return;
|
||||
@ -53,7 +53,7 @@ namespace MCGalaxy.Commands
|
||||
Player.GlobalChat(p, p.color + "*" + p.DisplayName + Server.DefaultColor + "'s color changed to " + color + c.Name(color) + Server.DefaultColor + ".", false);
|
||||
p.color = color;
|
||||
|
||||
Player.GlobalDie(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);
|
||||
p.SetPrefix();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace MCGalaxy.Commands
|
||||
{
|
||||
p.DisplayName = p.name;
|
||||
Player.GlobalChat(p, p.color + p.prefix + p.DisplayName + "&g has reverted their nick to their original name.", false);
|
||||
Player.GlobalDie(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);
|
||||
return;
|
||||
}
|
||||
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
if (newName != "") Player.GlobalChat(p, p.color + p.DisplayName + "&g has changed their nick to " + newName + "&g.", false);
|
||||
p.DisplayName = newName;
|
||||
Player.GlobalDie(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);
|
||||
PlayerDB.Save(p);
|
||||
}
|
||||
|
15
GUI/PropertyWindow.Designer.cs
generated
15
GUI/PropertyWindow.Designer.cs
generated
@ -251,7 +251,6 @@ namespace MCGalaxy.Gui
|
||||
this.chkRestart = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
@ -436,7 +435,6 @@ namespace MCGalaxy.Gui
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
( (System.ComponentModel.ISupportInitialize) ( this.pictureBox1 ) ).BeginInit();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox17.SuspendLayout();
|
||||
( (System.ComponentModel.ISupportInitialize) ( this.updateTimeNumeric ) ).BeginInit();
|
||||
@ -2534,7 +2532,6 @@ namespace MCGalaxy.Gui
|
||||
this.tabPage1.Controls.Add( this.groupBox4 );
|
||||
this.tabPage1.Controls.Add( this.groupBox2 );
|
||||
this.tabPage1.Controls.Add( this.groupBox3 );
|
||||
this.tabPage1.Controls.Add( this.pictureBox1 );
|
||||
this.tabPage1.Controls.Add( this.groupBox1 );
|
||||
this.tabPage1.Controls.Add( this.groupBox17 );
|
||||
this.tabPage1.Controls.Add( this.groupBox6 );
|
||||
@ -2759,16 +2756,6 @@ namespace MCGalaxy.Gui
|
||||
this.label7.TabIndex = 3;
|
||||
this.label7.Text = "Depth:";
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Location = new System.Drawing.Point( 417, 35 );
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size( 68, 68 );
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pictureBox1.TabIndex = 27;
|
||||
this.pictureBox1.TabStop = false;
|
||||
this.pictureBox1.Click += new System.EventHandler( this.pictureBox1_Click );
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.AutoSize = true;
|
||||
@ -4529,7 +4516,6 @@ namespace MCGalaxy.Gui
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout( false );
|
||||
this.groupBox3.PerformLayout();
|
||||
( (System.ComponentModel.ISupportInitialize) ( this.pictureBox1 ) ).EndInit();
|
||||
this.groupBox1.ResumeLayout( false );
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox17.ResumeLayout( false );
|
||||
@ -4733,7 +4719,6 @@ namespace MCGalaxy.Gui
|
||||
private System.Windows.Forms.GroupBox grpIRC;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox6;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
|
@ -1413,28 +1413,6 @@ txtBackupLocation.Text = folderDialog.SelectedPath;
|
||||
}*/
|
||||
}
|
||||
|
||||
private void pictureBox1_Click(object sender, EventArgs e) {
|
||||
try {
|
||||
if ( !Directory.Exists("extra/images") )
|
||||
Directory.CreateDirectory("extra/images");
|
||||
if ( !File.Exists( "extra/images/mcpony.png" ) ) {
|
||||
using ( WebClient WEB = new WebClient () ) {
|
||||
WEB.DownloadFileAsync ( new Uri ( "http://comingsoon.tk/uploads/images/mcpony.png" ), "extra/images/mcpony.png" );
|
||||
WEB.DownloadFileCompleted += ( ea, args ) => {
|
||||
if ( File.Exists ( "extra/images/mcpony.png" ) ) {
|
||||
Image img = Image.FromFile ( "extra/images/mcpony.png" );
|
||||
pictureBox1.Image = img;
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
Image img = Image.FromFile( "extra/images/mcpony.png" );
|
||||
pictureBox1.Image = img;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void cmbGlobalChatColor_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
lblGlobalChatColor.BackColor = Color.FromName(cmbGlobalChatColor.Items[cmbGlobalChatColor.SelectedIndex].ToString());
|
||||
}
|
||||
|
@ -1647,12 +1647,7 @@ namespace MCGalaxy.Gui
|
||||
ushort x = (ushort)((0.5 + p.level.spawnx) * 32);
|
||||
ushort y = (ushort)((1 + p.level.spawny) * 32);
|
||||
ushort z = (ushort)((0.5 + p.level.spawnz) * 32);
|
||||
unchecked
|
||||
{
|
||||
p.SendPos((byte)-1, x, y, z,
|
||||
p.level.rotx,
|
||||
p.level.roty);
|
||||
}
|
||||
p.SendPos(0xFF, x, y, z, p.level.rotx, p.level.roty);
|
||||
PlayersTextBox.AppendTextAndScroll("Sent player to spawn");
|
||||
}
|
||||
|
||||
|
@ -101,10 +101,10 @@ namespace MCGalaxy
|
||||
yy = (ushort)(rand.Next(0, mainlevel.Height));
|
||||
zz = (ushort)(rand.Next(0, mainlevel.Length));
|
||||
}
|
||||
unchecked { p1.SendPos((byte)-1, (ushort)(xx * 32), (ushort)(yy * 32), (ushort)(zz * 32), p1.rot[0], p1.rot[1]); }
|
||||
p1.SendPos(0xFF, (ushort)(xx * 32), (ushort)(yy * 32), (ushort)(zz * 32), p1.rot[0], p1.rot[1]);
|
||||
}
|
||||
else
|
||||
unchecked { p1.SendPos((byte)-1, spawnx, spawny, spawnz, p1.rot[0], p1.rot[1]); }
|
||||
p1.SendPos(0xFF, spawnx, spawny, spawnz, p1.rot[0], p1.rot[1]);
|
||||
|
||||
}
|
||||
public Base(ushort x, ushort y, ushort z, Teams team)
|
||||
|
@ -107,9 +107,9 @@ namespace MCGalaxy
|
||||
}
|
||||
mapon.ChatLevel("Countdown is about to start!!");
|
||||
mapon.permissionbuild = LevelPermission.Nobody;
|
||||
ushort x1 = (ushort)((15.5) * 32);
|
||||
ushort y1 = (ushort)((30) * 32);
|
||||
ushort z1 = (ushort)((15.5) * 32);
|
||||
ushort x1 = (ushort)(15.5 * 32);
|
||||
ushort y1 = (ushort)(30 * 32);
|
||||
ushort z1 = (ushort)(15.5 * 32);
|
||||
foreach (Player player in players)
|
||||
{
|
||||
if (player.level != mapon)
|
||||
@ -120,10 +120,7 @@ namespace MCGalaxy
|
||||
// Sleep for a bit while they load
|
||||
while (player.Loading) { Thread.Sleep(250); }
|
||||
}
|
||||
unchecked
|
||||
{
|
||||
player.SendSpawn((byte)-1, player.name, x1, y1, z1, (byte)0, (byte)0);
|
||||
}
|
||||
player.SendSpawn(0xFF, player.name, x1, y1, z1, (byte)0, (byte)0);
|
||||
}
|
||||
{
|
||||
CountdownGame.squaresleft.Clear();
|
||||
|
@ -151,7 +151,7 @@ namespace MCGalaxy
|
||||
Player.GlobalMessage(player.color + player.name + Server.DefaultColor + " started the infection!");
|
||||
player.infected = true;
|
||||
player.color = c.red;
|
||||
Player.GlobalDie(player, false);
|
||||
Player.GlobalDespawn(player, false);
|
||||
Player.GlobalSpawn(player, player.pos[0], player.pos[1], player.pos[2], player.rot[0], player.rot[1], false);
|
||||
|
||||
Server.zombieRound = true;
|
||||
@ -184,7 +184,7 @@ namespace MCGalaxy
|
||||
if (player1.color != c.red)
|
||||
{
|
||||
player1.color = c.red;
|
||||
Player.GlobalDie(player1, false);
|
||||
Player.GlobalDespawn(player1, false);
|
||||
Player.GlobalSpawn(player1, player1.pos[0], player1.pos[1], player1.pos[2], player1.rot[0], player1.rot[1], false);
|
||||
}
|
||||
alive.ForEach(delegate(Player player2)
|
||||
@ -192,7 +192,7 @@ namespace MCGalaxy
|
||||
if (player2.color != player2.group.color)
|
||||
{
|
||||
player2.color = player2.group.color;
|
||||
Player.GlobalDie(player2, false);
|
||||
Player.GlobalDespawn(player2, false);
|
||||
Player.GlobalSpawn(player2, player2.pos[0], player2.pos[1], player2.pos[2], player2.rot[0], player2.rot[1], false);
|
||||
}
|
||||
if (player2.pos[0] / 32 == player1.pos[0] / 32 || player2.pos[0] / 32 == player1.pos[0] / 32 + 1 || player2.pos[0] / 32 == player1.pos[0] / 32 - 1)
|
||||
@ -239,7 +239,7 @@ namespace MCGalaxy
|
||||
}
|
||||
player2.color = c.red;
|
||||
player1.playersInfected = player1.playersInfected++;
|
||||
Player.GlobalDie(player2, false);
|
||||
Player.GlobalDespawn(player2, false);
|
||||
Player.GlobalSpawn(player2, player2.pos[0], player2.pos[1], player2.pos[2], player2.rot[0], player2.rot[1], false);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
@ -319,7 +319,7 @@ namespace MCGalaxy
|
||||
{
|
||||
if (!winners.CheckIfInsideBlock() && aliveCount == 0 && winners.level.name == currentLevelName)
|
||||
{
|
||||
Player.GlobalDie(winners, false);
|
||||
Player.GlobalDespawn(winners, false);
|
||||
Player.GlobalSpawn(winners, winners.pos[0], winners.pos[1], winners.pos[2], winners.rot[0], winners.rot[1], false);
|
||||
Random random2 = new Random();
|
||||
int randomInt = 0;
|
||||
@ -338,7 +338,7 @@ namespace MCGalaxy
|
||||
}
|
||||
else if (!winners.CheckIfInsideBlock() && (aliveCount == 1 && !winners.infected) && winners.level.name == currentLevelName)
|
||||
{
|
||||
Player.GlobalDie(winners, false);
|
||||
Player.GlobalDespawn(winners, false);
|
||||
Player.GlobalSpawn(winners, winners.pos[0], winners.pos[1], winners.pos[2], winners.rot[0], winners.rot[1], false);
|
||||
Random random2 = new Random();
|
||||
int randomInt = 0;
|
||||
@ -358,7 +358,7 @@ namespace MCGalaxy
|
||||
{
|
||||
player.infected = false;
|
||||
player.color = player.group.color;
|
||||
Player.GlobalDie(player, false);
|
||||
Player.GlobalDespawn(player, false);
|
||||
Player.GlobalSpawn(player, player.pos[0], player.pos[1], player.pos[2], player.rot[0], player.rot[1], false);
|
||||
if (player.level.name == currentLevelName)
|
||||
{
|
||||
@ -493,7 +493,7 @@ namespace MCGalaxy
|
||||
}
|
||||
Player.GlobalMessage(alive[firstinfect].color + alive[firstinfect].name + Server.DefaultColor + " continued the infection!");
|
||||
alive[firstinfect].color = c.red;
|
||||
Player.GlobalDie(alive[firstinfect], false);
|
||||
Player.GlobalDespawn(alive[firstinfect], false);
|
||||
Player.GlobalSpawn(alive[firstinfect], alive[firstinfect].pos[0], alive[firstinfect].pos[1], alive[firstinfect].pos[2], alive[firstinfect].rot[0], alive[firstinfect].rot[1], false);
|
||||
infectd.Add(alive[firstinfect]);
|
||||
alive.Remove(alive[firstinfect]);
|
||||
@ -534,7 +534,7 @@ namespace MCGalaxy
|
||||
alive.Remove(p);
|
||||
p.infected = true;
|
||||
p.color = c.red;
|
||||
Player.GlobalDie(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);
|
||||
aliveCount = alive.Count;
|
||||
}
|
||||
@ -547,7 +547,7 @@ namespace MCGalaxy
|
||||
alive.Add(p);
|
||||
p.infected = false;
|
||||
p.color = p.group.color;
|
||||
Player.GlobalDie(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);
|
||||
aliveCount = alive.Count;
|
||||
}
|
||||
|
@ -256,7 +256,6 @@
|
||||
<Compile Include="Commands\Moderation\CmdDemote.cs" />
|
||||
<Compile Include="Commands\Moderation\CmdEndRound.cs" />
|
||||
<Compile Include="Commands\Moderation\CmdExplode.cs" />
|
||||
<Compile Include="Commands\Moderation\CmdFetch.cs" />
|
||||
<Compile Include="Commands\Moderation\CmdFollow.cs" />
|
||||
<Compile Include="Commands\Moderation\CmdFreeze.cs" />
|
||||
<Compile Include="Commands\Moderation\CmdGcbanlistupdate.cs" />
|
||||
|
@ -450,7 +450,7 @@ namespace MCGalaxy {
|
||||
}
|
||||
|
||||
//TODO: Figure a way to SendPos without changing rotation
|
||||
public void SendDie(byte id) {
|
||||
public void SendDespawn(byte id) {
|
||||
SendRaw(Opcode.RemoveEntity, id);
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ namespace MCGalaxy
|
||||
if (HasExtension("ChangeModel"))
|
||||
{
|
||||
if (p == this)
|
||||
unchecked { SendChangeModel((byte)-1, model); }
|
||||
SendChangeModel(0xFF, model);
|
||||
else SendChangeModel(p.id, p.model);
|
||||
}
|
||||
}
|
||||
|
@ -1456,7 +1456,7 @@ namespace MCGalaxy {
|
||||
return;
|
||||
/*if (CheckIfInsideBlock())
|
||||
{
|
||||
unchecked { this.SendPos((byte)-1, (ushort)(clippos[0] - 18), (ushort)(clippos[1] - 18), (ushort)(clippos[2] - 18), cliprot[0], cliprot[1]); }
|
||||
this.SendPos(0xFF, (ushort)(clippos[0] - 18), (ushort)(clippos[1] - 18), (ushort)(clippos[2] - 18), cliprot[0], cliprot[1]);
|
||||
return;
|
||||
}*/
|
||||
byte thisid = message[0];
|
||||
@ -1477,7 +1477,7 @@ return;
|
||||
pos = new ushort[3] { x, y, z };
|
||||
rot = new byte[2] { rotx, roty };
|
||||
if ( countdowntempx != NetUtils.ReadU16(message, 1) || countdowntempz != NetUtils.ReadU16(message, 5) ) {
|
||||
unchecked { this.SendPos((byte)-1, pos[0], pos[1], pos[2], rot[0], rot[1]); }
|
||||
this.SendPos(0xFF, pos[0], pos[1], pos[2], rot[0], rot[1]);
|
||||
}
|
||||
} else {
|
||||
ushort x = NetUtils.ReadU16(message, 1);
|
||||
@ -1486,11 +1486,11 @@ return;
|
||||
|
||||
if ( !this.referee && Server.noRespawn && Server.ZombieModeOn ) {
|
||||
if ( this.pos[0] >= x + 70 || this.pos[0] <= x - 70 ) {
|
||||
unchecked { SendPos((byte)-1, pos[0], pos[1], pos[2], rot[0], rot[1]); }
|
||||
SendPos(0xFF, pos[0], pos[1], pos[2], rot[0], rot[1]);
|
||||
return;
|
||||
}
|
||||
if ( this.pos[2] >= z + 70 || this.pos[2] <= z - 70 ) {
|
||||
unchecked { SendPos((byte)-1, pos[0], pos[1], pos[2], rot[0], rot[1]); }
|
||||
SendPos(0xFF, pos[0], pos[1], pos[2], rot[0], rot[1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1506,7 +1506,7 @@ return;
|
||||
PlayerRotate(this, rot);
|
||||
PlayerRotateEvent.Call(this, rot);
|
||||
if ( cancelmove ) {
|
||||
unchecked { SendPos((byte)-1, pos[0], pos[1], pos[2], rot[0], rot[1]); }
|
||||
SendPos(0xFF, pos[0], pos[1], pos[2], rot[0], rot[1]);
|
||||
return;
|
||||
}
|
||||
byte rotx = message[7];
|
||||
@ -2233,6 +2233,7 @@ return;
|
||||
case "colour": cmd = "color"; break;
|
||||
case "materials": cmd = "blocks"; break;
|
||||
case "zz": cmd = "static"; message = "cuboid"; break;
|
||||
case "fetch": cmd = "summon"; break;
|
||||
|
||||
default: retry = false; break; //Unknown command, then
|
||||
}
|
||||
@ -2506,16 +2507,16 @@ return;
|
||||
{
|
||||
p.pos = new ushort[3] { x, y, z }; p.rot = new byte[2] { rotx, roty };
|
||||
p.oldpos = p.pos; p.basepos = p.pos; p.oldrot = p.rot;
|
||||
unchecked { p.SendSpawn((byte)-1, from.color + from.name + possession, x, y, z, rotx, roty); }
|
||||
p.SendSpawn(0xFF, from.color + from.name + possession, x, y, z, rotx, roty);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void GlobalDie(Player from, bool self) {
|
||||
public static void GlobalDespawn(Player from, bool self) {
|
||||
players.ForEach(delegate(Player p) {
|
||||
if ( p.level != from.level || ( from.hidden && !self ) ) { return; }
|
||||
if ( p != from ) { p.SendDie(from.id); }
|
||||
else if ( self ) { p.SendDie(255); }
|
||||
if ( p != from ) { p.SendDespawn(from.id); }
|
||||
else if ( self ) { p.SendDespawn(255); }
|
||||
});
|
||||
}
|
||||
|
||||
@ -2527,7 +2528,7 @@ return;
|
||||
}
|
||||
marker = " (" + controller.color + controller.name + color + ")";
|
||||
}
|
||||
GlobalDie(this, true);
|
||||
GlobalDespawn(this, true);
|
||||
GlobalSpawn(this, pos[0], pos[1], pos[2], rot[0], rot[1], true, marker);
|
||||
return true;
|
||||
}
|
||||
@ -2633,7 +2634,7 @@ return;
|
||||
tntwarsgame.SendAllPlayersMessage("TNT Wars: " + color + name + Server.DefaultColor + " has left TNT Wars!");
|
||||
}
|
||||
|
||||
GlobalDie(this, false);
|
||||
GlobalDespawn(this, false);
|
||||
if ( kickString == "Disconnected." || kickString.IndexOf("Server shutdown") != -1 || kickString == Server.customShutdownMessage ) {
|
||||
if ( !Directory.Exists("text/logout") ) {
|
||||
Directory.CreateDirectory("text/logout");
|
||||
@ -2829,7 +2830,7 @@ foreach (Player p in players)
|
||||
if (p.id == i) { goto Next; }
|
||||
} return i;
|
||||
Next: continue;
|
||||
} unchecked { return (byte)-1; }*/
|
||||
} unchecked { return 0xFF; }*/
|
||||
|
||||
for ( byte i = 0; i < 255; i++ ) {
|
||||
bool used = players.Any(p => p.id == i);
|
||||
|
@ -407,7 +407,7 @@ namespace MCGalaxy
|
||||
Player.players.ForEach(delegate(Player p)
|
||||
{
|
||||
if (p.level != level) { return; }
|
||||
p.SendDie(id);
|
||||
p.SendDespawn(id);
|
||||
});
|
||||
playerbots.Remove(this); //dont know if this is allowed really calling itself to kind of die
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ namespace MCGalaxy
|
||||
{
|
||||
if (p.team != null) { p.team.RemoveMember(p); }
|
||||
p.team = this;
|
||||
Player.GlobalDie(p, false);
|
||||
Player.GlobalDespawn(p, false);
|
||||
//p.CTFtempcolor = p.color;
|
||||
//p.CTFtempprefix = p.prefix;
|
||||
p.color = "&" + color;
|
||||
@ -61,7 +61,7 @@ namespace MCGalaxy
|
||||
if (p.team == this)
|
||||
{
|
||||
p.team = null;
|
||||
Player.GlobalDie(p, false);
|
||||
Player.GlobalDespawn(p, false);
|
||||
//p.color = p.CTFtempcolor;
|
||||
//p.prefix = p.CTFtempprefix;
|
||||
//p.carryingFlag = false;
|
||||
@ -89,10 +89,7 @@ namespace MCGalaxy
|
||||
ushort y1 = (ushort)((1 + y) * 32);
|
||||
ushort z1 = (ushort)((0.5 + z) * 32);
|
||||
rotx = spawns[rnd].rotx;
|
||||
unchecked
|
||||
{
|
||||
p.SendSpawn((byte)-1, p.name, x1, y1, z1, (byte)rotx, 0);
|
||||
}
|
||||
p.SendSpawn((byte)0xFF, p.name, x1, y1, z1, (byte)rotx, 0);
|
||||
//p.health = 100;
|
||||
}
|
||||
else
|
||||
@ -102,11 +99,7 @@ namespace MCGalaxy
|
||||
ushort z = (ushort)((0.5 + mapOn.spawnz) * 32);
|
||||
ushort rotx = mapOn.rotx;
|
||||
ushort roty = mapOn.roty;
|
||||
|
||||
unchecked
|
||||
{
|
||||
p.SendSpawn((byte)-1, p.name, x, y, z, (byte)rotx, (byte)roty);
|
||||
}
|
||||
p.SendSpawn(0xFF, p.name, x, y, z, (byte)rotx, (byte)roty);
|
||||
}
|
||||
//p.spawning = false;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace MCGalaxy {
|
||||
Command.all.Find("goto").Use(p, lvl.name);
|
||||
while ( p.Loading ) { Thread.Sleep(250); }
|
||||
}
|
||||
unchecked { p.SendPos((byte)-1, wp.x, wp.y, wp.z, wp.rotx, wp.roty); }
|
||||
p.SendPos(0xFF, wp.x, wp.y, wp.z, wp.rotx, wp.roty);
|
||||
Player.SendMessage(p, "Sent you to waypoint");
|
||||
}
|
||||
else { Player.SendMessage(p, "The map that that waypoint is on isn't loaded right now (" + wp.lvlname + ")"); return; }
|
||||
|
@ -937,7 +937,7 @@ namespace MCGalaxy
|
||||
|
||||
if (p.frozen)
|
||||
{
|
||||
unchecked { p.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1]); } continue;
|
||||
p.SendPos(0xFF, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1]); continue;
|
||||
}
|
||||
else if (p.following != "")
|
||||
{
|
||||
@ -957,11 +957,11 @@ namespace MCGalaxy
|
||||
}
|
||||
if (p.canBuild)
|
||||
{
|
||||
unchecked { p.SendPos((byte)-1, who.pos[0], (ushort)(who.pos[1] - 16), who.pos[2], who.rot[0], who.rot[1]); }
|
||||
p.SendPos(0xFF, who.pos[0], (ushort)(who.pos[1] - 16), who.pos[2], who.rot[0], who.rot[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1]); }
|
||||
p.SendPos(0xFF, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1]);
|
||||
}
|
||||
}
|
||||
else if (p.possess != "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user