示例#1
0
文件: Faction.cs 项目: mywebext/DOL
        public void SaveAggroToFaction(string charID)
        {
            DBFactionAggroLevel dbfactionAggroLevel = GameServer.Database.SelectObjects <DBFactionAggroLevel>("`CharacterID` = @CharacterID AND `FactionID` = @FactionID", new[] { new QueryParameter("@CharacterID", charID), new QueryParameter("@FactionID", this.ID) }).FirstOrDefault();

            if (dbfactionAggroLevel == null)
            {
                dbfactionAggroLevel             = new DBFactionAggroLevel();
                dbfactionAggroLevel.AggroLevel  = (int)m_playerxFaction[charID];
                dbfactionAggroLevel.CharacterID = charID;
                dbfactionAggroLevel.FactionID   = this.ID;
                GameServer.Database.AddObject(dbfactionAggroLevel);
            }
            else
            {
                dbfactionAggroLevel.AggroLevel = (int)m_playerxFaction[charID];
                GameServer.Database.SaveObject(dbfactionAggroLevel);
            }
        }
示例#2
0
        public void SaveAggroToFaction(string charID)
        {
            var dbfactionAggroLevel = DOLDB <DBFactionAggroLevel> .SelectObject(DB.Column("CharacterID").IsEqualTo(charID).And(DB.Column("FactionID").IsEqualTo(ID)));

            if (dbfactionAggroLevel == null)
            {
                dbfactionAggroLevel             = new DBFactionAggroLevel();
                dbfactionAggroLevel.AggroLevel  = (int)m_playerxFaction[charID];
                dbfactionAggroLevel.CharacterID = charID;
                dbfactionAggroLevel.FactionID   = this.ID;
                GameServer.Database.AddObject(dbfactionAggroLevel);
            }
            else
            {
                dbfactionAggroLevel.AggroLevel = (int)m_playerxFaction[charID];
                GameServer.Database.SaveObject(dbfactionAggroLevel);
            }
        }
示例#3
0
        public void SaveAggroToFaction(string charID)
        {
            DBFactionAggroLevel dbfactionAggroLevel = GameServer.Database.SelectObject <DBFactionAggroLevel>("CharacterID = '" + GameServer.Database.Escape(charID) + "' AND FactionID =" + this.ID);

            if (dbfactionAggroLevel == null)
            {
                dbfactionAggroLevel             = new DBFactionAggroLevel();
                dbfactionAggroLevel.AggroLevel  = (int)m_playerxFaction[charID];
                dbfactionAggroLevel.CharacterID = charID;
                dbfactionAggroLevel.FactionID   = this.ID;
                GameServer.Database.AddObject(dbfactionAggroLevel);
            }
            else
            {
                dbfactionAggroLevel.AggroLevel = (int)m_playerxFaction[charID];
                GameServer.Database.SaveObject(dbfactionAggroLevel);
            }
        }