Esempio n. 1
0
		public static void HandleCreateTicketPacket(IRealmClient client, RealmPacketIn packet)
		{
			var chr = client.ActiveCharacter;
			if (chr.Ticket == null)
			{
				var map = (MapId)packet.ReadUInt32();
				var x = packet.ReadFloat();
				var y = packet.ReadFloat();
				var z = packet.ReadFloat();
				var msg = packet.ReadCString();
				var type = (TicketType)packet.ReadUInt32(); // prev. unk0

				var unk1 = packet.ReadByte(); // unk1, 1
				var unk2 = packet.ReadUInt32(); // unk2, 0
				var unk3 = packet.ReadUInt32(); // unk3, 0

				var ticket = new Ticket(chr, msg, type);

				TicketMgr.Instance.AddTicket(ticket);
				chr.Ticket = ticket;
				SendCreateResponse(client, TicketInfoResponse.Saved);
			}
			else
			{
				SendCreateResponse(client, TicketInfoResponse.Fail);
			}
		}
Esempio n. 2
0
		public Ticket EnsureSelectedHandlingTicket()
		{
			if (m_handlingTicket == null)
			{
				m_handlingTicket = TicketMgr.Instance.GetNextUnhandledTicket(m_owner);
			}
			return m_handlingTicket;
		}
Esempio n. 3
0
        public override void Process(CmdTrigger<RealmServerCmdArgs> trigger)
        {
            var name = trigger.Text.NextWord();
            var tType = trigger.Text.NextEnum<TicketType>(" ");
            //var text = trigger.Text.RemainingWords(" ").ToString();
            var text = trigger.Text.NextWord();
            var chr = trigger.Args.GetCharArgumentOrTarget(trigger, name);

            var ticket = new Ticket(chr, text, tType);
            TicketMgr.Instance.AddTicket(ticket);
            trigger.Reply("Placeholder");
        }
Esempio n. 4
0
		public static void SendResolveResponse(IPacketReceiver client, Ticket ticket)
		{
			ticket.Delete();
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GMTICKET_RESOLVE_RESPONSE, 4))
			{
				packet.WriteByte(0);
				client.Send(packet);
			}
		#endregion
		}
Esempio n. 5
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="client"></param>
		/// <param name="ticket">Can be null</param>
		public static void SendGetTicketResponse(IPacketReceiver client, Ticket ticket)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GMTICKET_GETTICKET))
			{
				if (ticket != null)
				{
					packet.Write((uint)TicketInfoResponse.Pending);
					packet.WriteCString(ticket.Message);
					packet.Write((byte)ticket.Type);
					packet.Write((float)0);
					packet.Write((float)0);
					packet.Write((float)0);
					packet.Write((ushort)0);
					client.Send(packet);
				}
				else
				{
					packet.Write((uint)TicketInfoResponse.NoTicket);
				}
			}
		}
Esempio n. 6
0
		public bool MayHandle(Ticket ticket)
		{
			var handler = ticket.m_handler;
			return handler == null || handler.Role <= Role;
		}
Esempio n. 7
0
 // Only staff members can handle tickets anyway.
 // Therefor they cannot call ticket handling commands without being staff
 public bool MayHandle(Ticket ticket)
 {
     return m_Acc.Role.IsStaff;
 }