Hay, was ich machen müsste damit der die RoomID aus der DB gettet?
Kleiner ausschnitt aus der ChatCommandHandler
Spoiler anzeigen
Code
if (Session.GetHabbo().HasFuse("cmd_startquestion"))
{
if (array[1] != null)
{
Room Room = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
DataTable dataTable = null;
int QuestionId = int.Parse(array[1]);
Room.CurrentPollId = QuestionId;
string s;
using (DatabaseClient client = GoldTree.GetDatabase().GetClient())
{
s = client.ReadString("SELECT question FROM infobus_questions WHERE id = '" + QuestionId + "' LIMIT 1", 30);
dataTable = client.ReadDataTable("SELECT * FROM infobus_answers WHERE question_id = '" + QuestionId + "'", 30);
}
ServerMessage serverMessage7 = new ServerMessage(79u);
serverMessage7.AppendStringWithBreak(s);
serverMessage7.AppendInt32(dataTable.Rows.Count);
if (dataTable != null)
{
foreach (DataRow dataRow2 in dataTable.Rows)
{
serverMessage7.AppendInt32((int)dataRow2["id"]);
serverMessage7.AppendStringWithBreak((string)dataRow2["answer_text"]);
}
}
Room.SendMessage(serverMessage7, null);
Thread thread = new Thread(delegate
{
Room.ShowResults(Room, QuestionId, Session);
});
thread.Start();
result = true;
return result;
}
}
result = false;
return result;
case 95:
Alles anzeigen