Jump to content
  • 0

Modifying the source to broadcast party announcements from party booking system


Leeg

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  120
  • Reputation:   44
  • Joined:  11/13/11
  • Last Seen:  

Hello.

 

I'm trying to modify the source to enable a little announcement to the whole server each time a new party is added to the party booking system. However, I've found an issue I don't know how to solve.

 

First, this is my modification, in party.c, at the end of void party_booking_register()

char message[128];
sprintf(message,"%s is looking for %hu at level %hu-%hu to go to %s.", pb_ad->charname, job[0], level,level+10,map_mapid2mapname(mapid));
intif_broadcast(message,strlen(message)+1,0);

There is a problem with this: The party booking system uses its own ID numeration to define jobs and maps. These ID values are read from the lua files, they are not server-side. So, if I try to convert these IDs to text (job name or map name) in the source code, the resulting value doesn't exist or it doesn't correspond to the map or job in the booking system.

 

Can anyone help me with an idea to solve this? I know I could just create two arrays in the source that contain the job names and map names in the same order as in the party booking system... but I'd prefer to avoid doing  that if there is a better solution.

 

Thank you very much

  • Upvote 1
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  547
  • Reputation:   270
  • Joined:  11/08/11
  • Last Seen:  

For me this worked, but I only tested a few cases:

 

clif_displaymessage(sd->fd,job_name(job-4));

 

Edit:

Since this is stored as it is sent from the client and the requests are also processed like that, there currently is no translation table on serverside.
Therefore you might need an array like this for jobs and another one for the maps:

int jobs[] = {
        // Roles
        JOB_NOVICE, // think of something here
        JOB_NOVICE,
        JOB_NOVICE,
        JOB_NOVICE,
        // 1st
        JOB_SWORDMAN,
        JOB_MAGE,
        JOB_ARCHER,
        JOB_ACOLYTE,
        JOB_MERCHANT,
        JOB_THIEF,
        // 2nd
        JOB_KNIGHT,
        JOB_PRIEST,
        JOB_WIZARD,
        JOB_BLACKSMITH,
        JOB_HUNTER,
        JOB_ASSASSIN,
        JOB_CRUSADER,
        JOB_MONK,
        JOB_SAGE,
        JOB_ROGUE,
        JOB_ALCHEMIST,
        JOB_BARD,
        JOB_DANCER,
        // 3-1
        JOB_RUNE_KNIGHT,
        JOB_WARLOCK,
        JOB_RANGER,
        JOB_ARCH_BISHOP,
        JOB_MECHANIC,
        JOB_GUILLOTINE_CROSS,
        // 3-2
        JOB_ROYAL_GUARD,
        JOB_SORCERER,
        JOB_MINSTREL,
        JOB_WANDERER,
        JOB_SURA,
        JOB_GENETIC,
        JOB_SHADOW_CHASER,
        // 1st High
        JOB_SWORDMAN_HIGH,
        JOB_MAGE_HIGH,
        JOB_ARCHER_HIGH,
        JOB_ACOLYTE_HIGH,
        JOB_MERCHANT_HIGH,
        JOB_THIEF_HIGH,
        // 2nd High
        JOB_LORD_KNIGHT,
        JOB_HIGH_PRIEST,
        JOB_HIGH_WIZARD,
        JOB_WHITESMITH,
        JOB_SNIPER,
        JOB_ASSASSIN_CROSS,
        JOB_PALADIN,
        JOB_CHAMPION,
        JOB_PROFESSOR,
        JOB_STALKER,
        JOB_CREATOR,
        JOB_CLOWN,
        JOB_GYPSY,
        // Other
        JOB_WEDDING,
        JOB_NOVICE_HIGH,
        JOB_SUPER_NOVICE,
        JOB_GUNSLINGER,
        JOB_NINJA,
        JOB_TAEKWON,
        JOB_STAR_GLADIATOR,
        JOB_SOUL_LINKER,
    };

Then you can show the jobname with:

clif_displaymessage(sd->fd,job_name(jobs[job[i]-1]));

But you need to define the roles with hardcoded strings...

 

I know that this is not the answer you wanted to hear, but it is like that at the moment and that might also be the reason why there is no custom option for such a feature in rAthena.

Edited by Lemongrass
Further tests
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  120
  • Reputation:   44
  • Joined:  11/13/11
  • Last Seen:  

Thanks for your answer.

 

If there is no other choice, maybe we should have a function such as:

 

map_mapclientid2mapname()

 

And probably the same with jobs... This would increase compatibility between server-side and client.

Edited by Leeg
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  547
  • Reputation:   270
  • Joined:  11/08/11
  • Last Seen:  

Well we have those functions to map the client ids(JOB_*) to the server ids(MAPID_*), but they defined a new table which is ONLY for booking(because of the additional roles I guess).

 

I dont really know whether it would make sense to add this lookup tables for their additional map and job ids for booking, because they could change with each updates, which makes it kind of hard maintain for us.
It would cause us to have to monitor yet another client file for changes and release the changes accordingly.

 

Additionally I personally just found the map table in the luas, I could not find the job table in there when I looked for it quickly.

Are you sure it's also there?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  120
  • Reputation:   44
  • Joined:  11/13/11
  • Last Seen:  

The jobs are probably hardcoded in the client. However, in the msgstringtable you can find the names of the four roles.

Edited by Leeg
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...