Beispiel #1
0
    private void run()
    {
        while (m_run)
        {
            try
            {
                List <Dictionary <string, object> > dataList =
                    MongodbPlayer.Instance.ExecuteGetListByQuery(TableName.PLAYER_ORDER_REQ,
                                                                 null,
                                                                 null,
                                                                 "genTime",
                                                                 true,
                                                                 0,
                                                                 1000);
                if (dataList.Count > 0 && m_form != null)
                {
                    m_form.setState(0);
                }

                for (int i = 0; i < dataList.Count && m_run; i++)
                {
                    OrderInfo info = OrderFactory.getInstance().getOrderInfo(dataList[i]);
                    if (info != null)
                    {
                        if (m_state.ContainsKey(info.m_orderState))
                        {
                            m_state[info.m_orderState].process(info, this);
                        }
                        else
                        {
                            LogMgr.log.ErrorFormat("订单的状态[{0}]未知,订单id[{1}]", info.m_orderState, info.m_orderId);
                        }

                        OrderFactory.getInstance().addIdleOrder(info);
                    }
                }

                if (m_form != null)
                {
                    m_form.setState(1);
                }
            }
            catch (System.Exception ex)
            {
                LogMgr.log.Error(ex.ToString());
            }

            if (m_run)
            {
                Thread.Sleep(500);
            }
        }
    }
Beispiel #2
0
    private void run()
    {
        while (m_run)
        {
            try
            {
                m_sysMgr.update(0);

                if (m_form != null)
                {
                    m_form.setState(1);
                }
            }
            catch (System.Exception ex)
            {
                LogMgr.log.Error(ex.ToString());
            }

            if (m_run)
            {
                try
                {
                    XmlConfig xml = ResMgr.getInstance().getRes("dbserver.xml");
                    int       sec = xml.getInt("statInterval", 60);
                    Thread.Sleep(sec);
                }
                catch (System.Exception ex)
                {
                }
            }
        }
    }
Beispiel #3
0
    private void run()
    {
        while (m_run)
        {
            try
            {
                if (m_form != null)
                {
                    m_form.setState(0);
                }

//                 List<ChannelInfo> channelList = ResMgr.getInstance().getChannelList();
//                 foreach (var info in channelList)
//                 {
//                     bool res = statChannel(info);
//                     if (res)
//                     {
//                         resetChannelStatDay(info);
//                     }
//                 }
                m_sysMgr.update(0);

                if (m_form != null)
                {
                    m_form.setState(1);
                }
            }
            catch (System.Exception ex)
            {
                LogMgr.log.Error(ex.ToString());
            }

            if (m_run)
            {
                try
                {
                    XmlConfig xml = ResMgr.getInstance().getRes("dbserver.xml");
                    int       sec = xml.getInt("statInterval", 60);
                    Thread.Sleep(sec);
                }
                catch (System.Exception ex)
                {
                }
            }
        }
    }
Beispiel #4
0
    private void run()
    {
//         Dictionary<string, object> data = new Dictionary<string, object>();
//         data.Add("playerAcc", "123test00");
//         data.Add("playerId", "0");
//         data.Add("startTime", DateTime.Now);
//         data.Add("endTime", DateTime.Now);

        // 只找完整退出的记录
        //  IMongoQuery imq = Query.EQ("full", BsonValue.Create(true));

        while (m_run)
        {
            try
            {
                /*List<Dictionary<string, object>> dataList =
                 *  DBMgr.getInstance().executeQuery(TableName.PLAYER_FOR_WIN_LOSE,
                 *                                   m_serverId,
                 *                                   DbName.DB_PLAYER,
                 *                                   imq,
                 *                                   0,
                 *                                   1000);
                 * if (dataList.Count > 0 && m_form != null)
                 * {
                 *  m_form.setState(0);
                 * }
                 *
                 * for (int i = 0; i < dataList.Count && m_run; i++)
                 * {
                 *  Dictionary<string, object> data = dataList[i];
                 *  int retCode = stat(data);
                 *  if (retCode == 0)
                 *  {
                 *      bool res = insertData(data);
                 *      if (res)
                 *      {
                 *          DBMgr.getInstance().remove(TableName.PLAYER_FOR_WIN_LOSE, "key", data["key"], m_serverId, DbName.DB_PLAYER);
                 *      }
                 *  }
                 *  else if (retCode == FunRet.RET_LACK_PARAM)
                 *  {
                 *      if (data.ContainsKey("key"))
                 *      {
                 *          DBMgr.getInstance().remove(TableName.PLAYER_FOR_WIN_LOSE, "key", data["key"], m_serverId, DbName.DB_PLAYER);
                 *      }
                 *  }
                 * }*/

                if (m_form != null)
                {
                    m_form.setState(0);
                }

                m_sysMgr.update(0);

                if (m_form != null)
                {
                    m_form.setState(1);
                }
            }
            catch (System.Exception ex)
            {
                LogMgr.log.Error(ex.ToString());
            }

            if (m_run)
            {
                Thread.Sleep(1000);
            }
        }
    }