/// <summary>
        /// Sends CityDataStartPacket.
        /// </summary>
        /// <param name="s">The session.</param>
        /// <param name="p">Packet BRequestCityData.</param>
        public static void SendResponseCityDataStart(Session s, Package p)
        {
            Player ObjPlayer = s.Player;

            PacketBResponseCityDataStartPacket ResponseContent = new PacketBResponseCityDataStartPacket(ObjPlayer.Id, ObjPlayer.Empire.CurrentCharacter.Capscenario, 1);

            Logger.Debug($"{p.Key}::SendResponseCityDataStart - Execute command: {ResponseContent}");

            byte[] Response = ResponseContent.ToByteArray();

            Package Package = new Package(p.HeaderXuid, p.HeaderField20, p.HeaderServiceId, p.HeaderField22, PacketTypes.BResponseCityDataStartPacket, p.HeaderRequestId, Response);

            byte[] ToSend = Package.ToByteArray();

            s.Send(ToSend, 0, ToSend.Length);
        }
Example #2
0
        /// <summary>
        /// Sends CityDataStartPacket.
        /// </summary>
        /// <param name="s">The session.</param>
        /// <param name="p">Packet BRequestCityData.</param>
        /// <param name="r">Packet BRequestCityData content.</param>
        private static void _SendResponseCityDataStart(Session s, Package p, PacketBRequestCityDataPacket r)
        {
            PacketBResponseCityDataStartPacket ResponseContent = new PacketBResponseCityDataStartPacket(p.HeaderXuid, "Capitals/CAPITAL_C01_02", 1);

            if (s.Logger.IsDebugEnabled)
            {
                s.Logger.Debug($"Command response: {ResponseContent}");
            }

            byte[] Response = ResponseContent.ToByteArray();

            Package Package = new Package(p.HeaderXuid, p.HeaderField20, p.HeaderServiceId, p.HeaderField22, (byte)PacketTypes.BResponseCityDataStartPacket, p.HeaderRequestId, Response);

            byte[] ToSend = Package.ToByteArray();

            s.Send(ToSend, 0, ToSend.Length);
        }