Пример #1
0
    //-------------------------------------------------------------------------
    public CellApp()
    {
        mCellApp     = this;
        ServerConfig = new ServerConfig();

        // 初始化DataMgr
        {
            string path_media  = ServerPath.getPathMediaRoot();
            string db_filename = Path.Combine(path_media, "Dragon\\Config\\Dragon.db");
            EbLog.Note(db_filename);
            TbDataMgr.setup(db_filename);
        }

        // 初始化ScriptMgr
        //{
        //string path_media = ServerPath.getPathMediaRoot();
        //string dir_script = Path.Combine(path_media, "Dragon\\Script\\S\\");
        //mScriptMgr.create(dir_script);

        //List<string> list_param = new List<string>();
        //list_param.Add("102");
        //Effect.doEffect(Entity, 1901, list_param);
        //}

        // 初始化单位模块
        UnitSys.setup(false);

        // 初始化效果系统
        EffectSys = new EffectSys(true);
        EffectSys.regEffect(new EffectActorPropAttackPoint());
        EffectSys.regEffect(new EffectActorPropAttackSpeed());
        EffectSys.regEffect(new EffectActorPropCriticalHitPoint());
        EffectSys.regEffect(new EffectActorPropDefencePoint());
        EffectSys.regEffect(new EffectActorPropDodgePoint());
        EffectSys.regEffect(new EffectActorPropEnergyPointCur());
        EffectSys.regEffect(new EffectActorPropEnergyPointMax());
        EffectSys.regEffect(new EffectActorPropFireEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropFireResistancePoint());
        EffectSys.regEffect(new EffectActorPropHealthPointCur());
        EffectSys.regEffect(new EffectActorPropHealthPointMax());
        EffectSys.regEffect(new EffectActorPropHitPoint());
        EffectSys.regEffect(new EffectActorPropMetalEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropMetalResistancePoint());
        EffectSys.regEffect(new EffectActorPropSoilEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropSoilResistancePoint());
        EffectSys.regEffect(new EffectActorPropTenacityPoint());
        EffectSys.regEffect(new EffectActorPropWaterEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropWaterResistancePoint());
        EffectSys.regEffect(new EffectActorPropWoodEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropWoodResistancePoint());
        EffectSys.regEffect(new EffectCreateStatus());
        EffectSys.regEffect(new EffectLearnSkill());
        EffectSys.regEffect(new EffectSkillPropAttackPoint());
        EffectSys.regEffect(new EffectSkillPropAttackSpeed());
        EffectSys.regEffect(new EffectSkillPropCriticalHitPoint());
        EffectSys.regEffect(new EffectSkillPropDefencePoint());
        EffectSys.regEffect(new EffectSkillPropDodgePoint());
        EffectSys.regEffect(new EffectSkillPropEnergyPointCur());
        EffectSys.regEffect(new EffectSkillPropEnergyPointMax());
        EffectSys.regEffect(new EffectSkillPropFireEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropFireResistancePoint());
        EffectSys.regEffect(new EffectSkillPropHealthPointCur());
        EffectSys.regEffect(new EffectSkillPropHealthPointMax());
        EffectSys.regEffect(new EffectSkillPropHitPoint());
        EffectSys.regEffect(new EffectSkillPropMetalEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropMetalResistancePoint());
        EffectSys.regEffect(new EffectSkillPropSoilEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropSoilResistancePoint());
        EffectSys.regEffect(new EffectSkillPropTenacityPoint());
        EffectSys.regEffect(new EffectSkillPropWaterEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropWaterResistancePoint());
        EffectSys.regEffect(new EffectSkillPropWoodEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropWoodResistancePoint());
        EffectSys.regEffect(new EffectTakeoffEquip());
        EffectSys.regEffect(new EffectTakeonEquip());

        //// 创建EtWorld子Entity
        //Entity et_world = EntityMgr.createEntity<EtWorld>(null, Entity);
        //CoWorld = et_world.getComponent<CellWorld<ComponentDef>>();

        // 注册BtFactory
        _regBtFactory(new BtFactoryBossNoraml());
        _regBtFactory(new BtFactoryBossNoramlMirror());
        _regBtFactory(new BtFactoryBot());
        _regBtFactory(new BtFactoryBotMirror());
        _regBtFactory(new BtFactoryMonsterNormal());
        _regBtFactory(new BtFactoryMonsterNormalMirror());
        _regBtFactory(new BtFactoryPlayer());
        _regBtFactory(new BtFactoryPlayerMirror());

        // 加载所有Bot
        var map_databot = EbDataMgr.Instance.getMapData <TbDataBot>();

        foreach (var i in map_databot)
        {
            TbDataBot data_bot = (TbDataBot)i.Value;

            var player = GrainFactory.GetGrain <ICellPlayer>(new Guid(data_bot.EtGuid));
            player.botNewAndEnterWorld(data_bot.NickName);
        }
    }
