예제 #1
0
        public WorldObject(DatabaseID dbID, bool addToWorld)
        {
            mDatabaseID = dbID;
            mAddToWorld = addToWorld;

            WorldID = WorldID.Dynamic(dbID.Type);
        }
예제 #2
0
파일: DBObject.cs 프로젝트: aquilax1/DBLint
 public bool DatabaseEquals(DatabaseID dbid)
 {
     if (dbid == null)
     {
         return(false);
     }
     return(dbid.DatabaseName.Equals(this.DatabaseName));
 }
예제 #3
0
 public Monster(DatabaseID dbID, bool addToWorld)
     : base(dbID, addToWorld)
 {
     DamageLog    = new MonsterDamageLog();
     SkillDelays  = new List <uint>();
     StatusChange = new WorldObjectStatusChangeList();
     LootItem     = new List <Item>();
     Regen        = new WorldObjectRegenerationData(this);
 }
예제 #4
0
파일: DBObject.cs 프로젝트: aquilax1/DBLint
        public static int GetSchemaHashCode(SchemaID sid)
        {
            if (!sid._hashCode.HasValue)
            {
                sid._hashCode = sid._schemaName.GetHashCode();
            }

            return(DatabaseID.GetDatabaseHashCode(sid) * 17 + sid._hashCode.Value);
        }
예제 #5
0
		public DatabaseObject this[DatabaseID key] {
			get {
				DatabaseObject obj;
				if (TryGetValue(key, out obj) == false) {
					return null;
				}
				return obj;
			}
		}
예제 #6
0
        private Issue GetIssue(DatabaseID context)
        {
            var identifierName = String.Empty;
            var dbObject       = String.Empty;
            var issue          = new Issue(this, this.DefaultSeverity.Value);

            issue.Name = "Identifier is a Reserved Word From SQL";
            Table table = null;

            if (context is Schema)
            {
                var sid = context as Schema;
                identifierName = sid.SchemaName;
                dbObject       = "schema";
            }
            else if (context is Table)
            {
                var sid = context as Table;
                identifierName = sid.TableName;
                dbObject       = "table";
            }
            else if (context is Column)
            {
                var sid = context as Column;
                identifierName = sid.ColumnName;
                dbObject       = "column";
                table          = sid.Table;
            }
            else if (context is PrimaryKey)
            {
                var sid = context as PrimaryKey;
                identifierName = sid.PrimaryKeyName;
                dbObject       = "primary-key";
                table          = sid.Table;
            }
            else if (context is ForeignKey)
            {
                var sid = context as ForeignKey;
                identifierName = sid.ForeignKeyName;
                dbObject       = "foreign-key";
            }

            if (table != null)
            {
                issue.Description = new Description("The {0} name '{1}' in table '{2}' is a reserved SQL word.", dbObject, identifierName, table);
            }
            else
            {
                issue.Description = new Description("The {0} name '{1}' is a reserved word in SQL.", dbObject, identifierName);
            }

            issue.ExtendedDescription = new Description("{0}", GetStandardViolation(identifierName));
            issue.Context             = IssueContext.Create(context);
            return(issue);
        }
예제 #7
0
        public DatabaseConnection(DatabaseID databaseID)
        {
            this.databaseID = databaseID;

            string databaseName = DetermineDatabaseName(databaseID);
            if (!string.IsNullOrEmpty(databaseName)) {
            #if !DEBUG
                database = new MySql(Settings.DatabaseIP, Settings.DatabasePort, databaseName, Settings.DatabaseUser, Settings.DatabasePassword);

            #else
                database = new MySql("localhost", Settings.DatabasePort, databaseName, Settings.DatabaseUser, Settings.DatabasePassword);
            #endif
            }

            database.OpenConnection();
        }
