develope
parent
130ba02824
commit
bf98618722
|
@ -15,27 +15,37 @@ namespace ET
|
||||||
{
|
{
|
||||||
Unit unit = EntityFactory.CreateWithId<Unit>(domain, id);
|
Unit unit = EntityFactory.CreateWithId<Unit>(domain, id);
|
||||||
PlayerData data = await DBComponent.Instance.Query<PlayerData>(id);
|
PlayerData data = await DBComponent.Instance.Query<PlayerData>(id);
|
||||||
|
if (data)
|
||||||
unit.AddComponent(data);
|
unit.AddComponent(data);
|
||||||
Character character = await DBComponent.Instance.Query<Character>(id);
|
Character character = await DBComponent.Instance.Query<Character>(id);
|
||||||
|
if (character)
|
||||||
unit.AddComponent(character);
|
unit.AddComponent(character);
|
||||||
NumericComponent num = await DBComponent.Instance.Query<NumericComponent>(id);
|
NumericComponent num = await DBComponent.Instance.Query<NumericComponent>(id);
|
||||||
|
if (num)
|
||||||
unit.AddComponent(num);
|
unit.AddComponent(num);
|
||||||
UnitSkillComponent unitSkill = await DBComponent.Instance.Query<UnitSkillComponent>(id);
|
UnitSkillComponent unitSkill = await DBComponent.Instance.Query<UnitSkillComponent>(id);
|
||||||
|
if (unitSkill)
|
||||||
unit.AddComponent(unitSkill);
|
unit.AddComponent(unitSkill);
|
||||||
//!玩家设置
|
//!玩家设置
|
||||||
UserSetting setting = await DBComponent.Instance.Query<UserSetting>(id);
|
UserSetting setting = await DBComponent.Instance.Query<UserSetting>(id);
|
||||||
|
if (setting)
|
||||||
unit.AddComponent(setting);
|
unit.AddComponent(setting);
|
||||||
//!任务
|
//!任务
|
||||||
UnitTask unitTask = await DBComponent.Instance.Query<UnitTask>(id);
|
UnitTask unitTask = await DBComponent.Instance.Query<UnitTask>(id);
|
||||||
|
if (unitTask)
|
||||||
unit.AddComponent(unitTask);
|
unit.AddComponent(unitTask);
|
||||||
//!背包
|
//!背包
|
||||||
Bag bag = await DBComponent.Instance.Query<Bag>(id);
|
Bag bag = await DBComponent.Instance.Query<Bag>(id);
|
||||||
|
if (bag)
|
||||||
unit.AddComponent(bag);
|
unit.AddComponent(bag);
|
||||||
UnitScene unitScene = await DBComponent.Instance.Query<UnitScene>(id);
|
UnitScene unitScene = await DBComponent.Instance.Query<UnitScene>(id);
|
||||||
|
if (unitScene)
|
||||||
unit.AddComponent(unitScene);
|
unit.AddComponent(unitScene);
|
||||||
StarSoulBag starSoulBag = await DBComponent.Instance.Query<StarSoulBag>(id);
|
StarSoulBag starSoulBag = await DBComponent.Instance.Query<StarSoulBag>(id);
|
||||||
|
if (starSoulBag)
|
||||||
unit.AddComponent(starSoulBag);
|
unit.AddComponent(starSoulBag);
|
||||||
Pet pet = await DBComponent.Instance.Query<Pet>(id);
|
Pet pet = await DBComponent.Instance.Query<Pet>(id);
|
||||||
|
if (pet)
|
||||||
unit.AddComponent(pet);
|
unit.AddComponent(pet);
|
||||||
unit.AddComponent<Combat>();
|
unit.AddComponent<Combat>();
|
||||||
|
|
||||||
|
@ -96,7 +106,8 @@ namespace ET
|
||||||
long mapInstanceId = StartSceneConfigCategory.Instance.GetBySceneName(zone, SceneType.UserCache.ToString()).SceneId;
|
long mapInstanceId = StartSceneConfigCategory.Instance.GetBySceneName(zone, SceneType.UserCache.ToString()).SceneId;
|
||||||
MessageHelper.SendActor(mapInstanceId, new M2U_WriteComponent() { Id = t.Id, type = typeof (T).Name, component = t });
|
MessageHelper.SendActor(mapInstanceId, new M2U_WriteComponent() { Id = t.Id, type = typeof (T).Name, component = t });
|
||||||
}
|
}
|
||||||
public static void SaveComponenet<T>(int zone,T t) where T : Entity
|
|
||||||
|
public static void SaveComponenet<T>(int zone, T t) where T : Entity
|
||||||
{
|
{
|
||||||
if (zone == 0)
|
if (zone == 0)
|
||||||
{
|
{
|
||||||
|
@ -129,7 +140,7 @@ namespace ET
|
||||||
unitInfo.YAngle = unitScene.YAngle;
|
unitInfo.YAngle = unitScene.YAngle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async ETTask AddComponentFromDB(Unit unit,int jobId)
|
public static async ETTask AddComponentFromDB(Unit unit, int jobId)
|
||||||
{
|
{
|
||||||
int zone = unit.DomainZone();
|
int zone = unit.DomainZone();
|
||||||
long id = unit.Id;
|
long id = unit.Id;
|
||||||
|
@ -231,6 +242,7 @@ namespace ET
|
||||||
{
|
{
|
||||||
bag.InitBag();
|
bag.InitBag();
|
||||||
}
|
}
|
||||||
|
|
||||||
bag.CheckSlot();
|
bag.CheckSlot();
|
||||||
|
|
||||||
Store store = await StoreComponent.Instance.Query(unit.Id);
|
Store store = await StoreComponent.Instance.Query(unit.Id);
|
||||||
|
@ -250,10 +262,9 @@ namespace ET
|
||||||
|
|
||||||
public static async ETTask SendUnitInfo(Unit unit)
|
public static async ETTask SendUnitInfo(Unit unit)
|
||||||
{
|
{
|
||||||
Log.Debug($"【{ UserComponent.Instance.Get(unit.Id)?.NickName} ({ unit.Id})】已经进入游戏");
|
Log.Debug($"【{UserComponent.Instance.Get(unit.Id)?.NickName} ({unit.Id})】已经进入游戏");
|
||||||
PlayerData data = unit.GetComponent<PlayerData>();
|
PlayerData data = unit.GetComponent<PlayerData>();
|
||||||
|
|
||||||
|
|
||||||
var num = unit.GetComponent<NumericComponent>();
|
var num = unit.GetComponent<NumericComponent>();
|
||||||
CharacterHelper.ResetAddNumeric(unit, num);
|
CharacterHelper.ResetAddNumeric(unit, num);
|
||||||
data.IsBattleIdle = false;
|
data.IsBattleIdle = false;
|
||||||
|
@ -263,19 +274,16 @@ namespace ET
|
||||||
Log.Error($"unitScene == null where id = {unit.Id}");
|
Log.Error($"unitScene == null where id = {unit.Id}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(unitScene.MapId/100 == Sys_SceneId.Scene_BattleIdle)
|
|
||||||
|
if (unitScene.MapId / 100 == Sys_SceneId.Scene_BattleIdle)
|
||||||
{
|
{
|
||||||
unitScene.MapId = Sys_SceneId.Scene_MainCity * 100 + 1;
|
unitScene.MapId = Sys_SceneId.Scene_MainCity * 100 + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!+任务相关
|
//!+任务相关
|
||||||
|
|
||||||
|
|
||||||
//!+发送Boss消息
|
//!+发送Boss消息
|
||||||
Game.EventSystem.Publish(new EventType.AfterEnterGame() { unit = unit });
|
Game.EventSystem.Publish(new EventType.AfterEnterGame() { unit = unit });
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
|
@ -1 +1 @@
|
||||||
eNolTT0LwjAU3AP5D3Krb3gJQunbpC4OXRwECaEUWkuWBGLEQfrfTe1wcMd9Oa2cYTZ0+GIIE+Qv8IBYtpX0kJZwgTSE+5xfIcWaIdzmz5inc84QV5sFgn4MsVTsVpfiMyzHXYAwXLdxw5ZPhC69Y9kueCW/etLKa/UDI1Imdg==
|
eNqL5uWKNjQwMNRRqFaKz0xRsgJzlCKVrIwMjIAMXyUrSx0lFyAXyAlLLSrOzM8DKtJR8ssvyUxOVbJSerJj7fPl3S+6mp7uX/1k54T3exqVdJSCUssTi1Ici4qUrKKBBpcA1fkmZuaVADFEyjk/Ly0zXRvCAWqI9wTZbWhgZGCio+ScX5pXAnKBgUGtTmxtrA4vVywvFwA4dDcg
|
Loading…
Reference in New Issue