Пример #1
0
        public bool doWarpClaimProcess(int claimNum)
        {
            if (!this.player.inPlayerShip)
            {
                client.sendChatMessage("You must be on your ship to warp");
                return(false);
            }

            var claims = Claims.GetClaims(this.player);

            if (claims.Count < claimNum)
            {
                client.sendChatMessage("You do not have that claim to warp to.");
                return(false);
            }
            var          warpCoord   = claims[claimNum - 1];
            MemoryStream packetWarp  = new MemoryStream();
            BinaryWriter packetWrite = new BinaryWriter(packetWarp);
            uint         warp        = (uint)WarpType.MoveShip;

            packetWrite.WriteBE(warp);
            packetWrite.Write(warpCoord);
            packetWrite.WriteStarString("");
            client.sendServerPacket(Packet.WarpCommand, packetWarp.ToArray());
            return(true);
        }
Пример #2
0
        public bool doListClaimProcess()
        {
            var           v  = Claims.GetClaims(this.player);
            int           i  = 0;
            StringBuilder sb = new StringBuilder();

            foreach (var loc in v)
            {
                sb.AppendFormat("{0}: {1}\n", ++i, loc);
            }
            if (i == 0)
            {
                sb.AppendLine("You have staked no claims.");
            }
            client.sendChatMessage(sb.ToString());
            return(true);
        }
Пример #3
0
        public bool doReleaseClaimProcess(int claimNum)
        {
            var claims = Claims.GetClaims(player);

            if (claims.Count < claimNum)
            {
                client.sendChatMessage("You do not have that claim to release.");
                return(false);
            }
            if (Claims.ReleaseClaim(player, claims[claimNum - 1]))
            {
                client.sendChatMessage("You have sucesfully released a claim.");
                return(true);
            }
            client.sendChatMessage("Something?");
            return(false);
        }