Skip to content

Commit

Permalink
调整一下不合理的代码
Browse files Browse the repository at this point in the history
  • Loading branch information
egametang committed Dec 14, 2023
1 parent e1b1405 commit 9d22065
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@ protected override async ETTask Run(Scene root, Main2NetClient_Login request, Ne
// 创建一个ETModel层的Session
root.RemoveComponent<RouterAddressComponent>();
// 获取路由跟realmDispatcher地址
RouterAddressComponent routerAddressComponent = root.GetComponent<RouterAddressComponent>();
if (routerAddressComponent == null)
{
routerAddressComponent =
root.AddComponent<RouterAddressComponent, string, int>(ConstValue.RouterHttpHost, ConstValue.RouterHttpPort);
await routerAddressComponent.Init();
root.AddComponent<NetComponent, AddressFamily, NetworkProtocol>(routerAddressComponent.RouterManagerIPAddress.AddressFamily, NetworkProtocol.UDP);
root.GetComponent<FiberParentComponent>().ParentFiberId = request.OwnerFiberId;
}
RouterAddressComponent routerAddressComponent =
root.AddComponent<RouterAddressComponent, string, int>(ConstValue.RouterHttpHost, ConstValue.RouterHttpPort);
await routerAddressComponent.Init();
root.AddComponent<NetComponent, AddressFamily, NetworkProtocol>(routerAddressComponent.RouterManagerIPAddress.AddressFamily, NetworkProtocol.UDP);
root.GetComponent<FiberParentComponent>().ParentFiberId = request.OwnerFiberId;

NetComponent netComponent = root.GetComponent<NetComponent>();

Expand Down

0 comments on commit 9d22065

Please sign in to comment.