提交 97f8dc7d 编写于 作者: T tanghai

加入断线处理,断线后的玩家不在一直发送战斗消息

上级 75e20ae3
......@@ -2,12 +2,20 @@
<s:String x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/NonCompletingCharacters/@EntryValue"></s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Fd_003ABase_002Fd_003AObject_002Ff_003AComponentWithId_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Fd_003ABase_002Fd_003AObject_002Ff_003AEntity_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Fd_003AEntity_002Fd_003AConfig_002Ff_003AUnitConfig_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Fd_003AEntity_002Ff_003AGame_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Fd_003AModule_002Fd_003AConfig_002Ff_003AConfigComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Fd_003AModule_002Fd_003AUI_002Ff_003AUI_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Fd_003AModule_002Fd_003AUI_002Ff_003AUIComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Fd_003AUI_002Fd_003AUILogin_002Fd_003AEvent_002Ff_003AInitSceneStart_005FCreateLoginUI_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=40533600_002D4E69_002D4F7D_002DA924_002DE1A3B4127255_002Ff_003AInit_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AC2G_005FEnterMapHandler_002Ecs_002Fl_003AServer_003FHotfix_003FHandler_003FC2G_005FEnterMapHandler_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AInnerOpcode_002Ecs_002Fl_003AServer_003FModel_003FEntity_003FMessage_003FInnerOpcode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APlayer_002Ecs_002Fl_003AUnity_003FAssets_003FScripts_003FEntity_003FPlayer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APlayerComponent_002Ecs_002Fl_003AUnity_003FAssets_003FScripts_003FComponent_003FPlayerComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APlayerFactory_002Ecs_002Fl_003AUnity_003FAssets_003FScripts_003FFactory_003FPlayerFactory_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUnitComponent_002Ecs_002Fl_003AUnity_003FAssets_003FScripts_003FComponent_003FUnitComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=C305ED5B_002D8425_002D47A1_002DBEE1_002D85830CADC27A_002Fd_003AModule_002Fd_003ABenchmark_002Ff_003ABenchmarkComponentSystem_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003ABase_002Fd_003AObject_002Ff_003AComponent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003ABase_002Fd_003AObject_002Ff_003AComponentWithId_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003ABase_002Fd_003AObject_002Ff_003AEntity_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
......@@ -16,9 +24,12 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003ABase_002Fd_003AObject_002Ff_003AObjectPool_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003AComponent_002Fd_003AConfig_002Ff_003AClientConfig_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003AComponent_002Fd_003AConfig_002Ff_003AInnerConfig_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003AEntity_002Ff_003AHotfix_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003AModule_002Fd_003AMessage_002Fd_003ANetwork_002Fd_003ATCP_002Ff_003ATChannel_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003AModule_002Fd_003AMessage_002Fd_003ANetwork_002Fd_003ATCP_002Ff_003ATService_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003AModule_002Fd_003AMessage_002Fd_003ANetwork_002Ff_003AAChannel_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AScripts_002Fd_003AModule_002Fd_003AMessage_002Ff_003AErrorCode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=CF118143_002D7E37_002D744F_002DBE45_002D3F55345FEC40_002Fd_003AAssets_002Fd_003AThirdParty_002Fd_003AILRuntime_002Fd_003AILRuntime_002Fd_003ARuntime_002Fd_003AIntepreter_002Ff_003AILIntepreter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=EE38E3D2_002D3D2A_002D4061_002DBD50_002DAE8568126C7D_002Fd_003ABase_002Fd_003AObject_002Ff_003AEntityType_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=EE38E3D2_002D3D2A_002D4061_002DBD50_002DAE8568126C7D_002Fd_003AEntity_002Fd_003AConfig_002Ff_003AStartConfig_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=EE38E3D2_002D3D2A_002D4061_002DBD50_002DAE8568126C7D_002Fd_003AModule_002Fd_003AMessage_002Ff_003AAMRpcHandler_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
......
......@@ -171,4 +171,8 @@
required int64 UnitId = 1;
required int Count = 2;
}
message G2M_SessionDisconnect // IActorMessage
{
}
}
\ No newline at end of file
using System.Threading.Tasks;
using ETModel;
namespace ETHotfix
{
[ActorMessageHandler(AppType.Map)]
public class G2M_SessionDisconnectHandler : AMActorHandler<Unit, G2M_SessionDisconnect>
{
protected override async Task Run(Unit unit, G2M_SessionDisconnect message)
{
unit.GetComponent<UnitGateComponent>().IsDisconnect = true;
await Task.CompletedTask;
}
}
}
\ No newline at end of file
......@@ -10,8 +10,13 @@ namespace ETHotfix
ActorMessageSenderComponent actorMessageSenderComponent = Game.Scene.GetComponent<ActorMessageSenderComponent>();
foreach (Unit unit in units)
{
long gateSessionActorId = unit.GetComponent<UnitGateComponent>().GateSessionActorId;
actorMessageSenderComponent.GetWithActorId(gateSessionActorId).Send(message);
UnitGateComponent unitGateComponent = unit.GetComponent<UnitGateComponent>();
if (unitGateComponent.IsDisconnect)
{
continue;
}
actorMessageSenderComponent.GetWithActorId(unitGateComponent.GateSessionActorId).Send(message);
}
}
}
......
using ETModel;
namespace ETHotfix
{
[ObjectSystem]
public class SessionPlayerComponentDestroySystem : DestroySystem<SessionPlayerComponent>
{
public override void Destroy(SessionPlayerComponent self)
{
// 发送断线消息
ActorMessageSender actorMessageSender = Game.Scene.GetComponent<ActorMessageSenderComponent>().Get(self.Player.UnitId);
actorMessageSender.Send(new G2M_SessionDisconnect());
Game.Scene.GetComponent<PlayerComponent>()?.Remove(self.Player.Id);
}
}
}
\ No newline at end of file
......@@ -511,4 +511,16 @@ namespace ETHotfix
}
[Message(InnerOpcode.G2M_SessionDisconnect)]
[ProtoContract]
public partial class G2M_SessionDisconnect: IActorMessage
{
[ProtoMember(90, IsRequired = true)]
public int RpcId { get; set; }
[ProtoMember(93, IsRequired = true)]
public long ActorId { get; set; }
}
}
......@@ -34,5 +34,6 @@ namespace ETHotfix
public const ushort G2R_GetLoginKey = 1030;
public const ushort G2M_CreateUnit = 1031;
public const ushort M2G_CreateUnit = 1032;
public const ushort G2M_SessionDisconnect = 1033;
}
}
......@@ -3,17 +3,5 @@
public class SessionPlayerComponent : Component
{
public Player Player;
public override void Dispose()
{
if (this.IsDisposed)
{
return;
}
base.Dispose();
Game.Scene.GetComponent<PlayerComponent>()?.Remove(this.Player.Id);
}
}
}
\ No newline at end of file
......@@ -13,6 +13,8 @@
{
public long GateSessionActorId;
public bool IsDisconnect;
public void Awake(long gateSessionId)
{
this.GateSessionActorId = gateSessionId;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册