-
[HELP] Chatlogs
Hi, I'm using Phoenix 3.11, i stumbled across a glitch where anyone who is staff, their chat logs will not insert into the database; here is the code wondering if anyone can take a look for me, would be appreciated! :ott:
Class140
Code:
using System;
using Phoenix.HabboHotel.GameClients;
using Phoenix.Messages;
namespace Phoenix.Communication.Messages.Help
{
internal sealed class GetUserChatlogMessageEvent : Interface
{
public void Handle(GameClient Session, ClientMessage Event)
{
if (Session.GetHabbo().HasFuse("acc_chatlogs"))
{
Session.method_14(Phoenix.GetGame().GetModerationTool().method_20(Event.PopWiredUInt()));
}
}
}
}
Class112
Code:
public GClass5 method_19(uint uint_0)
{
GClass5 result;
using (Class6 @class = Phoenix.smethod_12().method_0())
{
DataTable dataTable = @class.method_3("SELECT room_id,hour,minute FROM user_roomvisits WHERE user_id = '" + uint_0 + "' ORDER BY entry_timestamp DESC LIMIT 50");
GClass5 gClass = new GClass5(537u);
gClass.method_11(uint_0);
gClass.method_7(Phoenix.smethod_15().method_2().method_26(uint_0));
if (dataTable != null)
{
gClass.method_9(dataTable.Rows.Count);
IEnumerator enumerator = dataTable.Rows.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
DataRow dataRow = (DataRow)enumerator.Current;
Class27 class2 = Phoenix.smethod_15().method_9().method_11((uint)dataRow["room_id"]);
gClass.method_13(class2.Boolean_0);
gClass.method_11(class2.uint_0);
gClass.method_7(class2.string_0);
gClass.method_9((int)dataRow["hour"]);
gClass.method_9((int)dataRow["minute"]);
}
goto IL_12A;
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
}
gClass.method_9(0);
IL_12A:
result = gClass;
}
return result;
}
public GClass5 method_20(uint uint_0)
{
GClass5 result;
using (Class6 @class = Phoenix.smethod_12().method_0())
{
DataTable dataTable = @class.method_3("SELECT room_id,entry_timestamp,exit_timestamp FROM user_roomvisits WHERE user_id = '" + uint_0 + "' ORDER BY entry_timestamp DESC LIMIT 5");
GClass5 gClass = new GClass5(536u);
gClass.method_11(uint_0);
gClass.method_7(Phoenix.smethod_15().method_2().method_26(uint_0));
if (dataTable != null)
{
gClass.method_9(dataTable.Rows.Count);
IEnumerator enumerator = dataTable.Rows.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
DataRow dataRow = (DataRow)enumerator.Current;
DataTable dataTable2;
if ((double)dataRow["exit_timestamp"] <= 0.0)
{
dataTable2 = @class.method_3(string.Concat(new object[]
{
"SELECT user_id,user_name,hour,minute,message FROM chatlogs WHERE room_id = '",
(uint)dataRow["room_id"],
"' AND timestamp > ",
(double)dataRow["entry_timestamp"],
" AND timestamp < UNIX_TIMESTAMP() ORDER BY timestamp DESC LIMIT 100"
}));
}
else
{
dataTable2 = @class.method_3(string.Concat(new object[]
{
"SELECT user_id,user_name,hour,minute,message FROM chatlogs WHERE room_id = '",
(uint)dataRow["room_id"],
"' AND timestamp > ",
(double)dataRow["entry_timestamp"],
" AND timestamp < ",
(double)dataRow["exit_timestamp"],
" ORDER BY timestamp DESC LIMIT 100"
}));
}
Class27 class2 = Phoenix.smethod_15().method_9().method_11((uint)dataRow["room_id"]);
gClass.method_13(class2.Boolean_0);
gClass.method_11(class2.uint_0);
gClass.method_7(class2.string_0);
if (dataTable2 != null)
{
gClass.method_9(dataTable2.Rows.Count);
IEnumerator enumerator2 = dataTable2.Rows.GetEnumerator();
try
{
while (enumerator2.MoveNext())
{
DataRow dataRow2 = (DataRow)enumerator2.Current;
gClass.method_9((int)dataRow2["hour"]);
gClass.method_9((int)dataRow2["minute"]);
gClass.method_11((uint)dataRow2["user_id"]);
gClass.method_7((string)dataRow2["user_name"]);
gClass.method_7((string)dataRow2["message"]);
}
continue;
}
finally
{
IDisposable disposable = enumerator2 as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
}
gClass.method_9(0);
}
goto IL_2EF;
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
}
gClass.method_9(0);
IL_2EF:
result = gClass;
}
return result;
}
public GClass5 method_21(Class111 class111_0, Class27 class27_0, double double_0)
{
GClass5 result;
using (Class6 @class = Phoenix.smethod_12().method_0())
{
DataTable dataTable = @class.method_3(string.Concat(new object[]
{
"SELECT user_id,user_name,hour,minute,message FROM chatlogs WHERE room_id = '",
class27_0.uint_0,
"' AND timestamp >= '",
double_0 - 300.0,
"' AND timestamp < UNIX_TIMESTAMP() ORDER BY timestamp DESC LIMIT 100"
}));
GClass5 gClass = new GClass5(534u);
gClass.method_11(class111_0.UInt32_0);
gClass.method_11(class111_0.uint_1);
gClass.method_11(class111_0.uint_2);
gClass.method_13(class27_0.Boolean_0);
gClass.method_11(class27_0.uint_0);
gClass.method_7(class27_0.string_0);
if (dataTable != null)
{
gClass.method_9(dataTable.Rows.Count);
IEnumerator enumerator = dataTable.Rows.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
DataRow dataRow = (DataRow)enumerator.Current;
gClass.method_9((int)dataRow["hour"]);
gClass.method_9((int)dataRow["minute"]);
gClass.method_11((uint)dataRow["user_id"]);
gClass.method_7((string)dataRow["user_name"]);
gClass.method_7((string)dataRow["message"]);
}
goto IL_186;
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
}
gClass.method_9(0);
IL_186:
result = gClass;
}
return result;
}
public GClass5 method_22(uint uint_0)
{
Class14 @class = Phoenix.smethod_15().method_9().method_19(uint_0);
if @class == null)
{
throw new ArgumentException();
}
bool bool_ = false;
if @class.string_2.ToLower() == "public")
{
bool_ = true;
}
GClass5 result;
using (Class6 class2 = Phoenix.smethod_12().method_0())
{
DataTable dataTable = class2.method_3("SELECT user_id,user_name,hour,minute,message FROM chatlogs WHERE room_id = '" + @class.UInt32_0 + "' ORDER BY timestamp DESC LIMIT 150");
GClass5 gClass = new GClass5(535u);
gClass.method_13(bool_);
gClass.method_11 @class.UInt32_0);
gClass.method_7 @class.string_0);
if (dataTable != null)
{
gClass.method_9(dataTable.Rows.Count);
IEnumerator enumerator = dataTable.Rows.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
DataRow dataRow = (DataRow)enumerator.Current;
gClass.method_9((int)dataRow["hour"]);
gClass.method_9((int)dataRow["minute"]);
gClass.method_11((uint)dataRow["user_id"]);
gClass.method_7((string)dataRow["user_name"]);
gClass.method_7((string)dataRow["message"]);
}
goto IL_17A;
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
}
gClass.method_9(0);
IL_17A:
result = gClass;
}
return result;
}
}
}
Class105
Code:
internal void method_18(uint uint_1, string string_0)
{
if (!this.method_9(uint_1, this.uint_0))
{
this.method_20(6, uint_1);
}
else
{
Class16 @class = Phoenix.smethod_15().method_2().method_2(uint_1);
if @class == null || @class.method_2().method_21() == null)
{
this.method_20(5, uint_1);
}
else
{
if (this.method_25().method_2().bool_3)
{
this.method_20(4, uint_1);
}
else
{
if @class.method_2().bool_3)
{
this.method_20(3, uint_1);
}
if (this.method_25().method_2().method_4() > 0)
{
TimeSpan timeSpan = DateTime.Now - this.method_25().method_2().dateTime_0;
if (timeSpan.Seconds > 4)
{
this.method_25().method_2().int_23 = 0;
}
if (timeSpan.Seconds < 4 && this.method_25().method_2().int_23 > 5)
{
this.method_20(4, uint_1);
return;
}
this.method_25().method_2().dateTime_0 = DateTime.Now;
this.method_25().method_2().int_23++;
}
string_0 = Class58.smethod_4(string_0);
if (Class13.Boolean_4 && !this.method_25().method_2().bool_0)
{
using (Class6 class2 = Phoenix.smethod_12().method_0())
{
class2.method_0("message", "<PM to " + @class.method_2().string_0 + ">: " + string_0);
class2.method_1(string.Concat(new object[]
{
"INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('",
this.method_25().method_2().uint_0,
"','0','",
DateTime.Now.Hour,
"','",
DateTime.Now.Minute,
"',UNIX_TIMESTAMP() @message,'",
this.method_25().method_2().string_0,
"','",
DateTime.Now.ToLongDateString(),
"')"
}));
}
}
@class.method_2().method_21().method_19(string_0, this.uint_0);
}
}
}
}
Searched the entire room for chatlog, and that's all that shows.