public WorldObject(DatabaseID dbID, bool addToWorld) { mDatabaseID = dbID; mAddToWorld = addToWorld; WorldID = WorldID.Dynamic(dbID.Type); }
public bool DatabaseEquals(DatabaseID dbid) { if (dbid == null) { return(false); } return(dbid.DatabaseName.Equals(this.DatabaseName)); }
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); }
public static int GetSchemaHashCode(SchemaID sid) { if (!sid._hashCode.HasValue) { sid._hashCode = sid._schemaName.GetHashCode(); } return(DatabaseID.GetDatabaseHashCode(sid) * 17 + sid._hashCode.Value); }
public DatabaseObject this[DatabaseID key] { get { DatabaseObject obj; if (TryGetValue(key, out obj) == false) { return null; } return obj; } }
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); }
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(); }
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(); }
private string DetermineDatabaseName(DatabaseID databaseID) { switch (databaseID) { case DatabaseID.Players: { return("pmu_players"); } case DatabaseID.Data: { return("pmu_data"); } default: { return(null); } } }
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(); }
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(); } }
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()-полезняха } }
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)); }
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())); } }
public WorldObject(DatabaseID dbID) : this(dbID, false) { }
public Monster(DatabaseID dbID) : this(dbID, false) { }
public virtual void UpdateDatabaseID(uint id, EDatabaseType type) { mDatabaseID = new DatabaseID(id, type); mDatabaseData = null; }
public static int GetDatabaseHashCode(DatabaseID dbid) { return(dbid.DatabaseName.GetHashCode()); }
public Character(DatabaseID dbID) : this(dbID, false) { }
private string DetermineDatabaseName(DatabaseID databaseID) { switch (databaseID) { case DatabaseID.Players: { return "mdx_players"; } case DatabaseID.Data: { return "mdx_data"; } default: { return null; } } }
public Item(DatabaseID dbID) : base(dbID) { }
public Guild(DatabaseID id) : base(id) { Member = new List <GuildMember>(); }
public WorldObjectUnit(DatabaseID dbID, bool addToWorld) : base(dbID, addToWorld) { }
public Item(DatabaseID dbID, bool addToWorld) : base(dbID, addToWorld) { }
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; }
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; }
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; } }
public Skill(DatabaseID dbID) : base(dbID) { }
public NpcWarpScript(DatabaseID id, NpcWarpData warpData) : base(id) { WarpData = warpData; }
public GuildCastle(DatabaseID id) : base(id) { }
public DatabaseConnection(DatabaseID databaseID) : this(databaseID, true) { }
public DatabaseContext(DatabaseID db, IEnumerable <SchemaID> schemas) : this(db) { this.Schemas = schemas.Select(s => new SchemaID(s)); }
public NpcScript(DatabaseID id) : base(id) { OnTouchArea = Point2D.Zero; }
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); }
public GuildCastleGuardian(DatabaseID id) : base(id) { }
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); }
public Character this[DatabaseID Key] { get { return(mChars[Key]); } internal set { mChars[Key] = value; } }
public NpcWarpScript(DatabaseID id, Point2D point, Location loc) : this(id, new NpcWarpData(point, loc)) { }
public Skill(DatabaseID dbID, bool addToWorld) : base(dbID, addToWorld) { }
public WorldObjectUnit(DatabaseID dbID) : this(dbID, false) { }
public DatabaseContext(DatabaseID db) { this.Location = ContextLocation.Database; this.Database = db; }
public Character this[DatabaseID Key] { get { return mChars[Key]; } internal set { mChars[Key] = value; } }