Пример #2
0
    //-------------------------------------------------------------------------
    public CellApp()
    {
        mCellApp = this;
        ServerConfig = new ServerConfig();

        // 初始化DataMgr
        {
            string path_media = ServerPath.getPathMediaRoot();
            string db_filename = Path.Combine(path_media, "Dragon\\Config\\Dragon.db");
            EbLog.Note(db_filename);
            TbDataMgr.setup(db_filename);
        }

        // 初始化ScriptMgr
        //{
        //string path_media = ServerPath.getPathMediaRoot();
        //string dir_script = Path.Combine(path_media, "Dragon\\Script\\S\\");
        //mScriptMgr.create(dir_script);

        //List<string> list_param = new List<string>();
        //list_param.Add("102");
        //Effect.doEffect(Entity, 1901, list_param);
        //}

        // 初始化单位模块
        UnitSys.setup(false);

        // 初始化效果系统
        EffectSys = new EffectSys(true);
        EffectSys.regEffect(new EffectActorPropAttackPoint());
        EffectSys.regEffect(new EffectActorPropAttackSpeed());
        EffectSys.regEffect(new EffectActorPropCriticalHitPoint());
        EffectSys.regEffect(new EffectActorPropDefencePoint());
        EffectSys.regEffect(new EffectActorPropDodgePoint());
        EffectSys.regEffect(new EffectActorPropEnergyPointCur());
        EffectSys.regEffect(new EffectActorPropEnergyPointMax());
        EffectSys.regEffect(new EffectActorPropFireEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropFireResistancePoint());
        EffectSys.regEffect(new EffectActorPropHealthPointCur());
        EffectSys.regEffect(new EffectActorPropHealthPointMax());
        EffectSys.regEffect(new EffectActorPropHitPoint());
        EffectSys.regEffect(new EffectActorPropMetalEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropMetalResistancePoint());
        EffectSys.regEffect(new EffectActorPropSoilEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropSoilResistancePoint());
        EffectSys.regEffect(new EffectActorPropTenacityPoint());
        EffectSys.regEffect(new EffectActorPropWaterEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropWaterResistancePoint());
        EffectSys.regEffect(new EffectActorPropWoodEnhancementPoint());
        EffectSys.regEffect(new EffectActorPropWoodResistancePoint());
        EffectSys.regEffect(new EffectCreateStatus());
        EffectSys.regEffect(new EffectLearnSkill());
        EffectSys.regEffect(new EffectSkillPropAttackPoint());
        EffectSys.regEffect(new EffectSkillPropAttackSpeed());
        EffectSys.regEffect(new EffectSkillPropCriticalHitPoint());
        EffectSys.regEffect(new EffectSkillPropDefencePoint());
        EffectSys.regEffect(new EffectSkillPropDodgePoint());
        EffectSys.regEffect(new EffectSkillPropEnergyPointCur());
        EffectSys.regEffect(new EffectSkillPropEnergyPointMax());
        EffectSys.regEffect(new EffectSkillPropFireEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropFireResistancePoint());
        EffectSys.regEffect(new EffectSkillPropHealthPointCur());
        EffectSys.regEffect(new EffectSkillPropHealthPointMax());
        EffectSys.regEffect(new EffectSkillPropHitPoint());
        EffectSys.regEffect(new EffectSkillPropMetalEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropMetalResistancePoint());
        EffectSys.regEffect(new EffectSkillPropSoilEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropSoilResistancePoint());
        EffectSys.regEffect(new EffectSkillPropTenacityPoint());
        EffectSys.regEffect(new EffectSkillPropWaterEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropWaterResistancePoint());
        EffectSys.regEffect(new EffectSkillPropWoodEnhancementPoint());
        EffectSys.regEffect(new EffectSkillPropWoodResistancePoint());
        EffectSys.regEffect(new EffectTakeoffEquip());
        EffectSys.regEffect(new EffectTakeonEquip());

        //// 创建EtWorld子Entity
        //Entity et_world = EntityMgr.createEntity<EtWorld>(null, Entity);
        //CoWorld = et_world.getComponent<CellWorld<ComponentDef>>();

        // 注册BtFactory
        _regBtFactory(new BtFactoryBossNoraml());
        _regBtFactory(new BtFactoryBossNoramlMirror());
        _regBtFactory(new BtFactoryBot());
        _regBtFactory(new BtFactoryBotMirror());
        _regBtFactory(new BtFactoryMonsterNormal());
        _regBtFactory(new BtFactoryMonsterNormalMirror());
        _regBtFactory(new BtFactoryPlayer());
        _regBtFactory(new BtFactoryPlayerMirror());

        // 加载所有Bot
        var map_databot = EbDataMgr.Instance.getMapData<TbDataBot>();
        foreach (var i in map_databot)
        {
            TbDataBot data_bot = (TbDataBot)i.Value;

            var player = GrainFactory.GetGrain<ICellPlayer>(new Guid(data_bot.EtGuid));
            player.botNewAndEnterWorld(data_bot.NickName);
        }
    }
