2.0.0 Plugins/KosAcid Projects/Plugin Ports
-
w0dk4 wrote:
VC10 is unsupported as of now since it has resulted in undefined crashes. Also, the current FLHook source is incompatible with VC10, use VC9 for now.We first need to find out why VC10 FLHook has problems before switching to it completely.
In any way, the FLHook on the forge is still a work in progress. However, I think that when compiled with VC9, it should be pretty much bug free.
Please allow me abreacting a little bit, because i just cost my 5hours to got and install VS2010Express
AhHHHHHHHHHHHHHhhHHHHHHHHHHHHHhhhhHHHHHHHHHHHHHHHHHHHHHHHHHHHHhhhhhhhHHHHahahhhhhhhhhhhhhhhhhaahhhhhhhhhhhhhhhhhhhhhhhhhhHHH
I think it’s done
I just reupdate codes from TSP forge, Revision 157, the readme.txt is really confused me, because it’s written “version: 1.6.2 plugin”, so it’s actually the FLHook 2.0 plugin version right?
So, can i use VS2009Express to compile it? because i got lot’s of error in VS2010E before it tell me it’s fail…
EDIT:
Oh, i forgot one thing i also want to ask.
If i rework my plugin with lastest flhookplugin_sdk, will my plugin still working on FLHook 1.6.1? because few days before another chinese modder wants me update my Banners plugin(works on 1.6.0. And not the sf.net one, my plugin is more complex bit), i want to make it running in last release of FLHook and keep compatible with old FLHook above 1.6.0, is that possible?
-
I think not possible, because
1.6.0 uses hooks at <plugin>.ini file
[Hooks] hook = LoadSettings,0 hook = ClearClientInfo, 0 hook = HkIServerImpl::PlayerLaunch, 0 ; Has to have a priority of one higher than the anti-cheat plugin! hook = HkIServerImpl::MineAsteroid, 11 hook = HkIServerImpl::PlayerLaunch, 0
1.6.1 uses hooks at usually at Main.cpp with the following format:
/** Functions to hook */ EXPORT PLUGIN_INFO* Get_PluginInfo() { PLUGIN_INFO* p_PI = new PLUGIN_INFO(); p_PI->sName = "Mine Control Plugin by cannon"; p_PI->sShortName = "minecontrol"; p_PI->bMayPause = true; p_PI->bMayUnload = true; p_PI->mapHooks.insert(pair<string, int="">("LoadSettings", 0)); p_PI->mapHooks.insert(pair<string, int="">("ClearClientInfo", 0)); p_PI->mapHooks.insert(pair<string, int="">("HkIServerImpl::PlayerLaunch", 0)); p_PI->mapHooks.insert(pair<string, int="">("HkIServerImpl::MineAsteroid", 11)); p_PI->mapHooks.insert(pair<string, int="">("HkIServerImpl::SPMunitionCollision", 0)); p_PI->mapHooks.insert(pair<string, int="">("HkTimerCheckKick", 0)); return p_PI; }</string,></string,></string,></string,></string,></string,>
And 2.0.0 -//-:
/** Functions to hook */ EXPORT PLUGIN_INFO* Get_PluginInfo() { PLUGIN_INFO* p_PI = new PLUGIN_INFO(); p_PI->sName = "Mine Control Plugin by cannon"; p_PI->sShortName = "minecontrol"; p_PI->bMayPause = true; p_PI->bMayUnload = true; p_PI->ePluginReturnCode = &returncode; p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&LoadSettings, PLUGIN_LoadSettings , 0)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&ClearClientInfo, PLUGIN_ClearClientInfo , 0)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&HkIServerImpl::PlayerLaunch, PLUGIN_HkIServerImpl_PlayerLaunch , 0)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&HkIServerImpl::MineAsteroid, PLUGIN_HkIServerImpl_MineAsteroid , 11)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&HkIServerImpl::SPMunitionCollision, PLUGIN_HkIServerImpl_SPMunitionCollision , 0)); p_PI->lstHooks.push_back(PLUGIN_HOOKINFO((FARPROC*)&HkTimerCheckKick, PLUGIN_HkTimerCheckKick , 0)); return p_PI; } ```</plugin>
-
Express works well
-
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!