2.0.0 Plugins/KosAcid Projects/Plugin Ports
-
Well, im back, and tried VS2008E, it works……i mean it can use to compile…but…It’s give me a bad result…
I have commented out my codes from source file, and just keep following code still:
#include <iostream>#include <sstream>#include <string>#include "../flhookplugin_sdk/headers/FLHook.h" #include "../flhookplugin_sdk/headers/plugin.h" #include "header.h" PLUGIN_RETURNCODE returncode; EXPORT PLUGIN_RETURNCODE Get_PluginReturnCode() { return returncode; } EXPORT void LoadSettings() { returncode = DEFAULT_RETURNCODE; } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if(fdwReason == DLL_PROCESS_ATTACH) LoadSettings(); return true; } EXPORT PLUGIN_INFO* Get_PluginInfo() { PLUGIN_INFO* p_PI = new PLUGIN_INFO(); p_PI->sName = "Banner Plugin By NeXoSE"; p_PI->sShortName = "banners"; p_PI->bMayPause = false; p_PI->bMayUnload = false; p_PI->ePluginReturnCode = &returncode; return p_PI; }</string></sstream></iostream>
And the header.h has been totally commented out.
But, when i compiled(with debug mode) and moved my banners.dll file to flhook_plugins and fire up the FLServer, it gives me a Runtime Error: Abnormal program termination……
I don’t know what’s wrong with it…
My project file is base on the condata plugin’s vcproj file, but seems condata will not have those problem.
How to solve this problem? Please help.
-
8-[….]
Wait you have not [zone] section at li01.ini like[zone]
nickname = Zone_Li01_Manhattan_death
pos = -33270, 0, -33039
shape = SPHERE
size = 4100
damage = 2000000
sort = 99.500000
density = 0
relief_time = 0
population_additive = false?
-
Mirkha wrote:
sorry but i think i don’t understand :-?every file is unencrypted and they don’t have a “[zone]” section
do you mean that i need to add it to each file ? and with wich parameter(s) ?Freelancer SDK will solve it!
-
HeIIoween wrote:
@Nexose recompile than hook under VS2008E too.I got another runtime error using recompiled FLHook:
Debug Assertion Failed!
Programs: PATH_TO_FL
File: f:\dd\vctools\……crt\src\memcpy_s.c
Line: 61Expression: src != NULL
Any idea please?
Here is parameters for compiler:
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "BANNERSPLUGIN_EXPORTS" /D "_VC80_UPGRADE=0x0710" /D "_WINDLL" /D "_MBCS" /Gm /EHa /RTC1 /MDd /Zc:wchar_t- /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt /OUT:"Debug/banners.dll" /INCREMENTAL /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"Debug\banners.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"Debug/banners.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /IMPLIB:"Debug/banners.lib" /MACHINE:X86 /ERRORREPORT:PROMPT ../flhookplugin_sdk/libs/FLHook.lib ../flhookplugin_sdk/libs/FLCoreServer.lib ../flhookplugin_sdk/libs/FLCoreCommon.lib ../flhookplugin_sdk/libs/FLCoreRemoteClient.lib ../flhookplugin_sdk/libs/FLCoreDALib.lib ../flhookplugin_sdk/libs/FLCoreFLServerEXE.lib ../flhookplugin_sdk/libs/FLCoreDACom.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
-
Try with the last platform sdk from ms, switch from debug configuration to active (Release)
-
Look at crash offset
-
HeIIoween wrote:
Look at crash offsetOK…It’s not crash and runtime erroring at Release config so far…BUT…i got problem when enter /help in game.
Here is code…i just copy it condata plugin…:
typedef void (*_UserCmdProc)(uint, const wstring &); struct USERCMD { wchar_t *wszCmd; _UserCmdProc proc; }; USERCMD UserCmds[] = { { L"/buyslot", UserCmd_BuySlot}, }; EXPORT bool UserCmd_Process(uint iClientID, const wstring &wscCmd) { wstring wscCmdLower = ToLower(wscCmd); for(uint i = 0; (i < sizeof(UserCmds)/sizeof(USERCMD)); i++) { if(wscCmdLower.find(ToLower(UserCmds[i].wszCmd)) == 0) { wstring wscParam = L""; if(wscCmd.length() > wcslen(UserCmds[i].wszCmd)) { if(wscCmd[wcslen(UserCmds[i].wszCmd)] != ' ') continue; wscParam = wscCmd.substr(wcslen(UserCmds[i].wszCmd) + 1); } UserCmds[i].proc(iClientID, wscParam); returncode = SKIPPLUGINS_NOFUNCTIONCALL; // we handled the command, return immediatly return true; } } returncode = DEFAULT_RETURNCODE; // we did not handle the command, so let other plugins or FLHook kick in return false; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// EXPORT void UserCmd_Help(uint iClientID, wstring wscParam) { PrintUserCmdText(iClientID, L"/buyad"); } EXPORT bool ExecuteCommandString_Callback(CCmds* classptr, const wstring &wscCmd) { returncode = DEFAULT_RETURNCODE; return false; } EXPORT void Plugin_Communication_CallBack(PLUGIN_MESSAGE msg, void* data) { returncode = DEFAULT_RETURNCODE; return; } p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&UserCmd_Process, PLUGIN_UserCmd_Process, 0)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&UserCmd_Help, PLUGIN_UserCmd_Help, 0)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&LoadSettings, PLUGIN_LoadSettings, 0)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&Plugin_Communication_CallBack, PLUGIN_Plugin_Communication, 0)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&ExecuteCommandString_Callback, PLUGIN_ExecuteCommandString_Callback, 0)); /buyslot is works good, problem just happen when i enter /help in chat. FLServer will crash after that, and in game, the red connection warning will showup, then after few sec, the /help list shows up, but FLServer already crashed.. Here is demo for the bug: [flash]http://player.youku.com/player.php/sid/XMzE2NzI2NjI4/v.swf[/flash][/i][/i][/i][/i]
-
Try
EXPORT void UserCmd_Help(uint iClientID, const wstring &wscParam) { PrintUserCmdText(iClientID, L"/buyad"); }
P.S. Wow nice mod!
-
Another problem.
Seems there is two FLHook 2.0, one i checked out from TSP SVN, file size 619KB, other one from KosAcid’s repository on SF.net, file size 651KB.
After test…. i think this two version is incompatible… i mean it’s not load each other’s plugin… anybody looked in to it?
I the plugins i used for test, so you can check it yourself.
-
Svn version compiled under 2008 i think, and at Sf.net under 2010.
Install also vc10 x86 redist and vc9 x86 redist then. -
It’s strange, i have VC9E and VC10E installed on my computer, so the redist runtime lib must also installed. but i still cannot make plugins running in both two FLHook in same time.
But… FLHook is not supported vc10 to compile for now right? I failed to use those 2.0 plugin on.
-
Ok, tell me final target of your dance with FLHooks to make clear vision of a problem
-
For vc10 there is small workaround http://forge.the-starport.net/issues/159#note-4 - it is not recommended by W0dk4 but for vc10 plugins it works well.
I do not see any problems yet with vc10 plugins which i’ve ported and choosed from KosAcids repo so while i’m using only vc10 hook and all works well