Esempio n. 1
0
        public static void SaveMap(Frames.MapFrame frame)
        {
            try
            {
                lock (connectionLocker)
                {
                    Connect();

                    var text    = "DELETE FROM maps WHERE id=" + frame.ID;
                    var command = new MySqlCommand(text, connection);

                    command.ExecuteNonQuery();

                    text = "INSERT INTO maps (id, date, width, heigth, places, mapData, monsters, capabilities, mappos, numgroup) VALUES ( '" +
                           frame.ID + "', '" + frame.signature + "', '" + frame.width + "', '" + frame.height + "', '" + frame.GetCellsFight(true) + "', '" +
                           frame.compressMap() + "', '', '" + frame.getCapabilities() + "', '0,0,0', '5');";
                    command = new MySqlCommand(text, connection);

                    command.ExecuteNonQuery();

                    Disconnect();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.ToString());
            }
        }