internal DynamicRoomModel(RoomModel pModel, Room room) { this.staticModel = pModel; this.DoorX = this.staticModel.DoorX; this.DoorY = this.staticModel.DoorY; this.DoorZ = this.staticModel.DoorZ; this.DoorOrientation = this.staticModel.DoorOrientation; this.Heightmap = this.staticModel.Heightmap; this.MapSizeX = this.staticModel.MapSizeX; this.MapSizeY = this.staticModel.MapSizeY; this.ClubOnly = this.staticModel.ClubOnly; this.mRoom = room; this.Generate(); }
public Gamemap(Room room) { this.room = room; this.DiagonalEnabled = true; this.mStaticModel = CyberEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName); if (this.mStaticModel == null) { throw new Exception("No modeldata found for roomID " + room.RoomId); } this.mDynamicModel = new DynamicRoomModel(this.mStaticModel, room); this.mCoordinatedItems = new HybridDictionary(); this.gotPublicPool = room.RoomData.Model.gotPublicPool; this.mGameMap = new byte[this.Model.MapSizeX, this.Model.MapSizeY]; this.mItemHeightMap = new double[this.Model.MapSizeX, this.Model.MapSizeY]; this.userMap = new HybridDictionary(); this.walkableList = this.GetWalkablePoints(); }
internal void Destroy() { this.userMap.Clear(); this.mDynamicModel.Destroy(); this.mCoordinatedItems.Clear(); Array.Clear(this.mGameMap, 0, this.mGameMap.Length); Array.Clear(this.mUserItemEffect, 0, this.mUserItemEffect.Length); Array.Clear(this.mItemHeightMap, 0, this.mItemHeightMap.Length); this.userMap = null; this.mGameMap = null; this.mUserItemEffect = null; this.mItemHeightMap = null; this.mCoordinatedItems = null; this.mDynamicModel = null; this.room = null; this.mStaticModel = null; }
internal void Destroy() { Array.Clear(this.SqState, 0, this.SqState.Length); Array.Clear(this.SqFloorHeight, 0, this.SqFloorHeight.Length); Array.Clear(this.SqSeatRot, 0, this.SqSeatRot.Length); this.staticModel = null; this.Heightmap = null; this.SqState = null; this.SqFloorHeight = null; this.SqSeatRot = null; }
internal void FillNull(uint pId) { this.Id = pId; this.Name = "Unknown Room"; this.Description = "-"; this.Type = "private"; this.Owner = "-"; this.Category = 0; this.UsersNow = 0; this.UsersMax = 0; this.ModelName = "NO_MODEL"; this.CCTs = ""; this.Score = 0; this.Tags = new List<string>(); this.AllowPets = 1; this.AllowPetsEating = 0; this.AllowWalkthrough = 1; this.Hidewall = 0; this.Password = ""; this.Wallpaper = "0.0"; this.Floor = "0.0"; this.Landscape = "0.0"; this.WallThickness = 0; this.FloorThickness = 0; this.Group = null; this.AllowRightsOverride = false; this.Event = null; this.GameId = 0; this.WhoCanBan = 0; this.WhoCanKick = 0; this.WhoCanMute = 0; this.TradeState = 2; this.State = 0; this.RoomChat = new HashSet<Chatlog>(); this.WordFilter = new List<string>(); this.WallHeight = -1; this.mModel = CyberEnvironment.GetGame().GetRoomManager().GetModel(this.ModelName); }
internal void ResetModel() { this.mModel = CyberEnvironment.GetGame().GetRoomManager().GetModel(this.ModelName); }
internal void Fill(Room Room) { this.Id = Room.RoomId; this.Name = Room.Name; this.Description = Room.Description; this.Type = Room.Type; this.Owner = Room.Owner; this.Category = Room.Category; this.State = Room.State; this.UsersNow = Room.UsersNow; this.UsersMax = Room.UsersMax; this.ModelName = Room.ModelName; this.WallHeight = Room.WallHeight; this.Score = Room.Score; this.Tags = new List<string>(); object[] array = Room.Tags.ToArray(); for (int i = 0; i < array.Length; i++) { string item = (string)array[i]; this.Tags.Add(item); } this.AllowPets = Room.AllowPets; this.AllowPetsEating = Room.AllowPetsEating; this.AllowWalkthrough = Room.AllowWalkthrough; this.Hidewall = Room.Hidewall; this.Password = Room.Password; this.Wallpaper = Room.Wallpaper; this.Floor = Room.Floor; this.Landscape = Room.Landscape; this.FloorThickness = Room.FloorThickness; this.WallThickness = Room.WallThickness; this.Group = Room.Group; this.Event = Room.Event; this.ChatType = Room.ChatType; this.ChatBalloon = Room.ChatBalloon; this.ChatSpeed = Room.ChatSpeed; this.ChatMaxDistance = Room.ChatMaxDistance; this.ChatFloodProtection = Room.ChatFloodProtection; this.WhoCanMute = Room.WhoCanMute; this.WhoCanKick = Room.WhoCanKick; this.WhoCanBan = Room.WhoCanBan; this.RoomChat = Room.RoomChat; this.WordFilter = Room.WordFilter; this.mModel = CyberEnvironment.GetGame().GetRoomManager().GetModel(this.ModelName); }
internal void Fill(DataRow Row) { this.Id = Convert.ToUInt32(Row["id"]); this.Name = (string)Row["caption"]; this.Description = (string)Row["description"]; this.Type = (string)Row["roomtype"]; this.Owner = (string)Row["owner"]; this.OwnerId = 0; this.RoomChat = new HashSet<Chatlog>(); this.WordFilter = new List<string>(); using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT id FROM users WHERE username = @owner"); queryreactor.addParameter("owner", this.Owner); int integer = queryreactor.getInteger(); if (integer > 0) { this.OwnerId = integer; } queryreactor.setQuery("SELECT user_id, message, timestamp FROM chatlogs WHERE room_id=@id ORDER BY timestamp DESC LIMIT 150"); queryreactor.addParameter("id", this.Id); DataTable table = queryreactor.getTable(); foreach (DataRow dataRow in table.Rows) { this.RoomChat.Add(new Chatlog((uint)dataRow[0], (string)dataRow[1], Convert.ToDouble(dataRow[2]), false)); } queryreactor.setQuery("SELECT word FROM room_wordfilter WHERE room_id = @id"); queryreactor.addParameter("id", this.Id); DataTable table2 = queryreactor.getTable(); foreach (DataRow dataRow2 in table2.Rows) { this.WordFilter.Add(dataRow2["word"].ToString()); } } string a; if ((a = Row["state"].ToString().ToLower()) != null) { if (a == "open") { this.State = 0; goto IL_24B; } if (a == "password") { this.State = 2; goto IL_24B; } if (!(a == "locked")) { } } this.State = 1; IL_24B: this.TradeState = int.Parse(Row["trade_state"].ToString()); this.Category = (int)Row["category"]; if (!string.IsNullOrEmpty(Row["users_now"].ToString())) { this.UsersNow = (int)Row["users_now"]; } else { this.UsersNow = 0; } this.UsersMax = (int)Row["users_max"]; this.ModelName = (string)Row["model_name"]; this.WallHeight = int.Parse(Row["walls_height"].ToString()); this.CCTs = (string)Row["public_ccts"]; this.Score = (int)Row["score"]; this.Tags = new List<string>(); this.AllowPets = Convert.ToInt32(Row["allow_pets"].ToString()); this.AllowPetsEating = Convert.ToInt32(Row["allow_pets_eat"].ToString()); this.AllowWalkthrough = Convert.ToInt32(Row["allow_walkthrough"].ToString()); this.AllowRightsOverride = false; this.Hidewall = Convert.ToInt32(Row["allow_hidewall"].ToString()); this.Password = (string)Row["password"]; this.Wallpaper = (string)Row["wallpaper"]; this.Floor = (string)Row["floor"]; this.Landscape = (string)Row["landscape"]; this.FloorThickness = (int)Row["floorthick"]; this.WallThickness = (int)Row["wallthick"]; this.ChatType = (int)Row["chat_type"]; this.ChatBalloon = (int)Row["chat_balloon"]; this.ChatSpeed = (int)Row["chat_speed"]; this.ChatMaxDistance = (int)Row["chat_max_distance"]; this.ChatFloodProtection = (int)Row["chat_flood_protection"]; this.GameId = (int)Row["game_id"]; this.WhoCanMute = Convert.ToInt32(Row["mute_settings"]); this.WhoCanKick = Convert.ToInt32(Row["kick_settings"]); this.WhoCanBan = Convert.ToInt32(Row["ban_settings"]); this.GroupId = (uint)Row["group_id"]; this.Group = CyberEnvironment.GetGame().GetGroupManager().GetGroup(this.GroupId); this.Event = CyberEnvironment.GetGame().GetRoomEvents().GetEvent(this.Id); Dictionary<int, int> dictionary = new Dictionary<int, int>(); if (!string.IsNullOrEmpty(Row["icon_items"].ToString())) { string[] array = Row["icon_items"].ToString().Split(new char[] { '|' }); for (int i = 0; i < array.Length; i++) { string text = array[i]; if (!string.IsNullOrEmpty(text)) { string[] array2 = text.Replace('.', ',').Split(new char[] { ',' }); int key = 0; int value = 0; int.TryParse(array2[0], out key); if (array2.Length > 1) { int.TryParse(array2[1], out value); } try { if (!dictionary.ContainsKey(key)) { dictionary.Add(key, value); } } catch (Exception ex) { Logging.LogException(string.Concat(new string[] { "Exception: ", ex.ToString(), "[", text, "]" })); } } } } if (Row["tags"].ToString() != "") { string[] array3 = Row["tags"].ToString().Split(new char[] { ',' }); for (int j = 0; j < array3.Length; j++) { string item = array3[j]; this.Tags.Add(item); } } this.mModel = CyberEnvironment.GetGame().GetRoomManager().GetModel(this.ModelName); }