public JsonConfig() { string path_fishlord = Path.Combine(ServerPath.getPathMediaRoot(), "Fishing\\FishLord\\"); string path_route = Path.Combine(ServerPath.getPathMediaRoot(), "Fishing\\Route\\"); json_packet_list = _readJsonPacketListFormFile(path_fishlord); route_json_packet_list = _readRouteJsonPacketListFormFile(path_route); }
//------------------------------------------------------------------------- public CellConfig() { SharpConfig.Configuration.ValidCommentChars = new char[] { '#', ';' }; string cfg_file = ServerPath.getPathMediaRoot() + "Fishing\\Config\\CellConfig.cfg"; Cfg = SharpConfig.Configuration.LoadFromFile(cfg_file); _parse(); }
//------------------------------------------------------------------------- public override void init() { Init = false; CacheDesktopKey = "CacheDesktopData_" + Entity.Guid; DesktopConfigData = new DesktopConfigData(); DesktopConfigData.desktop_etguid = Entity.Guid; DesktopConfigData.seat_num = 6; DesktopConfigData.is_vip = false; DesktopConfigData.desktop_waitwhile_tm = 60; MapAllPlayer1 = new Dictionary <uint, Entity>(); MapAllPlayer = new Dictionary <string, Entity>(); byte index = 0; AllSeat = new SeatInfo[DesktopConfigData.seat_num]; foreach (var i in AllSeat) { SeatInfo seat_info = new SeatInfo(); seat_info.index = index; seat_info.et_player_rpcid = 0; seat_info.et_playermirror = null; AllSeat[index] = seat_info; index++; } DesktopInfo = new DesktopInfo(); DesktopInfo.desktop_etguid = Entity.Guid; DesktopInfo.seat_num = 6; DesktopInfo.desktop_tableid = 1; DesktopInfo.is_vip = false; DesktopInfo.list_seat_player = new List <DesktopPlayerInfo>(); DesktopInfo.all_player_num = 0; DesktopInfo.seat_player_num = 0; QueAoIEvent = new Queue <_tAoIEvent>(); QuePlayerId = new Queue <byte>(); MaxPlayerId = 0; for (int i = 0; i < 50; i++) { QuePlayerId.Enqueue(++MaxPlayerId); } TbDataRoom._eRoomType room_type = TbDataRoom._eRoomType.RT_Tenfold; bool fish_mustdie = true; bool is_single = false; float pumping_rate = 1f; string path_fishlord = Path.Combine(ServerPath.getPathMediaRoot(), "Fishing\\FishLord\\"); string path_route = Path.Combine(ServerPath.getPathMediaRoot(), "Fishing\\Route\\"); ILogicListener listener = new LogicListener(this); LogicScene = new CLogicScene(); LogicScene.create(1, 1.0f, is_single, fish_mustdie, listener, pumping_rate, _getRateList(room_type), CellApp.Instance.jsonCfg.json_packet_list, CellApp.Instance.jsonCfg.route_json_packet_list); }
//--------------------------------------------------------------------- public 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>(); // 初始化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); }