예제 #8
0
        public Character(DatabaseID dbID, bool addToWorld)
            : base(dbID, addToWorld)
        {
            BaseStatus   = new WorldObjectStatus(this);
            BattleStatus = new WorldObjectStatus(this);
            ViewData     = new WorldObjectViewData();
            StatusChange = new WorldObjectStatusChangeList();

            // TODO: i dont where eAthena initialize them realy..
            //		 they using struct, which cant be null x.x
            Regen   = new WorldObjectRegenerationData(this);
            HPRegen = new StatusVariationData();
            SPRegen = new StatusVariationData();
            SRegen  = new CharacterRegenerationData();
            SSRegen = new CharacterRegenerationData();
        }
예제 #9
0
        private string DetermineDatabaseName(DatabaseID databaseID)
        {
            switch (databaseID)
            {
            case DatabaseID.Players: {
                return("pmu_players");
            }

            case DatabaseID.Data: {
                return("pmu_data");
            }

            default: {
                return(null);
            }
            }
        }
예제 #10
0
        public DatabaseConnection(DatabaseID databaseID)
        {
            this.databaseID = databaseID;

            string databaseName = DetermineDatabaseName(databaseID);

            if (!string.IsNullOrEmpty(databaseName))
            {
#if !DEBUG
                database = new MySql(Settings.DatabaseIP /*"pmuniverse.servegame.com"*/, Settings.DatabasePort, databaseName, Settings.DatabaseUser, Settings.DatabasePassword);
#else
                database = new MySql("localhost", Settings.DatabasePort, databaseName, Settings.DatabaseUser, Settings.DatabasePassword);
#endif
            }

            database.OpenConnection();
        }
예제 #11
0
        public DatabaseConnection(DatabaseID databaseID, bool openConnection)
        {
            this.databaseID = databaseID;

            string databaseName = DetermineDatabaseName(databaseID);

            if (!string.IsNullOrEmpty(databaseName))
            {
#if !DEBUG
                database = new PMDCP.DatabaseConnector.MySql.MySql(Settings.DatabaseIP, Settings.DatabasePort, databaseName, Settings.DatabaseUser, Settings.DatabasePassword);
#else
                database = new PMDCP.DatabaseConnector.MySql.MySql("localhost", Settings.DatabasePort, databaseName, Settings.DatabaseUser, Settings.DatabasePassword);
#endif
            }

            if (openConnection)
            {
                database.OpenConnection();
            }
        }
예제 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string NewServerID = "";

        if (!IsPostBack)
        {
            ServerID.Text = "";
        }
        if (Request.Form.Get("ctl00$main$Servers1$ServerID") == null)
        {
            NewServerID = "0";
        }
        else
        {
            NewServerID = Request.Form.Get("ctl00$main$Servers1$ServerID");
        }

        //Security length
        if (NewServerID.Length > 3)
        {
            NewServerID = NewServerID.Substring(1, 3);
        }

        if (ServerID.Text != NewServerID)
        {
            ServerID.Text       = NewServerID;
            ds.ConnectionString = WebConfigurationManager.ConnectionStrings["mainConnectionString"].ConnectionString;
            ds.SelectCommand    = "SELECT ID,Name FROM dbo.nipm_get_databases(" + ServerID.Text + ",null)";
            DatabaseID.DataBind();
            DatabaseID.ToolTip = "ServerID=" + ServerID.Text + ",DatabaseID=" + DatabaseID.SelectedValue.ToString();

            //Request.Form.Set("ctl00$main$Databases$DatabaseID", DatabaseID.SelectedValue);
            //Request.Form.S

            //DatabaseID.ID.ToString()-НЕ ПОЙДЕТ
            //DatabaseID.NamingContainer.ToString() -?
            //DatabaseID.Page.ToString()
            //DatabaseID.UniqueID.ToString()-полезняха
            //DatabaseID.ClientID.ToString()-полезняха
        }
    }
