ketoo / NoahGameFrame

A fast, scalable, distributed game server engine/framework for C++, include the actor library, network library, can be used as a real time multiplayer game engine ( MMO RPG/MOBA ), which support C#/Lua script/ Unity3d, Cocos2dx and plan to support Unreal.
https://github.com/ketoo/NoahGameFrame/wiki
Apache License 2.0
3.97k stars 1.09k forks source link

重复添加module的问题 #264

Closed 908760230 closed 4 years ago

908760230 commented 4 years ago

头文件: NFIPluginManager.h line: 173

template <typename T>
void ReplaceModule(NFIModule* pModule)
{
        NFIModule* pLogicModule = FindModule(typeid(T).name());
        if (pLogicModule)

        {
            RemoveModule(typeid(T).name());
        }

        AddModule(typeid(T).name(), pModule);
};

FindModule内有对字符串进行处理, typeid.name()的返回值有多余字符。 因为 FindModule 和 AddModule 的字符串不一致,所以会出现再次添加 已存在module 的情况

ketoo commented 4 years ago

The same issue with the Component's name for Actor.

ketoo commented 4 years ago

https://github.com/ketoo/NoahGameFrame/commit/90f9c91083eb888d54e668a2a56b25fe96668e52