Various improvements
This commit is contained in:
@@ -18,3 +18,8 @@ public:
|
||||
API_FIELD()
|
||||
uint32 ConnectionId;
|
||||
};
|
||||
|
||||
inline bool operator==(const NetworkConnection& a, const NetworkConnection& b)
|
||||
{
|
||||
return a.ConnectionId == b.ConnectionId;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ bool NetworkPeer::Initialize(const NetworkConfig& config)
|
||||
return true;
|
||||
}
|
||||
|
||||
LOG(Info, "NetworkManager initialized using driver = {0}", NetworkDriver->DriverName());
|
||||
LOG(Info, "NetworkPeer initialized using driver = {0}", NetworkDriver->DriverName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void NetworkPeer::DisposeMessageBuffers()
|
||||
|
||||
bool NetworkPeer::Listen()
|
||||
{
|
||||
LOG(Info, "NetworkManager starting to listen on address = {0}:{1}", Config.Address, Config.Port);
|
||||
LOG(Info, "Starting to listen on address = {0}:{1}", Config.Address, Config.Port);
|
||||
return NetworkDriver->Listen();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
API_CLASS(sealed, NoSpawn, Namespace = "FlaxEngine.Networking") class FLAXENGINE_API NetworkPeer final : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(NetworkPeer);
|
||||
friend class NetworkManager;
|
||||
public:
|
||||
int HostId = -1;
|
||||
NetworkConfig Config;
|
||||
|
||||
@@ -359,6 +359,22 @@ Plugin* PluginManager::GetPlugin(const MClass* type)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Plugin* PluginManager::GetPlugin(const ScriptingTypeHandle& type)
|
||||
{
|
||||
CHECK_RETURN(type, nullptr);
|
||||
for (Plugin* p : EditorPlugins)
|
||||
{
|
||||
if (p->Is(type))
|
||||
return p;
|
||||
}
|
||||
for (GamePlugin* gp : GamePlugins)
|
||||
{
|
||||
if (gp->Is(type))
|
||||
return gp;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
void PluginManager::InitializeGamePlugins()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// <summary>
|
||||
/// Game and Editor plugins management service.
|
||||
/// </summary>
|
||||
API_CLASS(Static) class PluginManager
|
||||
API_CLASS(Static) class FLAXENGINE_API PluginManager
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(PluginManager);
|
||||
public:
|
||||
@@ -62,6 +62,13 @@ public:
|
||||
/// <returns>The plugin or null.</returns>
|
||||
API_FUNCTION() static Plugin* GetPlugin(API_PARAM(Attributes="TypeReference(typeof(Plugin))") const MClass* type);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first plugin of the provided type.
|
||||
/// </summary>
|
||||
/// <param name="type">Type of the plugin to search for. Includes any plugin base class derived from the type.</param>
|
||||
/// <returns>The plugin or null.</returns>
|
||||
static Plugin* GetPlugin(const ScriptingTypeHandle& type);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first plugin of the provided type.
|
||||
/// </summary>
|
||||
@@ -69,7 +76,7 @@ public:
|
||||
template<typename T>
|
||||
FORCE_INLINE static T* GetPlugin()
|
||||
{
|
||||
return (T*)GetPlugin(T::GetStaticClass());
|
||||
return (T*)GetPlugin(T::TypeInitializer);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user