Пример #3
0
        //---------------------------------------------------------------------
        public async Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config)
        {
            EntityMgr = new EntityMgr((byte)NodeType.Cell, NodeType.Cell.ToString());

            EntityMgr.regComponent <CellActor <DefActor> >();
            EntityMgr.regComponent <CellActorMirror <DefActorMirror> >();
            EntityMgr.regComponent <CellActorMirrorAi <DefActorMirrorAi> >();
            EntityMgr.regComponent <CellBag <DefBag> >();
            EntityMgr.regComponent <CellDesktop <DefDesktop> >();
            EntityMgr.regComponent <CellEquip <DefEquip> >();
            EntityMgr.regComponent <CellPlayer <DefPlayer> >();
            EntityMgr.regComponent <CellPlayerChat <DefPlayerChat> >();
            EntityMgr.regComponent <CellPlayerDesktop <DefPlayerDesktop> >();
            EntityMgr.regComponent <CellPlayerFriend <DefPlayerFriend> >();
            EntityMgr.regComponent <CellPlayerLobby <DefPlayerLobby> >();
            EntityMgr.regComponent <CellPlayerMailBox <DefPlayerMailBox> >();
            EntityMgr.regComponent <CellPlayerTask <DefPlayerTask> >();
            EntityMgr.regComponent <CellPlayerTrade <DefPlayerTrade> >();
            EntityMgr.regComponent <CellPlayerRanking <DefPlayerRanking> >();
            EntityMgr.regComponent <CellStatus <DefStatus> >();

            EntityMgr.regEntityDef <EtDesktop>();
            EntityMgr.regEntityDef <EtPlayer>();
            EntityMgr.regEntityDef <EtPlayerMirror>();

            DbClientCouchbase = new DbClientCouchbase();
            EntityCouchbase et_couchbase = new EntityCouchbase(EntityMgr, DbClientCouchbase.Bucket);

            // 创建视图
            //var couchbase_mgr = DbClientCouchbase.Instance.Bucket.CreateManager("Cragon", "123321");
            //var get = couchbase_mgr.GetDesignDocument("dev_team");
            //if (!get.Success)
            //{
            //    var design_doc = File.ReadAllText(@"..\\..\\..\\Media\\Fishing\\CouchbaseView\\dev_team.json");
            //    var inserted = couchbase_mgr.InsertDesignDocument("dev_team", design_doc);
            //    if (inserted.Success)
            //    {
            //        EbLog.Note("Created 'team' design doc.  Success");
            //    }
            //    else
            //    {
            //        EbLog.Note("Created 'team' design doc.  Failed, Msg=" + inserted.Message);
            //    }
            //}

            // 初始化DataMgr
            {
                string path_media  = ServerPath.getPathMediaRoot();
                string db_filename = Path.Combine(path_media, "Fishing\\Config\\Fishing.db");
                EbLog.Note(db_filename);
                TbDataMgr.setup(db_filename);
            }

            // 初始化单位模块
            UnitSys.setup(false);

            // 初始化效果系统
            EffectSys.regEffect(new EffectCreateStatus());
            EffectSys.regEffect(new EffectStatus1());
            EffectSys.regEffect(new EffectStatus2());
            EffectSys.regEffect(new EffectStatusCreator1());
            EffectSys.regEffect(new EffectStatusCreator2());
            EffectSys.regEffect(new EffectTakeoffEquip());
            EffectSys.regEffect(new EffectTakeonEquip());
            EffectSys.regEffect(new EffectUseConsumable());
            EffectSys.regEffect(new EffectUseSkillBook());

            // 初始化CellApp
            CellApp = new CellApp();

            //// 加载所有Bot
            //var map_databot = EbDataMgr.Instance.getMapData<TbDataBot>();
            //foreach (var i in map_databot)
            //{
            //    TbDataBot data_bot = (TbDataBot)i.Value;

            //    //var grain_player = CellPlayerFactory.GetGrain(new Guid(data_bot.EtGuid));
            //    //var grain_player = GrainFactory.GetGrain<ICellPlayer>(new Guid(data_bot.EtGuid));
            //    //await grain_player.botNewAndEnterWorld(data_bot.NickName);
            //}

            //return TaskDone.Done;
        }