Exemple #1
0
        public static void CreateZone(string level, Level.Zone zn)
        {
            object locker = ThreadSafeCache.DBCache.Get(level);

            lock (locker) {
                Database.Backend.CreateTable("Zone" + level, LevelDB.createZones);
                Database.Backend.AddRow("Zone" + level, "Owner, SmallX, SmallY, SmallZ, BigX, BigY, BigZ",
                                        zn.Owner, zn.smallX, zn.smallY, zn.smallZ, zn.bigX, zn.bigY, zn.bigZ);
            }
        }
Exemple #2
0
        public static void DeleteZone(string level, Level.Zone zn)
        {
            object locker = ThreadSafeCache.DBCache.Get(level);

            lock (locker) {
                if (!Database.TableExists("Zone" + level))
                {
                    return;
                }
                Database.Backend.DeleteRows("Zone" + level, "WHERE Owner=@0 AND SmallX=@1 AND SMALLY=@2 " +
                                            "AND SMALLZ=@3 AND BIGX=@4 AND BIGY=@5 AND BIGZ=@6",
                                            zn.Owner, zn.smallX, zn.smallY, zn.smallZ, zn.bigX, zn.bigY, zn.bigZ);
            }
        }