Ejemplo n.º 1
0
 public void Die()
 {
     MenuMode = MenuMode.Dead;
     Game1.GameMode = GameModes.Menu;
     TransFrame = 1f;
     Level = Level.Dead;
     TransType = Trans.All;
 }
Ejemplo n.º 2
0
 public DataTable ExecuteDataTable(DbCommand cmd, Trans t)
 {
     cmd.Connection = t.DbConnection;
     cmd.Transaction = t.DbTrans;
     DbProviderFactory dbfactory = DbProviderFactories.GetFactory(MyDbHelper.dbProviderName);
     DbDataAdapter dbDataAdapter = dbfactory.CreateDataAdapter();
     dbDataAdapter.SelectCommand = cmd;
     DataTable dataTable = new DataTable();
     dbDataAdapter.Fill(dataTable);
     return dataTable;
 }
Ejemplo n.º 3
0
 private void Transition(Level goal, bool all = false)
 {
     TransGoal = goal;
     TransFrame = 0f;
     TransType = all ? Trans.All : Trans.Buttons;
 }
Ejemplo n.º 4
0
 public void Pause()
 {
     MenuMode = MenuMode.Pause;
     Game1.GameMode = GameModes.Menu;
     TransFrame = 1f;
     Level = Level.Main;
     TransType = Trans.All;
 }
Ejemplo n.º 5
0
 private void Transition(Level goal, bool all)
 {
     transGoal = goal;
     transFrame = 0f;
     if (all)
         transType = Trans.All;
     else
         transType = Trans.Buttons;
 }
Ejemplo n.º 6
0
        public void Pause()
        {
            menuMode = MenuMode.Pause;
            RuinExplorersMain.GameMode = RuinExplorersMain.GameModes.Menu;

            transFrame = 1f;
            level = Level.Main;
            transType = Trans.All;
        }
Ejemplo n.º 7
0
 public void EndGame()
 {
     transFrame = 1f;
     transType = Trans.All;
     level = Level.Main;
     RuinExplorersMain.GameMode = RuinExplorersMain.GameModes.Menu;
 }
Ejemplo n.º 8
0
        public void Die()
        {
            menuMode = MenuMode.Dead;
            RuinExplorersMain.GameMode = RuinExplorersMain.GameModes.Menu;

            transFrame = 1f;
            level = Level.Dead;
            transType = Trans.All;
        }
Ejemplo n.º 9
0
 public object ExecuteScalar(DbCommand cmd, Trans t)
 {
     cmd.Connection.Close();
     cmd.Connection = t.DbConnection;
     cmd.Transaction = t.DbTrans;
     object ret = cmd.ExecuteScalar();
     return ret;
 }
Ejemplo n.º 10
0
 public int ExecuteNonQuery(DbCommand cmd, Trans t)
 {
     cmd.Connection.Close();
     cmd.Connection = t.DbConnection;
     cmd.Transaction = t.DbTrans;
     int ret = cmd.ExecuteNonQuery();
     return ret;
 }
Ejemplo n.º 11
0
 public DbDataReader ExecuteReader(DbCommand cmd, Trans t)
 {
     cmd.Connection.Close();
     cmd.Connection = t.DbConnection;
     cmd.Transaction = t.DbTrans;
     DbDataReader reader = cmd.ExecuteReader();
     DataTable dt = new DataTable();
     return reader;
 }
Ejemplo n.º 12
0
        private long CommitBase(BaseItem baseInfo, 
            ref FSM.FileSet fset,string srcIp,ShareManDBDataContext context)
        {
            // 插入基本信息
            baseInfo.Ext4 = fset.File.Length.ToString();
            context.BaseItem.InsertOnSubmit(baseInfo);
            context.SubmitChanges();
            // 插入审核信息
            Audit ad = new Audit
            {
                ID = baseInfo.ID,
                AuditDate = DateTime.Now,
                State = 0
            };
            context.Audit.InsertOnSubmit(ad);

            // 開始創建文件集
            FSM.FileSetMan src = new ShareMan.FSM.FileSetMan();
            QS.Queries qs = new ShareMan.QS.Queries();
            qs.Url ="http://localhost/QS/QueryService.asmx" ;

            // 查詢WebService服務地址
            src.Url = qs.QueryUrl(srcIp, QS.ServiceType.FileSetMan);
            FileSetLink fsSrc = new FileSetLink();
            //在源站点创建文件集
            fsSrc.FileSetID = src.CreateFileSet(fset,false);
            fsSrc.IP = srcIp;
            /*
             * 此处查询当前活动的中转服务器
             *
             * */
            FileSetLink fsInter = new FileSetLink();
            FSM.FileSetMan inter = new ShareMan.FSM.FileSetMan();

            // 在中转服务器上创建文件集信息
            fsInter.IP = qs.QueryActInterSrv();
            inter.Url = qs.QueryUrl(fsInter.IP, QS.ServiceType.FileSetMan);
            fsInter.FileSetID = inter.CreateFileSet(fset,true);
            // 创建文件集进度信息
            CreateProgress(baseInfo,srcIp,fsInter.IP,fsInter.FileSetID,"上传",context);

            // 查询中转服务器上创建的文件集信息,并保存,用于启动传输任务
            fset = inter.QureyFileSet(fsInter.FileSetID);

            // 准备传输文件集
            Trans fsrv = new Trans();
            fsrv.Url = qs.QueryUrl(qs.QueryActInterSrv(), QS.ServiceType.FileService);
            Position pos = new Position();
            pos.ip = srcIp;
            fsrv.Transform(Convert(fset),pos);
            fsrv.Start();
            // 提交更改
            context.FileSetLink.InsertOnSubmit(fsSrc);
            context.FileSetLink.InsertOnSubmit(fsInter);
            context.SubmitChanges();

            // 创建文件链接信息
            ItemLink iLink = new ItemLink();
            iLink.ID = baseInfo.ID;
            iLink.SrcLink = fsSrc.ID;
            iLink.InterLink = fsInter.ID;
            context.ItemLink.InsertOnSubmit(iLink);
            context.SubmitChanges();
            return baseInfo.ID;
        }
Ejemplo n.º 13
0
 public void TransFileSet(string srcIp,string dstIp, FSM.FileSet fset)
 {
     Trans ts = new Trans();
     QS.Queries qs = new QS.Queries();
     ts.Url = qs.QueryUrl(dstIp, QS.ServiceType.FileService);
     Position pos = new Position();
     pos.ip = srcIp;
     ts.Transform(Convert(fset),pos);
     ts.Start();
 }
Ejemplo n.º 14
0
 public void StopTrans(string srvIp)
 {
     Trans ts = new Trans();
     QS.Queries qs = new QS.Queries();
     ts.Url = qs.QueryUrl(srvIp, QS.ServiceType.FileService);
     // 停止中转服务器上的任务
     ts.Stop();
 }
Ejemplo n.º 15
0
 public void DeleteFiles(long id, string srvIp)
 {
     Trans ts = new Trans();
     QS.Queries qs = new QS.Queries();
     ts.Url = qs.QueryUrl(srvIp, QS.ServiceType.FileService);
     // 停止中转服务器上的任务
     ts.Delete(id.ToString());
 }
Ejemplo n.º 16
0
 public void EndGame()
 {
     transFrame = 1f;
     transType = Trans.All;
     level = Level.Main;
     Game1.GameMode = Game1.GameModes.Menu;
 }