You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
841 B
36 lines
841 B
|
7 years ago
|
#include "dvlnet/abstract_net.h"
|
||
|
|
|
||
|
5 years ago
|
#include "utils/stubs.h"
|
||
|
7 years ago
|
#ifndef NONET
|
||
|
6 years ago
|
#include "dvlnet/cdwrap.h"
|
||
|
7 years ago
|
#include "dvlnet/tcp_client.h"
|
||
|
5 years ago
|
#include "dvlnet/base_protocol.h"
|
||
|
|
#include "dvlnet/protocol_zt.h"
|
||
|
7 years ago
|
#endif
|
||
|
7 years ago
|
#include "dvlnet/loopback.h"
|
||
|
5 years ago
|
#include "storm/storm.h"
|
||
|
7 years ago
|
|
||
|
5 years ago
|
namespace devilution {
|
||
|
7 years ago
|
namespace net {
|
||
|
|
|
||
|
|
std::unique_ptr<abstract_net> abstract_net::make_net(provider_t provider)
|
||
|
|
{
|
||
|
7 years ago
|
#ifdef NONET
|
||
|
|
return std::unique_ptr<abstract_net>(new loopback);
|
||
|
|
#else
|
||
|
7 years ago
|
switch (provider) {
|
||
|
|
case SELCONN_TCP:
|
||
|
6 years ago
|
return std::unique_ptr<abstract_net>(new cdwrap<tcp_client>);
|
||
|
5 years ago
|
case SELCONN_ZT:
|
||
|
|
return std::unique_ptr<abstract_net>(new cdwrap<base_protocol<protocol_zt>>);
|
||
|
7 years ago
|
case SELCONN_LOOPBACK:
|
||
|
7 years ago
|
return std::unique_ptr<abstract_net>(new loopback);
|
||
|
7 years ago
|
default:
|
||
|
7 years ago
|
ABORT();
|
||
|
|
}
|
||
|
7 years ago
|
#endif
|
||
|
7 years ago
|
}
|
||
|
|
|
||
|
7 years ago
|
} // namespace net
|
||
|
5 years ago
|
} // namespace devilution
|