Пример #1
0
        /// <summary>
        /// Sends ChannelDisconnectR to client.
        /// </summary>
        /// <param name="client"></param>
        public static void ChannelDisconnectR(ChannelClient client)
        {
            var packet = new Packet(Op.DisconnectRequestR, MabiId.Channel);
            packet.PutByte(0);

            client.Send(packet);
        }
Пример #2
0
        /// <summary>
        /// Sends EntitiesAppear to client, unless entities is empty.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="entities"></param>
        public static void EntitiesAppear(ChannelClient client, IEnumerable <Entity> entities)
        {
            // Count() is much faster then creating a list, speed being
            // important in this method.
            var count = (short)entities.Count();

            if (count < 1)
            {
                return;
            }

            var packet = new Packet(Op.EntitiesAppear, MabiId.Broadcast);

            packet.PutShort(count);
            foreach (var entity in entities)
            {
                var data = Packet.Empty().AddPublicEntityInfo(entity).Build();

                packet.PutShort((short)entity.DataType);
                packet.PutInt(data.Length);
                packet.PutBin(data);
            }

            client.Send(packet);
        }
Пример #3
0
        /// <summary>
        /// Sends DcUnkR to client.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="val"></param>
        public static void DcUnkR(ChannelClient client, long val)
        {
            var packet = new Packet(Op.DcUnkR, MabiId.Channel);

            packet.PutLong(val);

            client.Send(packet);
        }
Пример #4
0
        /// <summary>
        /// Sends ChannelDisconnectR to client.
        /// </summary>
        /// <param name="client"></param>
        public static void ChannelDisconnectR(ChannelClient client)
        {
            var packet = new Packet(Op.DisconnectRequestR, MabiId.Channel);

            packet.PutByte(0);

            client.Send(packet);
        }
Пример #5
0
        /// <summary>
        /// Sends GetChannelList to client.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="server"></param>
        public static void GetChannelListR(ChannelClient client, ServerInfo server)
        {
            var packet = new Packet(Op.GetChannelListR, MabiId.Channel);

            packet.AddServerInfo(server, ServerInfoType.Client);

            client.Send(packet);
        }
Пример #6
0
        /// <summary>
        /// Sends ChannelLoginR to client.
        /// </summary>
        /// <remarks>
        /// Sending a negative response doesn't do anything.
        /// </remarks>
        public static void ChannelLoginR(ChannelClient client, long creatureId)
        {
            var packet = new Packet(Op.ChannelLoginR, MabiId.Channel);
            packet.PutByte(true);
            packet.PutLong(creatureId);
            packet.PutLong(DateTime.Now);
            packet.PutInt((int)DateTime.Now.DayOfWeek);
            packet.PutString(""); // http://211.218.233.238/korea/

            client.Send(packet);
        }
Пример #7
0
        /// <summary>
        /// Sends ChannelLoginR to client.
        /// </summary>
        /// <remarks>
        /// Sending a negative response doesn't do anything.
        /// </remarks>
        public static void ChannelLoginR(ChannelClient client, long creatureId)
        {
            var packet = new Packet(Op.ChannelLoginR, MabiId.Channel);

            packet.PutByte(true);
            packet.PutLong(creatureId);
            packet.PutLong(DateTime.Now);
            packet.PutInt((int)DateTime.Now.DayOfWeek);
            packet.PutString("");             // http://211.218.233.238/korea/

            client.Send(packet);
        }
        /// <summary>
        /// Sends ChannelCharacterInfoRequestR for creature to client.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="creature">Negative response if null</param>
        public static void ChannelCharacterInfoRequestR(ChannelClient client, Creature creature)
        {
            var packet = new Packet(Op.ChannelCharacterInfoRequestR, MabiId.Channel);

            packet.PutByte(creature != null);

            if (creature != null)
            {
                packet.AddCreatureInfo(creature, CreaturePacketType.Private);
            }

            client.Send(packet);
        }
        /// <summary>
        /// Sends EnterRegionRequestR for creature to creature's client.
        /// </summary>
        /// <remarks>
        /// Negative response doesn't actually do anything, stucks.
        /// </remarks>
        /// <param name="client"></param>
        /// <param name="creature">Negative response if null</param>
        public static void EnterRegionRequestR(ChannelClient client, Creature creature)
        {
            var packet = new Packet(Op.EnterRegionRequestR, MabiId.Channel);

            packet.PutByte(creature != null);

            if (creature != null)
            {
                packet.PutLong(creature.EntityId);
                packet.PutLong(DateTime.Now);
            }

            client.Send(packet);
        }
