Skip to content

Commit

Permalink
[修改]1. 修改Core变化的适配
Browse files Browse the repository at this point in the history
  • Loading branch information
AlianBlank committed Jul 19, 2024
1 parent d9ba472 commit 962c2ed
Show file tree
Hide file tree
Showing 24 changed files with 31 additions and 22 deletions.
1 change: 1 addition & 0 deletions GameFrameX.Apps/Account/Login/Component/LoginComponent.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Threading.Tasks;
using GameFrameX.Apps.Account.Login.Entity;
using GameFrameX.Core.Abstractions;
using GameFrameX.Core.Components;
using GameFrameX.DataBase;
using GameFrameX.Monitor.Account;

Expand Down
1 change: 0 additions & 1 deletion GameFrameX.Apps/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
global using MongoDB.Bson.Serialization.Attributes;
global using GameFrameX.Core;
global using GameFrameX.Core.Utility;
global using GameFrameX.Core.Comps;
global using GameFrameX.Core.Events;
global using GameFrameX.Core.Hotfix.Agent;
global using GameFrameX.Core.Hotfix;
Expand Down
1 change: 1 addition & 0 deletions GameFrameX.Apps/Player/Player/Component/PlayerComponent.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Threading.Tasks;
using GameFrameX.Apps.Player.Player.Entity;
using GameFrameX.Core.Abstractions;
using GameFrameX.Core.Components;
using GameFrameX.Monitor.Player;
using Random = GameFrameX.Utility.Random;

Expand Down
1 change: 1 addition & 0 deletions GameFrameX.Apps/Player/Role/Bag/Component/BagComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GameFrameX.Apps.Player.Role.Bag.Entity;
using GameFrameX.Core.Abstractions;
using GameFrameX.Core.Components;

