예제 #1
0
		internal static ServerMessage SerializeTicketChatlog(SupportTicket Ticket, RoomData RoomData, double Timestamp)
		{
			ServerMessage result;
			using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
			{
				queryreactor.setQuery(string.Concat(new object[]
				{
					"SELECT user_id,timestamp,message FROM chatlogs WHERE room_id = ",
					RoomData.Id,
					" AND (timestamp >= ",
					Timestamp - 300.0,
					" AND timestamp <= ",
					Timestamp,
					") OR (timestamp >= ",
					Timestamp - 300.0,
					" AND timestamp = 0) ORDER BY timestamp DESC LIMIT 150"
				}));
				DataTable table = queryreactor.getTable();
				ServerMessage serverMessage = new ServerMessage(Outgoing.ModerationToolIssueChatlogMessageComposer);
				serverMessage.AppendUInt(Ticket.TicketId);
				serverMessage.AppendUInt(Ticket.SenderId);
				serverMessage.AppendUInt(Ticket.ReportedId);
				serverMessage.AppendUInt(RoomData.Id);
				serverMessage.AppendBoolean(false);
				serverMessage.AppendUInt(RoomData.Id);
				serverMessage.AppendString(RoomData.Name);
				if (table != null)
				{
					serverMessage.AppendInt32(table.Rows.Count);
					IEnumerator enumerator = table.Rows.GetEnumerator();
					try
					{
						while (enumerator.MoveNext())
						{
							DataRow dataRow = (DataRow)enumerator.Current;
							Habbo habboForId = MercuryEnvironment.getHabboForId(Convert.ToUInt32(dataRow["user_id"]));
							serverMessage.AppendInt32(MercuryEnvironment.UnixToDateTime(Convert.ToDouble(dataRow["timestamp"])).Minute);
							serverMessage.AppendUInt(habboForId.Id);
							serverMessage.AppendString(habboForId.Username);
							serverMessage.AppendString((string)dataRow["message"]);
						}
						goto IL_1B8;
					}
					finally
					{
						IDisposable disposable = enumerator as IDisposable;
						if (disposable != null)
						{
							disposable.Dispose();
						}
					}
				}
				serverMessage.AppendInt32(0);
				IL_1B8:
				result = serverMessage;
			}
			return result;
		}
예제 #2
0
		internal static void SendTicketUpdateToModerators(SupportTicket Ticket)
		{
		}
예제 #3
0
		internal static void SendTicketToModerators(SupportTicket Ticket)
		{
			ServerMessage message = new ServerMessage(Outgoing.ModerationToolIssueMessageComposer);
			message = Ticket.Serialize(message);
            MercuryEnvironment.GetGame().GetClientManager().StaffAlert(message);
		}
예제 #4
0
        internal void SendNewTicket(GameClient Session, int Category, uint ReportedUser, string Message, int type, List<string> Messages)
		{
            UInt32 Id = 0;

				if (Session.GetHabbo().CurrentRoomId <= 0)
				{
					using (IQueryAdapter DBClient = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
					{
						DBClient.setQuery(string.Concat(new object[]
						{
							"INSERT INTO moderation_tickets (score,type,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) VALUES (1,'",
							Category,
							"','open','",
							Session.GetHabbo().Id,
							"','",
							ReportedUser,
							"','0',@message,'0','','",
							MercuryEnvironment.GetUnixTimestamp(),
							"')"
						}));
						DBClient.addParameter("message", Message);
						Id = (uint)DBClient.insertQuery();
						DBClient.runFastQuery("UPDATE user_info SET cfhs = cfhs + 1 WHERE user_id = " + Session.GetHabbo().Id);
					}

					SupportTicket Ticket = new SupportTicket(Id, 1, type, Session.GetHabbo().Id, ReportedUser, Message, 0u, "", (double)MercuryEnvironment.GetUnixTimestamp(), Messages);
                    this.Tickets.Add(Ticket);
                    ModerationTool.SendTicketToModerators(Ticket);
					return;
				}

				RoomData Data = MercuryEnvironment.GetGame().GetRoomManager().GenerateNullableRoomData(Session.GetHabbo().CurrentRoomId);
				using (IQueryAdapter DBClient = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
				{
					DBClient.setQuery(string.Concat(new object[]
					{
						"INSERT INTO moderation_tickets (score,type,status,sender_id,reported_id,moderator_id,message,room_id,room_name,timestamp) VALUES (1,'",
						Category,
						"','open','",
						Session.GetHabbo().Id,
						"','",
						ReportedUser,
						"','0',@message,'",
						Data.Id,
						"',@name,'",
						MercuryEnvironment.GetUnixTimestamp(),
						"')"
					}));
					DBClient.addParameter("message", Message);
					DBClient.addParameter("name", Data.Name);
					Id = (uint)DBClient.insertQuery();
					DBClient.runFastQuery("UPDATE user_info SET cfhs = cfhs + 1 WHERE user_id = " + Session.GetHabbo().Id);
				}
				SupportTicket Ticket2 = new SupportTicket(Id, 1, type, Session.GetHabbo().Id, ReportedUser, Message, 0u, "", (double)MercuryEnvironment.GetUnixTimestamp(), Messages);
                this.Tickets.Add(Ticket2);
                ModerationTool.SendTicketToModerators(Ticket2);
		}