예제 #13
0
        private static IServiceProvider CreateServices(DatabaseID databaseID)
        {
            string tag;

            switch (databaseID)
            {
            case DatabaseID.Players:
                tag = "players";
                break;

            case DatabaseID.Data:
                tag = "data";
                break;

            default:
                throw new NotSupportedException();
            }

            var databaseConnection = new DatabaseConnection(databaseID, false);

            return(new ServiceCollection()
                   // Add common FluentMigrator services
                   .AddFluentMigratorCore()
                   .ConfigureRunner(rb => rb
                                    // Add SQLite support to FluentMigrator
                                    .AddMySql5()
                                    .WithGlobalCommandTimeout(TimeSpan.Zero)
                                    // Set the connection string
                                    .WithGlobalConnectionString(databaseConnection.Database.ConnectionString)
                                    // Define the assembly containing the migrations
                                    .ScanIn(typeof(MigrationRunner).Assembly).For.Migrations())
                   .Configure <RunnerOptions>(opt =>
            {
                opt.Tags = new string[] { tag };
            })
                   // Enable logging to console in the FluentMigrator way
                   .AddLogging(lb => lb.AddFluentMigratorConsole())
                   // Build the service provider
                   .BuildServiceProvider(false));
        }
예제 #14
0
 public static IssueContext Create(DatabaseID context)
 {
     if (context is ColumnID)
     {
         return(new ColumnContext((ColumnID)context));
     }
     else if (context is TableID)
     {
         return(new TableContext((TableID)context));
     }
     else if (context is SchemaID)
     {
         return(new SchemaContext((SchemaID)context));
     }
     if (context is DatabaseID)
     {
         return(new DatabaseContext((DatabaseID)context));
     }
     else
     {
         throw new Exception(String.Format("{0} cannot be used as an issue context", context.ToString()));
     }
 }
예제 #15
0
 public WorldObject(DatabaseID dbID)
     : this(dbID, false)
 {
 }
예제 #16
0
파일: Monster.cs 프로젝트: GodLesZ/svn-dump
		public Monster(DatabaseID dbID)
			: this(dbID, false) {
		}
예제 #17
0
 public virtual void UpdateDatabaseID(uint id, EDatabaseType type)
 {
     mDatabaseID   = new DatabaseID(id, type);
     mDatabaseData = null;
 }
예제 #18
0
파일: DBObject.cs 프로젝트: aquilax1/DBLint
 public static int GetDatabaseHashCode(DatabaseID dbid)
 {
     return(dbid.DatabaseName.GetHashCode());
 }
예제 #19
0
		public Character(DatabaseID dbID)
			: this(dbID, false) {
		}
예제 #20
0
 private string DetermineDatabaseName(DatabaseID databaseID)
 {
     switch (databaseID) {
         case DatabaseID.Players: {
                 return "mdx_players";
             }
         case DatabaseID.Data: {
                 return "mdx_data";
             }
         default: {
                 return null;
             }
     }
 }
예제 #21
0
 public Character(DatabaseID dbID)
     : this(dbID, false)
 {
 }
예제 #22
0
파일: Item.cs 프로젝트: GodLesZ/svn-dump
		public Item(DatabaseID dbID)
			: base(dbID) {
		}
예제 #23
0
 public Guild(DatabaseID id)
     : base(id)
 {
     Member = new List <GuildMember>();
 }
예제 #24
0
		public WorldObjectUnit(DatabaseID dbID, bool addToWorld)
			: base(dbID, addToWorld) {
		}
예제 #25
0
파일: Item.cs 프로젝트: GodLesZ/svn-dump
		public Item(DatabaseID dbID, bool addToWorld)
			: base(dbID, addToWorld) {
		}
예제 #26
0
		public bool TryGetValue(DatabaseID key, out DatabaseObject obj) {
			switch (key.Type) {
				case EDatabaseType.Account:
					return mAccount.TryGetValue(key, out obj);
				case EDatabaseType.Char:
					return mCharacter.TryGetValue(key, out obj);
				case EDatabaseType.Guild:
					return mGuild.TryGetValue(key, out obj);
				case EDatabaseType.Homunculus:
					return mHomonculus.TryGetValue(key, out obj);
				case EDatabaseType.Item:
					return mItem.TryGetValue(key, out obj);
				case EDatabaseType.Mob:
					return mMonster.TryGetValue(key, out obj);
				case EDatabaseType.Npc:
					return mNpc.TryGetValue(key, out obj);
				case EDatabaseType.Party:
					return mParty.TryGetValue(key, out obj);
				case EDatabaseType.Pet:
					return mPet.TryGetValue(key, out obj);
			}

			obj = null;
			return false;
		}
