コード例 #1
0
 void Awake()
 {
     ServiceMgr.GetServiceMgr().RegisterService(new UnityLogService());
     ServiceMgr.GetServiceMgr().RegisterService(new GameObjectPoolService());
     //LogService service =ServiceMgr.GetServiceMgr().GetService<LogService>();
     XLN.Game.Common.ApplicationContext.Init(new UnityResourceService(), UnitySystem.UnityScheduler);
 }
コード例 #2
0
        public Form1()
        {
            InitializeComponent();

            this.ShowInTaskbar = false;

            ToolStripMenuItem v = new ToolStripMenuItem("退出", null, this.onExit);

            m_notifyMenu.Items.Add(v);
            // 关联快捷菜单
            m_notify.ContextMenuStrip = m_notifyMenu;

            CheckForIllegalCrossThreadCalls = false;

            m_lblCurState.ForeColor = Color.Green;

            XmlConfig cfg = ResMgr.getInstance().getRes("dbserver.xml");

            this.Text     = "数据统计--" + cfg.getString("title", "");
            m_notify.Text = this.Text;

            StatService sys =
                ServiceMgr.getInstance().getSys <StatService>(ServiceType.serviceTypeStat);

            if (sys != null)
            {
                sys.setForm(this);
            }
        }
コード例 #3
0
        public AttributeComponent(string key)
        {
            DataModelService = ServiceMgr.GetServiceMgr().GetService <DataModelService>();
            m_key            = key;

            m_Attribute = DataModelService.AttributeCollections[this.GetType().FullName].DataAttributes[Key];
        }
コード例 #4
0
 public static ServiceMgr getInstance()
 {
     if (s_obj == null)
     {
         s_obj = new ServiceMgr();
     }
     return(s_obj);
 }
コード例 #5
0
        // 退出应用程序
        private void onExit(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("确定退出?", "确认", MessageBoxButtons.OKCancel);

            if (result == DialogResult.OK)
            {
                ServiceMgr.getInstance().exitService();
                Application.Exit();
            }
        }
