Added missing constructor for NetChannel in NetServerCh.

This commit is contained in:
Karutoh 2025-01-28 04:28:55 -08:00
parent 981b40d3b1
commit 39bbcd0d56
2 changed files with 21 additions and 5 deletions

View File

@ -17,7 +17,9 @@ namespace ehs
public:
~NetServerCh() override;
NetServerCh(UInt_64 maxEndpoints = 0);
NetServerCh();
NetServerCh(Str_8 name, const Version &version, UInt_64 maxEndpoints);
NetServerCh(NetServerCh &&server) noexcept;

View File

@ -11,20 +11,25 @@ namespace ehs
Shutdown();
}
NetServerCh::NetServerCh(const UInt_64 maxEndpoints)
: maxEndpoints(maxEndpoints)
NetServerCh::NetServerCh()
: maxEndpoints(0)
{
}
NetServerCh::NetServerCh(Str_8 name, const Version &version, const UInt_64 maxEndpoints)
: NetChannel((Str_8 &&)name, version), maxEndpoints(maxEndpoints)
{
}
NetServerCh::NetServerCh(NetServerCh &&server) noexcept
: endpoints((Vector<NetEnd *> &&)server.endpoints), maxEndpoints(server.maxEndpoints)
: NetChannel((NetChannel &&)server), endpoints((Vector<NetEnd *> &&)server.endpoints), maxEndpoints(server.maxEndpoints)
{
for (UInt_64 i = 0; i < endpoints.Size(); i++)
endpoints[i]->owner = this;
}
NetServerCh::NetServerCh(const NetServerCh &server)
: maxEndpoints(server.maxEndpoints)
: NetChannel(server), maxEndpoints(server.maxEndpoints)
{
}
@ -33,6 +38,8 @@ namespace ehs
if (this == &server)
return *this;
NetChannel::operator=((NetChannel &&)server);
Shutdown();
endpoints = (Vector<NetEnd *> &&)server.endpoints;
@ -51,6 +58,8 @@ namespace ehs
if (this == &server)
return *this;
NetChannel::operator=(server);
Shutdown();
endpoints = {};
@ -81,6 +90,11 @@ namespace ehs
{
}
Serializer<UInt_64> NetServerCh::OnShutdown()
{
return {};
}
Serializer<UInt_64> OnShutdown()
{
return {};