Пример #1
0
        private void ChangeMap(Map target)
        {
            if (target == null) return;

            _character.Disposition.Map.RemoveActor(_character);
            _character.Disposition.Map.Updated -= ParseEvent;

            _character.Disposition.Map = target;
            _character.Disposition.Cell = _character.Disposition.NextCell;
            _character.Disposition.NextCell = -1;

            _client.Send(new CurrentMapMessage(target.Id));

            _character.Disposition.Map.Updated += ParseEvent;
            _character.Disposition.Map.AddActor(_character);
        }
Пример #2
0
        private static Map Load(int id)
        {
            MySql.Data.MySqlClient.MySqlDataReader reader = Utils.DatabaseManager.Instance.Read
                (
                    "SELECT * FROM `map` WHERE `Id`='" + id + "' LIMIT 1;"
                );

            Map ret = null;

            while (reader.Read() && ret == null)
            {
                ret = new Map
                    (
                        reader.GetInt32("Id"), reader.GetInt32("RelativeId"), reader.GetInt32("Version"), reader.GetInt32("Type"),
                        reader.GetInt32("SubAreaId"), reader.GetInt32("TopNeighbour_Id"), reader.GetInt32("BottomNeighbour_Id"),
                        reader.GetInt32("LeftNeighbour_Id"), reader.GetInt32("RightNeighbour_Id"),
                        reader.GetInt32("ShadowBonusOnEntities"), reader.GetInt32("UseLowpassFilter"), reader.GetInt32("UseReverb"),
                        reader.GetInt32("PresetId"), reader.GetString("Cells")
                    );
            }

            reader.Close();

            return ret;
        }