Jump to content

pan

Community Contributors
  • Content Count

    355
  • Joined

  • Last visited

  • Days Won

    13

Everything posted by pan

  1. Long time no see! I've been dabbling with adding multi-thread support to Hercules for quite some time and even started quite a few server projects from scratch, and having failed in most of my attempts - last year I tried again with a new core design and it seems to be working so far. A lot of the systems that the server core is reliant were reworked, I believe some of these changes can even be used upstream but they would need to be revised first. This is mostly a proof of concept. I'm still planning on finishing the map-server but as of now only login and char servers have multi-thread enabled - I didn't test with multiple users yet. There's no linux / FreeBSD support because I want to have everything in working condition before trying to add another I/O paradigm, the architecture is very reliant on the way that this module works so I thought it'd better to implement the whole server before trying to add other paradigms. Lately I haven't got much free time to finish the map-server, but sometime later this year I think I can finish it. The code is at https://github.com/panikon/HerculesMT , I forked from stable v2021.08.04 Server architecture Hercules employs a multi-server approach in order to better load balance player requests, so for each game world there'll be at least three separate program instances running at all times. These instrances are: login-server, char-server and map-server. Each of which can only access a subset of the world's SQL tables and is responsible for a different step of the game experience. Authentication and account database changes are segregated to the login-server, while character selection and character specific information are to the char-server, and the actual gameplay to the map-server. The login-server is the player entry-point and can be responsible for multiple different world instances, so it's possible to use the same account table (login) for multiple worlds (char-server + map-server) and to dynamically change their IP without needing to push a new patch. After authentication the player is queried for which service they'll use and then the server relays the proper address so the client can connect. In the char-server the player usually is queried again for a four digit PIN (PACKETVER >= 20180124), after which they can select which playable character will be used to play. The server then relays the address of the proper map-server to the client. A single world instance can have multiple map-servers where each is responsible for a zone (set of maps), all inter map connectivity is managed by the char-server. When the player requests to change character the char-server IP is then relayed. A single map-server can be responsible for multiple different zones, and each will be a different thread. Relationship of each of the possible server instances Brown - Game world | White - program instances Core design All servers are multi-threaded. Basic server functions are assigned to different threads: Console (../src/common/console.c): This thread is responsible for all console input operations. Timer (../src/common/timer.c): The timer thread manages the `timer_heap` and dequeues timer actions from the `timer_queue`. Each timer can be ran in a different thread depending on the `timer_target`, this is accomplished by either queuing an action in one of the available action queues (`target_id`) or by running the specified function in the main timer loop (`do_timer`). Other threads queue different timer actions (add, delete, set tick) to the `timer_queue`. The timer module is also responsible for tick acquiral via (`timer->gettick` and `timer->gettick_nocache`). Message(../src/common/showmsg.c): The message thread is used to synchronize the output of multiple different threads, each call to `Show*` instead of being directly outputted to `STDOUT` is queued in the `showmsg_queue` and then dequeued by the main thread function `showmsg_worker`. I/O Worker(../src/common/socket.c): All I/O operations are asynchronous and implemented via I/O completion ports and a thread pool. The main workers are defined in `socket_worker` and after a operation is dequeued it's converted into an action (`socket_operation_process`) that is then queued to the proper action worker (each session has a responsible worker, and it's obtained by the I/O worker via `action->queue_get`). These workers don't execute any "business logic" so we can minimize the time that they are blocked by any given operation, and also so we can better isolate different session groups without having to take into account in I/O operations (e.g. in map-server each zone has a different action worker and multiple actions can be queued simultaneously without having to block any of the threads for a longer period of time). Action Worker(../src/common/action.c): Action workers perform all the "business logic" of each of the servers, and each is responsible for a different session group. After every action loop all send actions are queued to the completion port. Login-server: Each char-server connection has a different worker. Player connections are randomly assigned. Char-server: Each map-server connection has a different worker. Player connections are randomly assigned. Map-server: Player connections are assigned depending on the current map according to the different configured zones. The char-server connection is randomly assigned. Thread relationships
  2. I tried to use with 2013-12-23c and got this issue as well, I guess the problem is that the only release of this client is packed and if you try to extract its packet-list using the current hex pattern it won't work, try using this tool with a more current unpacked client from k3dt and it might work
  3. It sadly seems so :/ so many useful resources and information lost. Does anybody have a backup or maybe information gathered with a crawler?
  4. Parece que esse comando não está seguindo a caixa necessária: StrCharInfo(0)Deveria ser:strcharinfo(0)Idealmente você deveria utilizar strcharinfo utilizando algumas constantes que são definidas:PC_NAME NomePC_PARTY GrupoPC_GUILD ClãPC_MAP MapaFicando:strcharinfo(PC_NAME);Ou, se você tiver desativado a sensitividade à caixa, o que o evilpuncker disse estaria mais correto.
  5. You could verify if the mob has an entry in mob_boss.txt iterating summon[2] (see [email protected]), if it has it is an MVP, thus monsters that have MVPExp and arent't present in bloody branch are mini-bosses
  6. Amigo sem palavras, fico muito lindo o NPC, Muito obrigado pela paciência e dedicação.... OBRIGADO Só tirando uma dúvida se caso eu queira troca o delay para 10 segundos como eu faço? 10 , 15 Sem problema nenhum Só achar a linha set bvip_delay, gettimetick(0) + 20 * 1000; // Delay de 20sSubstitua o 20 pelo número de segundos desejado
  7. Prontinho http://pastebin.com/Vrhb4nP2
  8. Seria melhor se você baixasse um Hercules novo e utilizasse o modo PRE-RE dele, versões antigas de emuladores são passíveis a muitos bugs, em alguns casos até exploits sérios. Aqui está o script modificado para não dar erros em revisões mais antigas http://pastebin.com/evp2sGCk Se quando você falar com NPC seu personagem ficar paralisado troque SC_INC_AGI para SC_INCREASEAGI
  9. Melhor você atualizar sua revisão do emulador, parece que você não está usando Hercules, acabei de testar um dos SC's estava errado, aqui está a correção: http://pastebin.com/DcdMxebT só copiar e colar em um .txt
  10. Acabei de testar, você deve ter esquecido de por algum TAB no header do NPC, pega ele aqui: http://pastebin.com/jVcBgrG8 copia e cola em um .txt Ah, e o evento 'OnTouch' só é necessário quando você quer que o NPC funcione quando o jogador entre em alguma área, da uma olhada nesse post http://herc.ws/board/topic/3984-é-possível-utilizar-skills-via-servidor-para-efeitos-em-npcs/?p=25957 que ta explicado certinho
  11. Algo assim deve funcionar: <header>,{ OnTouch: if( getgroupid() < 1 ) { mes "["+strnpcinfo(0)+"]"; mes "Você não é VIP, apenas usuários VIP podem utilizar esse benefício."; close; } // Verifica se o tempo atual é maior do que o definido na variável, se sim // é porque ainda não passou o tempo necessário para o usuário poder receber os buffs if( gettimetick(0) < bvip_delay ) end; // Buffs skilleffect 8,0; sc_start SC_ENDURE,360000,10; skilleffect 33,0; sc_start SC_ANGELUS,360000,10; skilleffect 74,0; sc_start SC_MAGNIFICAT,360000,5; skilleffect 75,0; sc_start SC_GLORIA,360000,5; skilleffect 66,0; sc_start SC_IMPOSITIO,360000,5; skilleffect 34,0; sc_start SC_BLESSING,360000,10; skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10; percentheal 100,100; // Define uma variável com um tempo no futuro // gettimetick(0) retorna o tempo em milisegundos set bvip_delay, gettimetick(0) + 20 * 1000; // Delay de 20s end;}Não se esqueça de trocar <header> pelo cabeçalho do seu NPC.
  12. Just updating, dbghelp was never removed, some time ago it was ported to HPM but it wasn't fully operational, I re-ported it (https://github.com/HerculesWS/Hercules/commit/fcaef90fd4f92d78be230f6b9f40005ced72a415) and now it's working normally, all you have to do is build the dll and add the plugin. http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC
  13. Movi o tópico para a seção correta. O *showevent serve para avisar um jogador que há algo relacionado à uma quest em algum NPC portanto precisa que haja um jogador executando o script para que funcione. Basta executá-lo enquanto o jogador estiver falando com o NPC que ele continuará aparecendo enquanto o ele estiver no mesmo mapa, se você desejar que esse ícone apareça constantemente basta utilizar *questinfo, não se esqueça que esse comando só deve ser utilizado dentro de um OnInit. <header>,{ OnInit: questinfo <Quest ID>, <Icon> {, <Map Mark Color>{, <Job Class>}}; end; Os valores para 'Job Class' podem ser encontrados em npc/const.txt, são os primeiros valores. Mas se você quiser que um NPC tenha esse tipo de marcador para todo jogador que logue no servidor, independente de qualquer quest, basta utilizar um OnPCLoginEvent, algo como: <header>,{ OnPCLoadMapEvent: if( strcharinfo(3) == strnpcinfo(4) ) showevent <icon>{,<mark color>}; end;} Não se esqueça de marcar o mapa com a mapflag loadevent.
  14. Without altering your source code it's not possible to know which item was got after using *getrandgroupitem, as you posted in source support I'll provide a snippet altering this command behaviour: Open your src/map/script.c and find: BUILDIN(getrandgroupitem) {[...] for (i = 0; i < count; i += get_count) { // if not pet egg if (!pet->create_egg(sd, nameid)) { if ((flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT))) { clif->additem(sd, 0, 0, flag); if( pc->candrop(sd,&it) ) map->addflooritem(&it,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0); } } } script_pushint(st, 0);[...]Alter it to:BUILDIN(getrandgroupitem) {[...] for (i = 0; i < count; i += get_count) { // if not pet egg if (!pet->create_egg(sd, nameid)) { if ((flag = pc->additem(sd, &it, get_count, LOG_TYPE_SCRIPT))) { clif->additem(sd, 0, 0, flag); if( pc->candrop(sd,&it) ) map->addflooritem(&it,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0); } } } pc->setreg(sd, script->add_str("@nameid"), nameid); pc->setreg(sd, script->add_str("@count"), get_count); script_pushint(st, 0);[...]Save and build your map-server. Now every time that you use *getrandgroupitem and it's successful two temporary variables will be set:@nameid -> Item id@count -> Item countTo verify if the command was successful just check any variable. Now to use it in a item box. Put this function inside any script file: /** * Display an announce letting other players know which item strcharinfo(0) * got when using a box. * arg(0) - Id of the box * These args should be from *getrandgroupitem * arg(1) - @nameid * arg(2) - @count **/function script F_BOX_OPEN { @box_id = getarg(0); @nameid = getarg(1); @count = getarg(2); announce strcharinfo(0)+" opened "+getitemname(@box_id)+" and got "+@count+" "+getitemname(@nameid)+""+((@count > 1)?"s":"")+"!", bc_map; return;}Now go to your item_db.conf and find the entry for the item that you'd like to alter, for instance High Weapon Box:{ Id: 12623 AegisName: "High_Weapon_Box" Name: "High Weapon Box" Type: 2 Buy: 20 Weight: 10 Upper: 63 Script: <" getrandgroupitem 12623,1; ">},Now alter its script to something like:Script: <" getrandgroupitem 12623,1; if(@nameid) callfunc "F_BOX_OPEN",High_Weapon_Box, @nameid, @count;">If you'd like for this to be automatic you could add a broadcast function to BUILDIN(getrandgroupitem), but and any time this function is called it would automatically announce
  15. In this link there're a lot of useful tools when dealing with client-side http://ratemyserver.net/index.php?page=download_tool If you want to open .spr files just download SprConview
  16. SQL files are compatible with any OS that you're using.
  17. Open your npc/jobs/2-1/assassin.txt and search for "savepoint morroc,100,100;" there are many entries there.
  18. pan

    pin code

    Yup. Check your char-server.conf: https://github.com/HerculesWS/Hercules/blob/master/conf/char-server.conf I guess what he means is that he wants pin-code to be optional, only players that request this system would have to input a PIN every time they log-in. I don't think we have such system, but it seems like a good idea...
  19. pan

    Erro jobs

    Têm alguns projetos de tradução para pt-br, cronus e brAthena, lá deve haver alguma data traduzida
  20. Should no objections or other points come forward within the next week I'll commit this change to our main repository.
  21. Update your revision, it should be there. #define MAX_NPC_PER_MAP 512#define AREA_SIZE (battle_config.area_size)#define DAMAGELOG_SIZE 30#define LOOTITEM_SIZE 10#define MAX_MOBSKILL 50#define MAX_MOB_LIST_PER_MAP 100#define MAX_EVENTQUEUE 2#define MAX_EVENTTIMER 32#define NATURAL_HEAL_INTERVAL 500#define MIN_FLOORITEM 2#define MAX_FLOORITEM START_ACCOUNT_NUM#define MAX_LEVEL 175#define MAX_IGNORE_LIST 20 // official is 14#define MAX_VENDING 12#define MAX_MAP_SIZE (512*512) // Wasn't there something like this already? Can't find it.. [Shinryo]#define BLOCK_SIZE 8#define block_free_max 1048576#define BL_LIST_MAX 1048576
  22. These links should help you: http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval/10890428#10890428 http://support.microsoft.com/kb/2757355
  23. Update your revision, this is already fixed, when you got these kind of errors you should always post on our BugTracker and not here. https://github.com/HerculesWS/Hercules/commit/c4603a0335e5cfe49a600ff58c9060680b55360d
  24. pan

    Open Source ragnaBR

    The same here, if I can I'll try to help as well. Good luck
  25. Bom, agora já deve poder ser utilizada, obrigado por ter reportado. https://github.com/HerculesWS/Hercules/commit/53c0e46ed711755a5c3a06bad4263a80089b3b2f Ah, e normalmente não há necessidade de utilizar esse converter, pois nossas tabelas são por padrão MyISAM. Att.
×
×
  • Create New...

Important Information

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