예제 #27
0
		public bool Remove(DatabaseID key) {
			switch (key.Type) {
				case EDatabaseType.Account:
					return mAccount.Remove(key);
				case EDatabaseType.Char:
					return mCharacter.Remove(key);
				case EDatabaseType.Guild:
					return mGuild.Remove(key);
				case EDatabaseType.Homunculus:
					return mHomonculus.Remove(key);
				case EDatabaseType.Item:
					return mItem.Remove(key);
				case EDatabaseType.Mob:
					return mMonster.Remove(key);
				case EDatabaseType.Npc:
					return mNpc.Remove(key);
				case EDatabaseType.Party:
					return mParty.Remove(key);
				case EDatabaseType.Pet:
					return mPet.Remove(key);
			}

			return false;
		}
예제 #28
0
		public void Add(DatabaseID key, DatabaseObject obj) {
			switch (key.Type) {
				case EDatabaseType.Account:
					mAccount.Add(key, obj);
					break;
				case EDatabaseType.Char:
					mCharacter.Add(key, obj);
					break;
				case EDatabaseType.Guild:
					mGuild.Add(key, obj);
					break;
				case EDatabaseType.Homunculus:
					mHomonculus.Add(key, obj);
					break;
				case EDatabaseType.Item:
					mItem.Add(key, obj);
					break;
				case EDatabaseType.Mob:
					mMonster.Add(key, obj);
					break;
				case EDatabaseType.Npc:
					mNpc.Add(key, obj);
					break;
				case EDatabaseType.Party:
					mParty.Add(key, obj);
					break;
				case EDatabaseType.Pet:
					mPet.Add(key, obj);
					break;
			}
		}
예제 #29
0
파일: Skill.cs 프로젝트: GodLesZ/svn-dump
		public Skill(DatabaseID dbID)
			: base(dbID) {
		}
예제 #30
0
 public NpcWarpScript(DatabaseID id, NpcWarpData warpData)
     : base(id)
 {
     WarpData = warpData;
 }
예제 #31
0
 public GuildCastle(DatabaseID id)
     : base(id)
 {
 }
예제 #32
0
 public DatabaseConnection(DatabaseID databaseID) : this(databaseID, true)
 {
 }
예제 #33
0
		public GuildCastle(DatabaseID id)
			: base(id) {
		}
예제 #34
0
 public DatabaseContext(DatabaseID db, IEnumerable <SchemaID> schemas) : this(db)
 {
     this.Schemas = schemas.Select(s => new SchemaID(s));
 }
예제 #35
0
 public Monster(DatabaseID dbID)
     : this(dbID, false)
 {
 }
예제 #36
0
		public NpcScript(DatabaseID id)
			: base(id) {
			OnTouchArea = Point2D.Zero;
		}