コード例 #6
0
        static void Main()
        {
            LogMgr.init();
            ResMgr.getInstance().reload();
            ServiceMgr.getInstance().init();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
コード例 #7
0
        public override void Init()
        {
            base.Init();
            m_GOPoolService = ServiceMgr.GetServiceMgr().GetService <GameObjectPoolService>();
            m_ResService    = ServiceMgr.GetServiceMgr().GetService <ResourceService>();
            UnityActor unityActor = (UnityActor)Actor;

            m_GameObject = unityActor.GameObject;

            UpdateRenderObject();
        }
コード例 #8
0
ファイル: BootStrapperBase.cs プロジェクト: radtek/AppModules
        public void Run()
        {
            _logMgr = CreateLogMgr();
            if (_logMgr == null)
            {
                throw new NullReferenceException("LogMgr can not be null.");
            }
            _logger = _logMgr.GetLogger("BootStrapper");
            _logger.Info("Run.");

            AggregateCatalog catalog = CreateAgregateCatalog();

            if (catalog == null)
            {
                FatalError(new NullReferenceException("AggregateCatalog can not be null."));
            }

            _container = new CompositionContainer(catalog);
            if (_container == null)
            {
                FatalError(new NullReferenceException("CompositionContainer can not be null."));
            }

            IEventMgr eventMgr = CreateEventMgr();

            if (eventMgr == null)
            {
                FatalError(new NullReferenceException("EventMgr can not be null."));
            }

            PlugginMgr plugginMgr = CreatePlugginMgr();

            if (plugginMgr == null)
            {
                FatalError(new NullReferenceException("PlugginMgr can not be null."));
            }

            _container.ComposeExportedValue <ILogMgr>(LogMgr);
            _container.ComposeExportedValue <IEventMgr>(eventMgr);
            _container.ComposeExportedValue <IServiceMgr>(new ServiceMgrImpl(_logMgr, _container));
            IServiceMgr serviceMgr = _container.GetExportedValue <IServiceMgr>();

            ServiceMgr.SetServiceMgrProvider(() => serviceMgr);

            _container.ComposeExportedValue <IPlugginMgr>(plugginMgr);
            _container.ComposeParts(plugginMgr);

            RegisterServices();
            StartWork();
        }
コード例 #9
0
    // 完成一个订单
    public int completeOrder(OrderInfo info)
    {
        string cmd = string.Format(SQL_SEARCH_GM, TableName.GM_ACCOUNT, info.m_gmAcc);
        Dictionary <string, object> data = m_sqlDb.queryOne(cmd, CMySqlDbName.DB_XIANXIA);

        if (data == null)
        {
            return(RetCode.RET_NO_SUP_ACC);
        }

        string createCode  = Convert.ToString(data["createCode"]);
        int    depth       = Convert.ToInt32(data["depth"]);
        long   remainMoney = Convert.ToInt64(data["money"]);
        bool   res         = addOrderToMySql(info, createCode, remainMoney);

        if (!res)
        {
            return(RetCode.RET_DB_ERROR);
        }

        if (info.m_isApi) // 若是API发出的,需要回调
        {
            string             devKey = Convert.ToString(data["devSecretKey"]);
            ApiCallBackService sys    = ServiceMgr.getInstance().getSys <ApiCallBackService>(ServiceType.serviceTypeApiCallBack);
            sys.addApiOrder(info, devKey);
        }

        forPlayerOrder(info);

        // 插入mysql成功,从mongodb里面删除
        MongodbPlayer.Instance.ExecuteRemoveBykey(TableName.PLAYER_ORDER_REQ, "key", info.m_key);
        returnMoneyToGM(info);

        // 修改player_account的money临时字段,可以在后台随时查看分数
        if (info.m_orderState == PlayerReqOrderState.STATE_FINISH)
        {
            //  scoreLog(info, depth, createCode); // 上下分成功后,才会写日志

            string upSql = string.Format(SQL_UPDATE_ONLINE_MONEY,
                                         TableName.PLAYER_ACCOUNT_XIANXIA,
                                         info.m_playerRemainMoney,
                                         info.m_playerAcc);
            m_sqlDb.executeOp(upSql, CMySqlDbName.DB_XIANXIA);
        }

        return(RetCode.RET_SUCCESS);
    }
コード例 #10
0
        // 退出应用程序
        private void onExit(object sender, EventArgs e)
        {
            bool busy = ServiceMgr.getInstance().isBusy();

            if (busy)
            {
                MessageBox.Show("当前系统忙碌,请稍候退出!", "确认", MessageBoxButtons.OK);
                return;
            }
            DialogResult result = MessageBox.Show("确定退出?", "确认", MessageBoxButtons.OKCancel);

            if (result == DialogResult.OK)
            {
                ServiceMgr.getInstance().exitService();
                Application.Exit();
            }
        }
コード例 #11
0
        static void Main()
        {
            LogMgr.init();

            XmlConfig xml  = ResMgr.getInstance().getRes("dbserver.xml");
            int       port = xml.getInt("exportPort", 60002);

            TcpServerChannel tcpChannel = new TcpServerChannel(port);

            RemotingConfiguration.RegisterWellKnownServiceType(typeof(ServersEngine), "ServersEngine", WellKnownObjectMode.Singleton);
            ChannelServices.RegisterChannel(tcpChannel, false);

            ServiceMgr.getInstance().init();

            ServersEngine.s_callService = ServiceMgr.getInstance().doService;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
コード例 #12
0
        public Form1()
        {
            InitializeComponent();

            this.ShowInTaskbar = false;

            ToolStripMenuItem v = new ToolStripMenuItem("退出", null, this.onExit);

            m_notifyMenu.Items.Add(v);
            // 关联快捷菜单
            m_notify.ContextMenuStrip = m_notifyMenu;

            CheckForIllegalCrossThreadCalls = false;

            StatWinLoseService sys =
                ServiceMgr.getInstance().getSys <StatWinLoseService>(ServiceType.serviceTypeWinLose);

            sys.setForm(this);

            m_lblCurState.ForeColor = Color.Green;
        }
コード例 #13
0
        // 开始检测收支平衡
        private void btnCheck_Click(object sender, EventArgs e)
        {
            StatService stat = ServiceMgr.getInstance().getSys <StatService>(ServiceType.serviceTypeStat);

            if (stat.isBusy())
            {
                MessageBox.Show("忙碌中,请稍候");
                return;
            }

            int playerId = 0;

            if (!int.TryParse(txtPlayerId.Text, out playerId))
            {
                MessageBox.Show("玩家ID非法");
                return;
            }

            DateTime mint = DateTime.Now, maxt = DateTime.Now;
            bool     res = Tool.splitTimeStr(txtGameTime.Text, ref mint, ref maxt);

            if (!res || mint.AddDays(1) != maxt)
            {
                MessageBox.Show("游戏时间非法");
                return;
            }

            ParamCheck param = new ParamCheck();

            param.m_gameId    = StrName.s_onlineGameIdList[m_gameList.SelectedIndex];
            param.m_playerId  = playerId;
            param.m_startTime = mint;
            param.m_endTime   = maxt;
            param.m_itemId    = s_itemId[m_moneyType.SelectedIndex];
            param.m_from      = this;
            stat.startCheck(param);
        }
コード例 #14
0
 void OnApplicationQuit()
 {
     ServiceMgr.GetServiceMgr().OnDestroy();
 }
コード例 #15
0
 void Update()
 {
     ServiceMgr.GetServiceMgr().Update(Time.deltaTime);
 }
コード例 #16
0
 static void OnAfterSceneLoadRuntimeMethod()
 {
     ServiceMgr.GetServiceMgr().OnEvent(0);
 }
コード例 #17
0
 public ActorComponent()
 {
     m_ActorService = ServiceMgr.GetServiceMgr().GetService <ActorService>();
 }
コード例 #18
0
 public override bool OnInit()
 {
     m_ActorService = ServiceMgr.GetServiceMgr().GetService <ActorService>();
     return(true);
 }