internal RoomData CreateRoom(GameClient Session, string Name, string Desc, string Model, int Category, int MaxVisitors)
{
// New structure fixed by Finn
if (!this.roomModels.ContainsKey(Model))
{
Session.SendNotif("Room Model was not found.");
return null;
}
if (Name.Length < 3)
{
Session.SendNotif("The Room name is too short...");
return null;
}
uint RoomId = 0;
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("INSERT INTO rooms (roomtype,caption,description,owner,model_name,category,users_max) VALUES ('private', @
Caption , @desc , @username , @model , @cat , @usmax)");
dbClient.addParameter("caption", Name);
dbClient.addParameter("desc", Desc);
dbClient.addParameter("username", Session.GetHabbo().Username);
dbClient.addParameter("model", Model);
dbClient.addParameter("cat", Category);
dbClient.addParameter("usmax", MaxVisitors);
RoomId = (uint)dbClient.insertQuery();
}
RoomData Data = this.GenerateRoomData(RoomId);
Session.GetHabbo().UsersRooms.Add(Data);
return Data;
}
Comments[ 0 ]
Đăng nhận xét