예제 #37
0
        private Issue GetIssue(DatabaseID context, Match match)
        {
            var   identifierName = String.Empty;
            var   dbObject       = String.Empty;
            Table table          = null;

            if (context is Schema)
            {
                var sid = context as Schema;
                identifierName = sid.SchemaName;
                dbObject       = "schema";
            }
            else if (context is Table)
            {
                var sid = context as Table;
                identifierName = sid.TableName;
                dbObject       = "table";
            }
            else if (context is Column)
            {
                var sid = context as Column;
                identifierName = sid.ColumnName;
                dbObject       = "column";
                table          = sid.Table;
            }
            else if (context is PrimaryKey)
            {
                var sid = context as PrimaryKey;
                identifierName = sid.PrimaryKeyName;
                dbObject       = "primary-key";
                table          = sid.Table;
            }
            else if (context is ForeignKey)
            {
                var sid = context as ForeignKey;
                identifierName = sid.ForeignKeyName;
                dbObject       = "foreign-key";
            }
            else if (context is Index)
            {
                var sid = context as Index;
                identifierName = sid.IndexName;
                dbObject       = "index";
                table          = sid.Table;
            }
            var issue = new Issue(this, this.DefaultSeverity.Value);

            issue.Context = IssueContext.Create(context);
            issue.Name    = "Use of Special Character in Identifier";

            if (table != null)
            {
                issue.Description = new Description("The special character '{0}' is used in the {2} name: '{3}' in table in table '{1}'", match.Value, table, dbObject, identifierName);
            }
            else
            {
                issue.Description = new Description("The special character '{0}' is used in the {1} name: '{2}'", match.Value, dbObject, identifierName);
            }

            return(issue);
        }
예제 #38
0
 public GuildCastleGuardian(DatabaseID id)
     : base(id)
 {
 }
예제 #39
0
파일: Monster.cs 프로젝트: GodLesZ/svn-dump
		public Monster(DatabaseID dbID, bool addToWorld)
			: base(dbID, addToWorld) {
			DamageLog = new MonsterDamageLog();
			SkillDelays = new List<uint>();
			StatusChange = new WorldObjectStatusChangeList();
			LootItem = new List<Item>();
			Regen = new WorldObjectRegenerationData(this);
		}
예제 #40
0
		public NpcWarpScript(DatabaseID id, NpcWarpData warpData)
			: base(id) {
			WarpData = warpData;
		}
예제 #41
0
 public Character this[DatabaseID Key] {
     get { return(mChars[Key]); }
     internal set { mChars[Key] = value; }
 }
예제 #42
0
		public NpcWarpScript(DatabaseID id, Point2D point, Location loc)
			: this(id, new NpcWarpData(point, loc)) {
		}
예제 #43
0
		public Character(DatabaseID dbID, bool addToWorld)
			: base(dbID, addToWorld) {
			BaseStatus = new WorldObjectStatus(this);
			BattleStatus = new WorldObjectStatus(this);
			ViewData = new WorldObjectViewData();
			StatusChange = new WorldObjectStatusChangeList();

			// TODO: i dont where eAthena initialize them realy..
			//		 they using struct, which cant be null x.x
			Regen = new WorldObjectRegenerationData(this);
			HPRegen = new StatusVariationData();
			SPRegen = new StatusVariationData();
			SRegen = new CharacterRegenerationData();
			SSRegen = new CharacterRegenerationData();
		}
예제 #44
0
 public WorldObjectUnit(DatabaseID dbID, bool addToWorld)
     : base(dbID, addToWorld)
 {
 }
예제 #45
0
파일: Skill.cs 프로젝트: GodLesZ/svn-dump
		public Skill(DatabaseID dbID, bool addToWorld)
			: base(dbID, addToWorld) {
		}
예제 #46
0
		public GuildCastleGuardian(DatabaseID id)
			: base(id) {
		}
예제 #47
0
 public NpcWarpScript(DatabaseID id, Point2D point, Location loc)
     : this(id, new NpcWarpData(point, loc))
 {
 }
예제 #48
0
		public WorldObjectUnit(DatabaseID dbID)
			: this(dbID, false) {
		}
예제 #49
0
 public DatabaseContext(DatabaseID db)
 {
     this.Location = ContextLocation.Database;
     this.Database = db;
 }
예제 #50
0
 public Skill(DatabaseID dbID, bool addToWorld)
     : base(dbID, addToWorld)
 {
 }
예제 #51
0
 public Skill(DatabaseID dbID)
     : base(dbID)
 {
 }
예제 #52
0
파일: Account.cs 프로젝트: GodLesZ/svn-dump
		public Character this[DatabaseID Key] {
			get { return mChars[Key]; }
			internal set { mChars[Key] = value; }
		}