extern "C"  __declspec(dllexport) void DllStartPlugin(NFIPluginManager* pm)
{
    pPluginManager = pm;

    CREATE_PLUGIN(pm, NFDataBaseNet_ClientPlugin, pPlugin)

};

extern "C" __declspec(dllexport) void DllStopPlugin(NFIPluginManager* pm)
{
    DESTROY_PLUGIN(pm, pPlugin)
};

//////////////////////////////////////////////////////////////////////////

const int NFDataBaseNet_ClientPlugin::GetPluginVersion()
{
    return 0;
}

const std::string NFDataBaseNet_ClientPlugin::GetPluginName()
{
    GET_PLUGIN_NAME(NFDataBaseNet_ClientPlugin)
}

void NFDataBaseNet_ClientPlugin::Install()
{
    SetConsoleTitle("NFDataBaseServer");

    REGISTER_MODULE(pPluginManager, "NFCDataBaseNet_ClientModule", NFCDataBaseNet_ClientModule)
}
예제 #2
0
NF_EXPORT void DllStartPlugin(NFIPluginManager* pm)
{
#if NF_PLATFORM == NF_PLATFORM_WIN
	SetConsoleTitle("NFLoginServer");
#endif
    CREATE_PLUGIN(pm, NFLoginLogicPlugin)

};

NF_EXPORT void DllStopPlugin(NFIPluginManager* pm)
{
    DESTROY_PLUGIN(pm, NFLoginLogicPlugin)
};

#endif
//////////////////////////////////////////////////////////////////////////

const int NFLoginLogicPlugin::GetPluginVersion()
{
    return 0;
}

const std::string NFLoginLogicPlugin::GetPluginName()
{
    GET_PLUGIN_NAME(NFLoginLogicPlugin)
}

void NFLoginLogicPlugin::Install()
{

    REGISTER_MODULE(pPluginManager, NFCLoginLogicModule)

}

void NFLoginLogicPlugin::Uninstall()
{
    UNREGISTER_MODULE(pPluginManager, NFCLoginLogicModule)
}
예제 #3
0
NF_EXPORT void DllStartPlugin(NFIPluginManager* pm)
{
#if NF_PLATFORM == NF_PLATFORM_WIN
    SetConsoleTitle("Tutorial6");
#endif
    CREATE_PLUGIN(pm, Tutorial6Plugin)

};

NF_EXPORT void DllStopPlugin(NFIPluginManager* pm)
{
    DESTROY_PLUGIN(pm, Tutorial6Plugin)
};

#endif
//////////////////////////////////////////////////////////////////////////

const int Tutorial6Plugin::GetPluginVersion()
{
    return 0;
}

const std::string Tutorial6Plugin::GetPluginName()
{
    GET_PLUGIN_NAME(Tutorial6Plugin)
}

void Tutorial6Plugin::Install()
{

    REGISTER_MODULE(pPluginManager, HelloWorld6Module)

}

void Tutorial6Plugin::Uninstall()
{
    UNREGISTER_MODULE(pPluginManager, HelloWorld6Module)
}
예제 #4
0
extern "C" __declspec( dllexport ) void DllStopPlugin( NFIPluginManager* pm )
{
    DESTROY_PLUGIN( pm, NFGameLogicPlugin )
};

#endif
//////////////////////////////////////////////////////////////////////////

const int NFGameLogicPlugin::GetPluginVersion()
{
    return 0;
}

const std::string NFGameLogicPlugin::GetPluginName()
{
    GET_PLUGIN_NAME( NFGameLogicPlugin )
}

void NFGameLogicPlugin::Install()
{

    REGISTER_MODULE( pPluginManager, NFCGameLogicModule )

    REGISTER_MODULE( pPluginManager, NFCBuffModule )
    REGISTER_MODULE( pPluginManager, NFCItemModule )
    REGISTER_MODULE( pPluginManager, NFCPackModule )
    REGISTER_MODULE( pPluginManager, NFCSkillModule )

    REGISTER_MODULE( pPluginManager, NFCRebornItemConsumeProcessModule )
    REGISTER_MODULE( pPluginManager, NFCItemConsumeManagerModule )
    REGISTER_MODULE( pPluginManager, NFCPotionItemConsumeProcessModule )
예제 #5
0
static void on_set_debug(pa_core* c, pa_proplist* p, int debug_sink_id, const char* ext_args)
{
    const char* device_name = pa_proplist_gets(p, PROPLIST_KEY_DEVICE);
    if (!device_name) {
        pa_log_error("device not specific!");
        return;
    }

    int device_id = atoi(device_name);
    pa_sink* sink = NULL;
    pa_source* source = NULL;
    sink = find_sink(c, device_id);

    if (!sink) {
        source = find_source(c, device_id);
    }

    if (!sink && !source) {
        pa_log_error("sink/source of device id %s not found!", device_name);
        return;
    }

    pa_sample_spec ss;
    pa_channel_map map;

    if (sink) {
        ss = sink->sample_spec;
        map = sink->channel_map;
    }
    else {
        ss = source->sample_spec;
        map = source->channel_map;
    }

    if (debug_sink_id == EAUDIO_STREAM_DEVICE_VIRTUALOUPUT_REMOTE) {
        ss.rate = 8000;
        ss.format = PA_SAMPLE_U8;
        ss.channels = 1;
        map.channels = 1;
    }

    char sink_name[64];
    GET_PLUGIN_NAME(sink_name, debug_sink_id);

    pa_module* link_module = NULL;
    const char* str_func = pa_proplist_gets(p, PROPLIST_VALUE_FUNC);
    bool func_on = true;
    if (str_func) {
        func_on = !strcmp(str_func, PROPLIST_VALUE_TRUE);
    }

    if (sink) {
        link_module = sink->module;
    }
    else if (source) {
        link_module = source->module;
    }

    if (func_on) {

        pa_pre_load_func_t f = pa_get_user_data(PA_USER_SINK_PRELOAD_FUNC);
        if (f) {
            f(sink_name, c, &ss, &map, ext_args);
        }

        pa_sink* remote_sink = pa_namereg_get(c, sink_name, PA_NAMEREG_SINK);
        if (!remote_sink) {
            pa_log_error("remote-sink load failed");
            return;
        }

        char args[256] = { 0 };
        char loopback_name[128] = { 0 };
        const char* i_name = NULL;
        const char* o_name = NULL;

        if (sink) {
            i_name = sink->monitor_source->name;
            o_name = remote_sink->name;
        }
        else if (source) {
            i_name = source->name;
            o_name = remote_sink->name;
        }

        pa_snprintf(loopback_name, sizeof(loopback_name), "Loopback(%s->%s)", i_name, o_name);
        pa_snprintf(args, sizeof(args), "name=%s source=%s sink=%s token=%u %s", loopback_name, i_name, o_name, MAGIC_TOKEN_ID, ext_args ? ext_args : "");

        pa_log_info("load-module module-loopback args: %s", args);
        pa_module* m = pa_module_load(c, "module-loopback", args);
        if (!m) {
            pa_log_error("on_set_debug module load err.");
            return;
        }

        if (link_module) {
            pa_proplist_sets(link_module->proplist, PA_PROP_LINK_LOOPBACK_ID, loopback_name);
        }
    }
    else {

        pa_sink* remote_sink = find_sink(c, debug_sink_id);
        if (remote_sink) {
            pa_log_info("unloading remote_sink %d", debug_sink_id);
            pa_module_unload_request(remote_sink->module, true);
        }

    }
}