Пример #10
0
        /// <summary>
        /// Sends EntitiesDisappear to client, unless entities is empty.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="entities"></param>
        public static void EntitiesDisappear(ChannelClient client, IEnumerable<Entity> entities)
        {
            var count = (short)entities.Count();
            if (count < 1)
                return;

            var packet = new Packet(Op.EntitiesDisappear, MabiId.Broadcast);
            packet.PutShort(count);
            foreach (var entity in entities)
            {
                packet.PutShort((short)entity.DataType);
                packet.PutLong(entity.EntityId);
            }

            client.Send(packet);
        }
Пример #11
0
        /// <summary>
        /// Sends EntitiesAppear to client, unless entities is empty.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="entities"></param>
        public static void EntitiesAppear(ChannelClient client, IEnumerable<Entity> entities)
        {
            var count = (short)entities.Count();
            if (count < 1)
                return;

            var packet = new Packet(Op.EntitiesAppear, MabiId.Broadcast);
            packet.PutShort(count);
            foreach (var entity in entities)
            {
                var data = Packet.Empty().AddPublicEntityInfo(entity).Build(false);

                packet.PutShort((short)entity.DataType);
                packet.PutInt(data.Length);
                packet.PutBin(data);
            }

            client.Send(packet);
        }
Пример #12
0
        /// <summary>
        /// Sends EntitiesDisappear to client, unless entities is empty.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="entities"></param>
        public static void EntitiesDisappear(ChannelClient client, IEnumerable <Entity> entities)
        {
            var count = (short)entities.Count();

            if (count < 1)
            {
                return;
            }

            var packet = new Packet(Op.EntitiesDisappear, MabiId.Broadcast);

            packet.PutShort(count);
            foreach (var entity in entities)
            {
                packet.PutShort((short)entity.DataType);
                packet.PutLong(entity.EntityId);
            }

            client.Send(packet);
        }
Пример #13
0
 static void ClientSendMessageToServer()
 {
     Debug.Log("[Step 4]: Clients are sending data!");
     s_BinaryClient.Send(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 });
     s_StringClient.Send("Hello world!");
 }
Пример #14
0
		/// <summary>
		/// Sends EnterRegionRequestR for creature to creature's client.
		/// </summary>
		/// <remarks>
		/// Negative response doesn't actually do anything, stucks.
		/// </remarks>
		/// <param name="client"></param>
		/// <param name="creature">Negative response if null</param>
		public static void EnterRegionRequestR(ChannelClient client, Creature creature)
		{
			var packet = new Packet(Op.EnterRegionRequestR, MabiId.Channel);
			packet.PutByte(creature != null);

			if (creature != null)
			{
				packet.PutLong(creature.EntityId);
				packet.PutLong(DateTime.Now);
			}

			client.Send(packet);
		}
Пример #15
0
		/// <summary>
		/// Sends EntitiesAppear to client, unless entities is empty.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="entities"></param>
		public static void EntitiesAppear(ChannelClient client, IEnumerable<Entity> entities)
		{
			// Count() is much faster then creating a list, speed being
			// important in this method.
			var count = (short)entities.Count();
			if (count < 1)
				return;

			var packet = new Packet(Op.EntitiesAppear, MabiId.Broadcast);
			packet.PutShort(count);
			foreach (var entity in entities)
			{
				var data = Packet.Empty().AddPublicEntityInfo(entity).Build();

				packet.PutShort((short)entity.DataType);
				packet.PutInt(data.Length);
				packet.PutBin(data);
			}

			client.Send(packet);
		}
Пример #16
0
		/// <summary>
		/// Sends ChannelCharacterInfoRequestR for creature to client.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="creature">Negative response if null</param>
		public static void ChannelCharacterInfoRequestR(ChannelClient client, Creature creature)
		{
			var packet = new Packet(Op.ChannelCharacterInfoRequestR, MabiId.Channel);
			packet.PutByte(creature != null);

			if (creature != null)
			{
				packet.AddCreatureInfo(creature, CreaturePacketType.Private);
			}

			client.Send(packet);
		}
Пример #17
0
		/// <summary>
		/// Sends GetChannelList to client.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="server"></param>
		public static void GetChannelListR(ChannelClient client, ServerInfo server)
		{
			var packet = new Packet(Op.GetChannelListR, MabiId.Channel);
			packet.AddServerInfo(server, ServerInfoType.Client);

			client.Send(packet);
		}
Пример #18
0
		/// <summary>
		/// Sends DcUnkR to client.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="val"></param>
		public static void DcUnkR(ChannelClient client, long val)
		{
			var packet = new Packet(Op.DcUnkR, MabiId.Channel);
			packet.PutLong(val);

			client.Send(packet);
		}