Jump to content

akka

Members
  • Content Count

    8
  • Joined

  • Last visited

Posts posted by akka


  1. Hi my plugin project has grown into a huge inconvenient file, so i tried to split it into a number of files. For example i created atcommands.c and atcommands.h

     

     

     

    atcommands.h:

    struct atcommands_interface {	bool (*atcommand_test) (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info);};struct atcommands_interface *atcommands;

    atcommands.c

    ACMD(test){//testreturn true}

    Then in the "main" plugin file with the HPExport functions put this:

    /* HPMi->addCommand */#define addAtcommand2(cname,funcname) 	if ( HPMi->addCommand != NULL ) { 		HPMi->addCommand(cname,funcname); 	} else { 		ShowWarning("HPM (%s):addAtcommand("%s",%s) failed, addCommand sub is NULL!n",pinfo.name,cname,# funcname);	}

    Because the original HPMi->addCommand adds "atcommand_" to the beginning of the atcommand name inorder to call it.

     

    and then i just add this as usual:

    addAtcommand2("test", atcommands->atcommand_test);

    It all compiles just fine, but the map server crashes and I guess its due to missing symbols. Is what im trying to do even possible? I've looked at numerous plugins but all of 'em seems to consist of a .c file and not header files.


  2. I originally posted this in the HPM datacheck announcement thread, but i didn't get an answer. So im just wondering if anyone else is experiencing this problem. 

     

    The problem started yesterday after I updated my server to get access to the new datacheck feature, It all went very smooth and  I compiled it as usual without any errors. I might add that i added:

    #include "../common/HPMDataCheck.h"

    and made sure that it was the last included file:

    http://imgur.com/UNqeg4T

    But when i tried to run my server i got the following errors:

     

    [Warning]: HPM:plugin_load: failed to retrieve 'HPMDataCheckLen' for plugin/HPMHooking.dll, most likely not including HPMDataCheck.h, skipping...[Warning]: HPM:plugin_load: failed to retrieve 'HPMDataCheckLen' for plugin/custom_plugin.dll, most likely not including HPMDataCheck.h, skipping... 

     

    So I checked the code again. I checked both my custom plugin and HPMHooking, and HPMDataCheck.h was indeed included in both of 'em.

     

    When i compiled i used Microsoft Visual Studio Express 2013 and the Hercules-12.sln solution and the server is running Windows. I later tried a build of the latest fresh Hercules and it gave me the same result when I uncommented HPMHooking in confplugins.conf. Am I doing something terribly wrong? or whats really going on?  :wacko:  :unsure:


  3. I don't really know if this is the right place to post this, but im having some issues with this feature. Yesterday i updated my server and compiled it as usual without any errors. I might add that i added :

    #include "../common/HPMDataCheck.h"

    and made sure that it was the last included file:

    http://imgur.com/UNqeg4T

    But when i tried to run my server i got the following errors:

    [Warning]: HPM:plugin_load: failed to retrieve 'HPMDataCheckLen' for plugin/HPMHooking.dll, most likely not including HPMDataCheck.h, skipping...[Warning]: HPM:plugin_load: failed to retrieve 'HPMDataCheckLen' for plugin/custom_plugin.dll, most likely not including HPMDataCheck.h, skipping...

    So I checked the code again. I checked both my custom plugin and HPMHooking, and HPMDataCheck.h was indeed included in both of 'em.

     

    When i compiled i used Microsoft Visual Studio Express 2013 and the Hercules-12.sln solution.

     

    Edit: I tried the latest fresh Hercules and it gave me the same result when I uncommented HPMHooking in confplugins.conf. Am I doing something terribly wrong? S:

     

    Edit2; https://github.com/HerculesWS/Hercules/commit/10c160a3317b63a8c59830f836b5adefb788e652 solved it.


  4. Hi, i've been trying to figure out how to check if there is a player near a mob. Here is the code im at right now:

     

    int pc_isnear_sub(struct block_list *bl, va_list args){ int* isnear = va_arg(args, int*); struct map_session_data *sd = (struct map_session_data *)bl; if (sd->sc.data[SC_TRICKDEAD] ||        sd->sc.data[SC_HIDING] ||        sd->sc.data[SC_CLOAKING] ||        pc_isinvisible(sd) ||        sd->vd.class_ == INVISIBLE_CLASS ||        pc_isdead(sd))    {        return 0;    }    else{        *isnear++;    }    return 1;}int pc_isnear_mob(struct mob_data *md) {    int *isnear = 0;    //map->foreachinarea(pc_isnear_sub, md->bl.m, md->bl.x - AREA_SIZE, md->bl.y - AREA_SIZE, md->bl.x + AREA_SIZE, md->bl.y + AREA_SIZE, BL_PC,isnear, isnear);    map->foreachinrange((pc_isnear_sub), &md->bl, AREA_SIZE, BL_PC, isnear);    if (isnear > 0){        return true;    }    return false;}

    But it seems like pc_isnear_sub isn't even being called, can anyone tell me what im doing wrong? :/

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.