예제 #1
0
		public static void System_Broadcast(string from, string format, params object[] args)
		{
			var packet = new Packet(Op.Chat, MabiId.Broadcast);

			foreach (var msg in string.Format(format, args).Chunkify(100)) // Mabi displays up to 100 chars
			{
				packet.PutByte(0);
				packet.PutString("<{0}>", from);
				packet.PutString(msg);
				packet.PutByte(true);
				packet.PutUInt(0xFFFF8080);
				packet.PutInt(0);
				packet.PutByte(0);

				ChannelServer.Instance.World.Broadcast(packet);

				packet.Clear(packet.Op, packet.Id);
			}
		}
예제 #2
0
		/// <summary>
		/// Sends system message (special Chat) to creature's client.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="from"></param>
		/// <param name="format"></param>
		/// <param name="args"></param>
		private static void SystemMessage(Creature creature, string from, string format, params object[] args)
		{
			var packet = new Packet(Op.Chat, creature.EntityId);

			foreach (var msg in string.Format(format, args).Chunkify(100)) // Mabi displays up to 100 chars
			{
				packet.PutByte(0);
				packet.PutString(from);
				packet.PutString(msg);
				packet.PutByte(true);
				packet.PutUInt(0xFFFF8080);
				packet.PutInt(0);
				packet.PutByte(0);

				creature.Client.Send(packet);

				packet.Clear(packet.Op, packet.Id);
			}
		}