namespace GameFrameX.Apps.Player.Role.Bag.Component
{
Expand Down
1 change: 1 addition & 0 deletions GameFrameX.Apps/Player/Role/Pet/Component/PetComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GameFrameX.Apps.Player.Role.Pet.Entity;
using GameFrameX.Core.Abstractions;
using GameFrameX.Core.Components;

namespace GameFrameX.Apps.Player.Role.Pet.Component
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GameFrameX.Apps.Server.Heart.Entity;
using GameFrameX.Core.Abstractions;
using GameFrameX.Core.Components;

namespace GameFrameX.Apps.Server.Heart.Component;

Expand Down
1 change: 1 addition & 0 deletions GameFrameX.Apps/Server/Server/Component/ServerComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GameFrameX.Apps.Server.Server.Entity;
using GameFrameX.Core.Abstractions;
using GameFrameX.Core.Components;

namespace GameFrameX.Apps.Server.Server.Component
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GameFrameX.Core.Abstractions;
using GameFrameX.Core.Abstractions.Agent;
using GameFrameX.Core.Abstractions.Events;

namespace GameFrameX.Hotfix.Common.Events
{
Expand Down
3 changes: 2 additions & 1 deletion GameFrameX.Hotfix/Common/HotfixBridge.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GameFrameX.Hotfix.StartUp;
using GameFrameX.Core.Components;
using GameFrameX.Hotfix.StartUp;
using GameFrameX.Launcher;
using GameFrameX.Launcher.Common.Session;
using GameFrameX.NetWork.HTTP;
Expand Down
1 change: 0 additions & 1 deletion GameFrameX.Hotfix/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
global using GameFrameX.Core;
global using GameFrameX.Log;
global using GameFrameX.Core.Utility;
global using GameFrameX.Core.Comps;
global using GameFrameX.Core.Events;
global using GameFrameX.Core.Hotfix.Agent;
global using GameFrameX.Core.Hotfix;
Expand Down
4 changes: 2 additions & 2 deletions GameFrameX.Hotfix/Logic/Account/Login/LoginComponentAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ public async Task OnLogin(INetWorkChannel workChannel, ReqLogin reqLogin)


var loginCompAgent = await ActorManager.GetComponentAgent<LoginComponentAgent>();
var loginState = await loginCompAgent.Comp.OnLogin(reqLogin);
var loginState = await loginCompAgent.OwnerComponent.OnLogin(reqLogin);
if (loginState == null)
{
var accountId = IdGenerator.GetActorId(ActorType.Account);
loginState = await loginCompAgent.Comp.Register(accountId, reqLogin);
loginState = await loginCompAgent.OwnerComponent.Register(accountId, reqLogin);
}

//添加到session
Expand Down
2 changes: 1 addition & 1 deletion GameFrameX.Hotfix/Logic/Account/Login/ReqLoginHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameFrameX.Core.Net.BaseHandler;
using GameFrameX.Core.BaseHandler;
using GameFrameX.NetWork.Messages;

namespace GameFrameX.Hotfix.Logic.Account.Login
Expand Down
2 changes: 1 addition & 1 deletion GameFrameX.Hotfix/Logic/Role/Bag/ReqBagInfoHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameFrameX.Core.Net.BaseHandler;
using GameFrameX.Core.BaseHandler;
using GameFrameX.NetWork.Messages;

namespace GameFrameX.Hotfix.Logic.Role.Bag
Expand Down
2 changes: 1 addition & 1 deletion GameFrameX.Hotfix/Logic/Role/Bag/ReqComposePetHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameFrameX.Core.Net.BaseHandler;
using GameFrameX.Core.BaseHandler;
using GameFrameX.NetWork.Messages;

namespace GameFrameX.Hotfix.Logic.Role.Bag
Expand Down
7 changes: 4 additions & 3 deletions GameFrameX.Hotfix/Logic/Role/Login/PlayerComponentAgent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GameFrameX.Apps.Player.Player.Component;
using GameFrameX.Apps.Player.Player.Entity;
using GameFrameX.Core.Abstractions.Events;
using GameFrameX.Hotfix.Logic.Server.Server;
using GameFrameX.Launcher.Common.Session;
using GameFrameX.NetWork;
Expand Down Expand Up @@ -35,7 +36,7 @@ public async Task OnLogout()
/// <param name="reqLogin"></param>
public async Task OnLogin(INetWorkChannel workChannel, ReqPlayerLogin reqLogin)
{
var playerState = await Comp.OnLogin(reqLogin);
var playerState = await OwnerComponent.OnLogin(reqLogin);
if (playerState == null)
{
//角色找不到?
Expand Down Expand Up @@ -78,7 +79,7 @@ public async Task OnLogin(INetWorkChannel workChannel, ReqPlayerLogin reqLogin)
/// <param name="reqPlayerCreate"></param>
public async Task OnPlayerCreate(INetWorkChannel workChannel, ReqPlayerCreate reqPlayerCreate)
{
var playerState = await Comp.OnPlayerCreate(reqPlayerCreate);
var playerState = await OwnerComponent.OnPlayerCreate(reqPlayerCreate);
RespPlayerCreate respPlayerCreate = new RespPlayerCreate
{
UniqueId = reqPlayerCreate.UniqueId,
Expand All @@ -101,7 +102,7 @@ public async Task OnPlayerCreate(INetWorkChannel workChannel, ReqPlayerCreate re
/// <param name="reqPlayerList"></param>
public async Task OnGetPlayerList(INetWorkChannel workChannel, ReqPlayerList reqPlayerList)
{
var playerList = await this.Comp.GetPlayerList(reqPlayerList);
var playerList = await this.OwnerComponent.GetPlayerList(reqPlayerList);

RespPlayerList respPlayerList = new RespPlayerList
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameFrameX.Core.Net.BaseHandler;
using GameFrameX.Core.BaseHandler;
using GameFrameX.NetWork.Messages;

namespace GameFrameX.Hotfix.Logic.Role.Login;
Expand Down
2 changes: 1 addition & 1 deletion GameFrameX.Hotfix/Logic/Role/Login/ReqPlayerListHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameFrameX.Core.Net.BaseHandler;
using GameFrameX.Core.BaseHandler;
using GameFrameX.NetWork.Messages;

namespace GameFrameX.Hotfix.Logic.Role.Login;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameFrameX.Core.Net.BaseHandler;
using GameFrameX.Core.BaseHandler;
using GameFrameX.NetWork.Messages;

namespace GameFrameX.Hotfix.Logic.Role.Login
Expand Down
1 change: 1 addition & 0 deletions GameFrameX.Hotfix/Logic/Role/Pet/PetComponentAgent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using GameFrameX.Apps.Player.Role.Pet.Component;
using GameFrameX.Apps.Player.Role.Pet.Entity;
using GameFrameX.Core.Abstractions.Events;
using GameFrameX.Hotfix.Logic.Server.Server;

namespace GameFrameX.Hotfix.Logic.Role.Pet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameFrameX.Core.Net.BaseHandler;
using GameFrameX.Core.BaseHandler;
using GameFrameX.NetWork.Messages;

namespace GameFrameX.Hotfix.Logic.Server.Heart;
Expand Down
8 changes: 4 additions & 4 deletions GameFrameX.Hotfix/Logic/Server/Server/ServerComponentAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ public override void Active()
[Discard]
public virtual ValueTask AddOnlineRole(long roleId)
{
Comp.OnlineSet.Add(roleId);
OwnerComponent.OnlineSet.Add(roleId);
return ValueTask.CompletedTask;
}

[Service]
[Discard]
public virtual ValueTask RemoveOnlineRole(long roleId)
{
Comp.OnlineSet.Remove(roleId);
OwnerComponent.OnlineSet.Remove(roleId);
return ValueTask.CompletedTask;
}

Expand All @@ -67,7 +67,7 @@ public static async Task OnlineRoleForeach(Action<PlayerComponentAgent> func)
var serverComp = await ActorManager.GetComponentAgent<ServerComponentAgent>();
serverComp.Tell(async () =>
{
foreach (var roleId in serverComp.Comp.OnlineSet)
foreach (var roleId in serverComp.OwnerComponent.OnlineSet)
{
var roleComp = await ActorManager.GetComponentAgent<PlayerComponentAgent>(roleId);
roleComp.Tell(() => func(roleComp));
Expand Down Expand Up @@ -117,7 +117,7 @@ public virtual Task<int> GetWorldLevel()
[Service]
public virtual Task<bool> IsOnline(long roleId)
{
foreach (var id in Comp.OnlineSet)
foreach (var id in OwnerComponent.OnlineSet)
{
if (id == roleId)
return Task.FromResult(true);
Expand Down
3 changes: 2 additions & 1 deletion GameFrameX.Launcher/Common/Event/EventAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GameFrameX.Core.Events;
using GameFrameX.Core.Abstractions.Events;
using GameFrameX.Core.Events;

namespace GameFrameX.Launcher.Common.Event
{
Expand Down
1 change: 0 additions & 1 deletion GameFrameX.Launcher/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
global using GameFrameX.Apps;
global using GameFrameX.Config;
global using GameFrameX.Core.Actors.Impl;
global using GameFrameX.Core.Comps;
global using GameFrameX.Core.Hotfix;
global using GameFrameX.StartUp;
global using GameFrameX.DataBase;
Expand Down
3 changes: 2 additions & 1 deletion GameFrameX.Launcher/StartUp/Game/AppStartUpGame.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GameFrameX.DataBase.Mongo;
using GameFrameX.Core.Components;
using GameFrameX.DataBase.Mongo;

namespace GameFrameX.Launcher.StartUp.Game
{
Expand Down

0 comments on commit 962c2ed

Please sign in to comment.