Example #1
0
 /// <summary>
 /// GameServer的插件的删除操作
 /// </summary>
 /// <param name="plugIns"></param>
 public bool DeletePlugIn(GameServer server,IList plugIns)
 {
     IBlazeDatabase db = null;
     try
     {                
         db = DbFactory.GetDatabase();
         db.BeginTrans();
         foreach (IPlugIn plugIn in plugIns)
         {
             
             IBlazeTable plugInTable = db.GetTable(TableString.ServerPlugInTableName);
             plugInTable.Delete(FilterFactory.CreateAndFilter(
                 FilterFactory.CreateEqualFilter(TableString.ServerPlugInFieldGameServerId,server.Id),
                 FilterFactory.CreateEqualFilter(TableString.ServerPlugInFieldPlugInGuid,plugIn.Guid)));                                        
             server.UnInstallPlugIn(plugIn);
         }
         db.CommitTrans();
         return true;
     }
     catch (Exception)
     {
         if (db != null)
             db.RollbackTrans();
         return false;
     }
     finally
     {
         if (db != null)
             db.Close();
     }
 }