Jump to content

latheesan

Members
  • Content Count

    41
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by latheesan

  1. Is there an NPC event I can use to detect when player enters a map? I want to prevent duel client on event maps, but to be able to do that, I need to first detect user entering a specific map. How can I go about doing this?
  2. Hi, Is it possible to change the GM's chat colour in the Channel System? I know you can change the colour of GM's chat in the normal chat system via NEMO patcher like this: How about for the Channel System? Could it be done with a simple plugin?
  3. Where does Thor Patcher keeps the list of installed patches? One of our player had the game client running (which made the grf in use, so the merge couldn't happen) and his patch is screwed up now and wish to re-apply it. I know in the old patcher I used, there was like a log file, where I can remove the last line and re-open the patcher and it will re-apply the last patch. Any ideas?
  4. Update #2 :- Okay, after a bit of tinkering around - I think I managed to solve it, but I feel like I may have hooked into the wrong function. Here's the working version: #include "common/hercules.h" #include "common/memmgr.h" #include "common/mmo.h" #include "common/socket.h" #include "common/strlib.h" #include "map/clif.h" #include "map/pc.h" #include "plugins/HPMHooking.h" #include "common/HPMDataCheck.h" #include <stdio.h> #include <stdlib.h> #include <string.h> HPExport struct hplugin_info pinfo = { "GM Impersonate", // Plugin name SERVER_TYPE_MAP, // Which server types this plugin works with? "1.0", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated) }; bool my_pc_process_chat_message(bool retVal___, struct map_session_data *sd, const char *message) { if (retVal___ == true) { if (stristr(message, " ")) { clif->messagecolor_self(sd->fd, COLOR_RED, "Possible GM Impersonation Detected - you cannot use more than 3 spaces in chat."); return false; } if (stristr(message, " : ") || stristr(message, " ; ")) { clif->messagecolor_self(sd->fd, COLOR_RED, "Possible GM Impersonation Detected - you cannot use : or ; in chat."); return false; } } return true; } HPExport void plugin_init(void) { if (SERVER_TYPE == SERVER_TYPE_MAP) { addHookPost(pc, process_chat_message, my_pc_process_chat_message); } } This version appears to be working everywhere, not just chat rooms. Here's a demo of the detection working: But this appears to have created a side effect. When ever you use a at-command, it appears to executes the command and then show the at-command you typed. Here's what I mean. I used the command @who2 - it shows the output and then shows the command i typed Is pc->process_chat_message the wrong hook? If not, am I implementing the hook incorrectly? Update #3 - I've fixed the wierd side effect It was caused by me always returning true. The fix is this: bool my_pc_process_chat_message(bool retVal___, struct map_session_data *sd, const char *message) { if (retVal___ == true) { if (stristr(message, " ")) { clif->messagecolor_self(sd->fd, COLOR_RED, "Possible GM Impersonation Detected - you cannot use more than 3 spaces in chat."); return false; } if (stristr(message, " : ") || stristr(message, " ; ")) { clif->messagecolor_self(sd->fd, COLOR_RED, "Possible GM Impersonation Detected - you cannot use : or ; in chat."); return false; } } return retVal___; } silly typo.
  5. Thanks for that, I manage to salvage the code Annie posted and tried to compile and found out that "colormes" has an error: So, I replaced it with: messagecolor_self Now, I have a different error: This is what I have so far: http://pastebin.com/N0EMkui3 If I try to remove this line "session = GET_SYMBOL("session");" the plugin doesn't compile, I get this error: Any ideas? I am trying to compile in Visual Studio Community Edition 2015. Thanks. -------- UPDATE After many hours of tinkering, I finally got it to compile after realising the plugin system was updated. The code Annie posted was for old HPM system. So, I managed to update it like this (not sure if i am using the right hook): #include "common/hercules.h" /* Should always be the first Hercules file included! (if you don't make it first, you won't be able to use interfaces) */ #include "common/memmgr.h" #include "common/mmo.h" #include "common/socket.h" #include "common/strlib.h" #include "map/clif.h" #include "map/pc.h" #include "plugins/HPMHooking.h" #include "common/HPMDataCheck.h" /* should always be the last Hercules file included! (if you don't make it last, it'll intentionally break compile time) */ #include <stdio.h> #include <stdlib.h> #include <string.h> HPExport struct hplugin_info pinfo = { "gmimpersonate", // Plugin name SERVER_TYPE_MAP, // Which server types this plugin works with? "0.1", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated) }; bool my_clif_process_chat_message(const char* retVal___, struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen) { if (retVal___ == true) { char* message = (char*)RFIFOP(sd->fd, 4) + strnlen(sd->status.name, NAME_LENGTH - 1) + 3; int i, l = strlen(message); for (i = 0; i <= l; i++) if (message[i] == 'xA0') message[i] = 'x20'; // replace Alt+0160 into [space] if (stristr(message, " ")) { clif->messagecolor_self(sd->fd, COLOR_RED, "You are only allowed to type maximum of 3 spaces in a dialog."); return false; } if (stristr(message, "x20x3Ax20") || stristr(message, "x20x3Bx20")) { // type " : " OR " ; " will be blocked clif->messagecolor_self(sd->fd, COLOR_RED, "You can't impersonate other players !"); return false; } } return true; } HPExport void plugin_init(void) { addHookPost(clif, process_chat_message, my_clif_process_chat_message); } Now, this plugin compiles. I've enabled it (gmimpersonate) in conf/plugins.conf and went in game to test it, does not appear to be working. Any idea what might be wrong? is "process_chat_message" wrong method to hook? I tried looking for "process_message" but it appears there is no hook for it.
  6. Hi All, I just found out about an interesting way scammers are scamming my players. If they used multiple spaces, they can pretend to be anyone (especially GM/Admin) and trick users to give their account details away or in worst case get them to install TeamViewer etc... Let me show you what I mean. If I am logged in user Adam for example and I want to impersonate gm Latheesan, as "Adam", this is what I would type in a chat room: Hi Latheesan : Hi, can you install TeamViewer and give me id/pass? In the game, here's a demo showing how this looks and renders: So, in a busy chat room, players can be easily tricked into thinking a GM/Admin is talking to them and they do what they are told (even tho there's an ad/warning plastered all over the game not to give out account details >.>) Anyway, now you know how it's done, is there a way to prevent this? The easiest solution I can think of is to prevent multiple spaces in chat. If this was in PHP, I would have used regex to replace multiple occurrences of spaces into one like this example: $input = 'Hi Latheesan : Hi, can you install TeamViewer and give me id/pass?'; $output = preg_replace('!\s+!', ' ', $input); Could effectively do something similar in Hercules as a plugin? Can someone help me out? I am pretty sure this should be standard in Hercules, i.e. not being able to use multiple spaces (atleast a config for it or something...)
  7. @@skyleo / @@Dastgir - thanks for your replies. I managed to get it working without using custom keys, i.e. using the official ones in the client: 0x290551EA, 0x2B952C75, 0x2D67669B Is this ill-advised? would it be better to use custom keys?
  8. I am using the client: 2014-10-22 The herc emu/db has been setup to use md5 pass, not plain text. I diffed my client using NEMO and un-ticked "Restore Login Window" Given my username: latheesan & password: 123456 I tried to launch my client like this: myclient.exe -t:e10adc3949ba59abbe56e057f20f883e 1rag1 latheesan I see the "Do you agree?" and when I click ok and select the service, it says "unregistered id" and doesn't seem to work. I even tried enabling the diff "Use SSO packet" and it hasn't helped. The login is correct by the way. If I use "Restore Login Window", I can login perfectly fine with the old login window in the client. But I want to use token based login. Any ideas? ------ UPDATE Never mind; figured it out after a few trial & error and looking at the server logs. The trick was to enable "Use SSO Packet" and disable "Restore login window" diffs and launch the client like this: myclient.exe -t:123456 latheesan 1rag1
  9. Hi, I am using the client: 2014-10-22b To use the Packet Obfuscation feature; I used the following site to create 3 unique keys and made sure it "Passed" the validation stage. Then I Patched my unpacked client using NEMO with the following options: 8 Custom Window Title 9 Disable 1rag1 type parameters (Recommended) 13 Disable Ragexe Filename Check (Recommended) 15 Disable HShield (Recommended) 20 Extend Chat Box 21 Extend Chat Room Box 22 Extend PM Box 23 Enable /who command (Recommended) 24 Fix Camera Angles (Recommended) 27 HKLM To HKCU 31 Increase Zoom Out 75% 33 Always Call SelectKoreaClientInfo() (Recommended) 34 Enable /showname (Recommended) 35 Read Data Folder First 36 Read msgstringtable.txt (Recommended) 37 Read questid2display.txt (Recommended) 38 Remove Gravity Ads (Recommended) 39 Remove Gravity Logo (Recommended) 40 Restore Login Window (Recommended) 41 Disable Nagle Algorithm (Recommended) 43 Always Use Email for Char Deletion 44 Translate Client (Recommended) 46 Use Normal Guild Brackets (Recommended) 47 Use Ragnarok Icon 48 Use Plain Text Descriptions (Recommended) 49 Enable Multiple GRFs (Recommended) 53 Use Ascii on All LangTypes (Recommended) 64 @ Bug Fix (Recommended) 65 Load Custom lua file instead of iteminfo*.lub (Recommended) 69 Extend Npc Dialog Box 73 Remove Hourly Announce (Recommended) 84 Remove Serial Display (Recommended) 86 Only First Login Background 88 Allow space in guild name 90 Enable DNS Support (Recommended) 92 Packet First Key Encryption 93 Packet Second Key Encryption 94 Packet Third Key Encryption 97 Cancel to Login Window (Recommended) 213 Disable Help Message on Login (Recommended) Then I added the following line to my conf/import/battle_conf.txt to always use packet obfuscation: packet_obfuscation: 2 Finally, I modified src/map/packets.h and added the following lines to the end of the file, just before #endif /* _MAP_PACKETS_H */ line: packetKeys(0xFIRSTKEY,0xSECONDKEY,0xTHIRDKEY); Recompiled the server and launched the client and I could login and go to char selection window. When I select my char, I get disconnected and on the server window, I get the following output: [Warning]: clif_parse: Received unsupported packet (packet 0x5691 (0x215f), 19 bytes received), disconnecting session #7. [Info]: Closed connection from '92.xxx.xxx.xxx'. Any ideas what I might have done wrong? Or, did I miss a step somewhere? Thanks in advance for any help. Regards, Latheesan.
  10. A friend of mine brought this tool to my attention today: ~ Link not Needed ~ This tool is able to somehow dupe item in all types of emulator. Has anyone from Herc community heard of this? Perhaps looked into how this works? Is it possible to block this?
  11. Hello and pardon my ignorance, but I saw this list here: http://herc.ws/board/topic/3554-ragnarok-episode-timeline/ Which episode of Ragnarok Online is implemented by the latest hercules git repo? Since Episode 15.2 : Memory Record is listed here, is that the latest herc offers? or am I wrong to assume that?
  12. @@Winterfox Thanks, that did the trick. I forgot about copyarray
  13. @@Winterfox I have a another one for you, if you have time: http://herc.ws/board/topic/10319-set-the-array-variable-returned-by-a-function-to-another-variable/ Thanks again.
  14. I have the following script: // Main Script- script L_Test -1,{ // Configuration set .useLastMAC,0; // When player logins into game OnPCLoginEvent: // Load account info setarray @accountInfo$,callfunc("L_GetAccountInfo"); debugmes "[OnPCLoginEvent] account_id = " + @accountInfo$[0]; debugmes "[OnPCLoginEvent] last_ip = " + @accountInfo$[1]; debugmes "[OnPCLoginEvent] last_mac = " + @accountInfo$[2]; end; }// Helper Function: Load Account Info// Returns Array (0 = Account ID | 1 = Last IP | 2 = Last Mac)function script L_GetAccountInfo { setarray .accountInfo$[0],getcharid(3); if (getvariableofnpc(.useLastMAC,"L_Test") == 1) { query_sql("SELECT last_ip, last_mac FROM login WHERE account_id = "+ .accountInfo$[0], .last_ip$, .last_mac$); setarray .accountInfo$[1],.last_ip$,.last_mac$; } else { query_sql("SELECT last_ip FROM login WHERE account_id = "+ .accountInfo$[0], .last_ip$); setarray .accountInfo$[1],.last_ip$,"-"; } debugmes "[L_GetAccountInfo] account_id = " + .accountInfo$[0]; debugmes "[L_GetAccountInfo] last_ip = " + .accountInfo$[1]; debugmes "[L_GetAccountInfo] last_mac = " + .accountInfo$[2]; return .accountInfo$;} With this script enabled, when I login - I get the following output in map server: [Debug]: script debug : 2000000 110034179 : [L_GetAccountInfo] account_id = 2000000[Debug]: script debug : 2000000 110034179 : [L_GetAccountInfo] last_ip = 127.0.0.1[Debug]: script debug : 2000000 110034179 : [L_GetAccountInfo] last_mac = -[Debug]: script debug : 2000000 110034179 : [OnPCLoginEvent] account_id = 2000000[Debug]: script debug : 2000000 110034179 : [OnPCLoginEvent] last_ip =[Debug]: script debug : 2000000 110034179 : [OnPCLoginEvent] last_mac = Basically, within the function L_GetAccountInfo I load account details (account_id, last_ip, last_mac) based on npc config and return it as a array. When I set this function ret val to a array variable, it doesn't seem to be working. Any ideas? Only the first index's value appears to be returned by the function (2nd and 3rd index is empty).
  15. Hi everyone, I've been away from Ragnarok Online for a very long time, I have recently picked it up and I have started NPC Scripting again. I am working on a daily reward script that uses function and I am getting this error: invisible/not on a map error I have managed to re-produce the error with this test script: // Main Script- script L_Test -1,{ // When script starts OnInit: // Configuration set .npc$,"[ Test NPC ] : "; end; // When player logins into game OnPCLoginEvent: dispbottom(.npc$ + callfunc(L_SayHello, strcharinfo(0))); end; }function script L_SayHello { set .playerName$,getarg(0); return "Hello "+ .playerName$;} This script structure is identical to my real script. So when I start the server and login, I get the following error in map server: [Warning]: Unexpected type for argument 1. Expected string.[Debug]: Data: variable name='L_SayHello' index=0[Debug]: Function: callfunc[Debug]: Source (NPC): L_Test (invisible/not on a map)[Error]: script:callfunc: function not found! [0][Debug]: Source (NPC): L_Test (invisible/not on a map) Any idea what this error is about?
  16. @@Dastgir Okay sweet, thanks for the info. Now i have a working client
  17. @@Dastgir Thanks, I will try this version. At the moment, my clientinfo.xml has the following (came with the english data dir v4): <version>46</version> Is this correct for the 2013-08-14aRagexe.exe? If not, how do you know which version to use? Update: Using the correct msgstringtable.txt has solved both of my issues (Inventory window as well as cash shop): Thanks again Dastgir.
  18. @@Winterfox I have now reported it: https://github.com/HerculesWS/Hercules/issues/618 I will take a look at msgstringtable.txt when I am home and see if I can change it.
  19. @@Winterfox Lol. I don't think I have permission to open a bug report. Maybe you will have to. About the inventory size, I meant that the number of rows being shown is too many. Is that controlled by msgstringtable.txt? strange.
  20. @@Winterfox I can add the file name to the Virus Vault Exclusion List globally - that's no problem. But, what's strange is that, this warning does not occur when I do the patching on other client verions (ony this version). My worry is that, if I add it to the exclusion list and then release it, won't it throw the same warning to my players (whom might be using avast)? Should they then also add it to the exlcusion list : @@aznguy212 Looks like your solution worked. Using client 2013-08-14aRagexe.exe and newprontera.grf I am able to login to game and client no longer crashes at the prontera. However, I noticed two issues: Cash Shop total does not appear to be working (says %s) - is this a known bug? server side or client related? The inventory section is huge - any ideas?
  21. @@Winterfox I am afraid I am not able to use that client, when I patch it, AVAST AntiVirus is immediately picking that up as a virus: When I scan the orignal file, no virus is reported, the issue only occurs post patching
×
×
  • Create New...

Important Information

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