Jump to content

valdirk2

Inactive Member
  • Posts

    39
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by valdirk2

  1. Save guys, I have a question here. I'm creating my own login screen for metin, and whenever I declare a variable in python, I have the custom in __del__ to set them to None. I wanted to know if it is really necessary to do this. For example, I create a variable with the value of a string, or even a ui.Textline(), then is it necessary to set it to None in __del__? Or does python's own garbage collector clean them? Another doubt, I also saw the self.ClearDictionary() function, what use is it?
  2. Unfortunately in this case he used quest as a system mediator. I already made the system using packet communications and 70% of the system in the server and client's own source. So far I haven't tested in production, but the tests I did were good.
  3. So, I believe I got a good result, but I'll still need to test it in production. To avoid the customer receiving too many packages at once, when the player opens the global store, I create an EVENTFUNC, which every 1 second sends a package containing 100 items that the global store has. I did some tests and apparently it's working fine. I want to see how it will be in production hahaha
  4. So there's something I'll have to research, because I don't know how to store this variable inside the binary. But thanks for the tips, now I know what path to take to create this system, I'm not very good with c++, but I'm learning. I also want to see how the cache system works inside the game, maybe I can do something there.
  5. I thought to store all this in a variable in python. Could python handle working with a variable with 100k of items? It would make a lot of difference in memory.
  6. I really thought about prioritizing performance in the "game". Whenever someone opens the item shop they send all the items currently in the shop available. Then the customer is concerned with filtering the items. And when any player adds an item it sends to all players connected the packet with the new item, without the need for any other query. Just the initial query when someone requests the items.
  7. Hello guys, I would like opinions from everyone. I'm setting up a global store for metin, a kind of auction, to retire offline stores. My idea is for players to advertise items they want to sell for a certain price, and these items are stored in a database. But my doubt is the following, what would be the most performative way to make this system, in relation to storing the items that are for sale. When the player opens the global store, simply the "game" sends several packets with all items currently available for sale (can be 1 to 1000kk of items in the database, but all summarized in just one query) and in pyhton i filter the items that will be displayed and paged to the player. Or send these items as needed, that is, every time the player searches for an item name or changes the page, the client asks for a request for 10 new items at a time, but this would cause a good amount of query to be processed. Each request would be necessary to always make a query to the database and return the items to players. I'm really in doubt which way would be more performatica, let the client get by with a large amount of data, or the "game" will send requests as needed.
  8. Hello gentlemen, I wonder if it is possible to trigger a quest using a command? For example /teleport And he opens a quest that I have related to that ... I know that there is another way to do that would be to put a login on the quest and send the index to the client ... However I would find it extremely easier to do this trigger using a command. Thank you to anyone who can help me.
  9. Well, come on, how can I start explaining why this topic. I am Brazilian and all the files that my text files are in UTF8, so I started checking the source of metin2 in search of leaving all files with UTF8 encoding and not having visual bugs. My source, server, client, etc ... is already totally in UTF8 without BOM. In this topic I will leave the FIX of a visual bug that I had in my quests when I add delay. Technically the problem is that UTF8 is multibyte, so the function that separated letter by letter always took a fixed value from the string encoded in utf8 ... thus giving shit. In EterLib/parser.cpp Technically the problem was solved. I am not very good with c ++, I found this solution in forums on the internet. If someone has a better solution just leave the feedback.
  10. I can only really congratulate you, how nice it is to study this kind of quality content. Congratulations, excellent.
  11. As it really feels good you read these types of content. Congratulations. Excellent reading.
  12. Could you add the output function? I wanted him to unzip the files in another folder, which I can select via the command line. I find it somewhat disorganized to leave the files unzipped inside the pack folder of the client.
  13. I understand, soon I make these checks to avoid a crash, and update the topic. And about using rapidjson, I for not have much knowledge with c++, I ended up just copying from the other functions that read the drops. But thanks for the feedback
  14. Hi guys I want to disclose a modification I made to my source to slightly improve the organization of common_drop_item.txt As always I notice, that I am not so familiar with c++, so this tutorial may contain some problem, for this reason I want to post and receive criticisms or opinions. I am also using google translator, I live in Brazil and I can only speak Portuguese First, I don't know if everyone knows, the common_drop_item is divided into 24 columns separated by TAB These columns are divided into 4 sections, from rank 0 to 3 That would be something like this PAWN S_PAWN KNIGHT S_KNIGHT In these sessions the first one is always ignored, because it could be some annotation or something The second is the initial level The third is the final level The fourth is the percentage The fifth is the item's VNUM And the sixth is the number of kill's, however investigating the source, I did not see a need in the field, after all in the function that reads these drops she also ignores. So what exactly did I do? I modified the function that reads common_drop_item, so that it looks like the later drop files. Separated by Group "Group Name" { Rank (int) "It would be from level 0 to 3" ID - Min Level - Max level - Percent - VNUM } I believe it is more organized and easy to change. Tutorial And common_drop_item will now look like this The common_drop_item I used was one that I believe is not modified, and with standard drops, if anyone needs it, I posted it here too. I put the common_drop_item files in github gits too. [Hidden Content] I used a script I made in nodejs, to organize this file, and put these comments at the end with the name of each item. In case someone just needs to ask. Remembering that it is something experimental, I tested it here and it is working normally. Any criticism or suggestion just speak. Att: Rospirski
  15. I really only have this problem when I use npc_lock
  16. Hello guys, I have a very complicated problem to explain, and the most complicated way to solve. I'm using leaked marty files as a base. (Yes, I texted him to try to buy the current files and he never answered me.) So let's go to the problem, first I took the source, fixed some fixes, installed some systems. I also updated to use Clang, and all dependencies as static. That's basically what I did. Now the problem comes, I noticed that in the blacksmith NPC of the demon tower every time I clicked on it, and then closed the conversation, it presented this error in the syserr When I click "Close" it generates this error. And when I click "Cancel" it generates this error. Here's the quest I'm using And what I noticed that is generating this syserr is "npc.lock()" If I remove this npc.lock() from the line when 20075.chat.locale.deviltower_zone._170_npcChat with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin The errors stop. I also posted my Makefile that I made myself, even though I didn't have much sense of C and Makefiles I would be very grateful if anyone can help me with this problem.
  17. If I'm not mistaken, with "reload q" he already does that. In the files I'm working on, I don't use translate.lua, just locale.lua.
  18. I made a script to reload on locale_string I thought it was too easy, but I didn't even test it much. If you want to test. locale.cpp In function void locale_init(const char *filename) Add before FILE * fp = fopen (filename, "rb"); localeString.clear(); The function will look like this void locale_init(const char *filename) { localeString.clear(); FILE *fp = fopen(filename, "rb"); char *buf; if (!fp) return; fseek(fp, 0L, SEEK_END); int i = ftell(fp); fseek(fp, 0L, SEEK_SET); ... cmd_gm.cpp In function ACMD(do_reload) Add below case 'c': // cube // ·ÎÄà ÇÁ·Î¼¼½º¸¸ °»»êÇÑ´Ù. Cube_init(); break; this case 'l': ch->ChatPacket(CHAT_TYPE_INFO, "Reloading locale_string."); LocaleService_LoadLocaleStringFile(); break; I believe it's just that, I tested it quickly and it worked, I'm not sure on other channels.
  19. I didn't really copy it, I spent hours researching some fix about it ... and I didn't find it, and if I had found it I would have saved myself 4 hours trying to solve it hahahaha But if you had the same idea as me, I believe I'm on the right path xD
  20. Very good, I did it here and it worked well
  21. Very good, thank you, it will help me a lot
  22. Where is this fix? I spent two hours searching on google and didn't find any correction, if someone did a fix better than mine, I definitely want to use it.
  23. Well, first I had a BUG on a client, if there were a lot of items on the floor, I kept pressing Z to pick up the items, until suddenly he stopped picking up. Then, I found that the function that maps the items that were nearby simply sent the package to pick up an item that was too far away and ignored those that were really close. I searched a lot on google for a solution, I saw two or three post with this same bug, but without solution. I know almost nothing about C ++, but I managed and managed to solve it. If anyone has an idea, or any better way to resolve it, please leave your idea. So what did I do? With that he will always pick the item that is at a closer average distance, different from the other function that I did not understand well how it worked... As I said, I am very lay with C ++, but there is a solution to a bug that I solved.
  24. Didn't understand "bt full"? I'm Brazilian and I'm using google translate, sorry I found out where the problem is, I just don't know how to solve it. Inside the file Input.cpp In function CInputProcessor::Process I put a sys_log in: if (m_iBufferLeft < iPacketLen){ sys_err("teste2"); return true; } And whenever I try to login it appears in the syslog bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes, int & r_iBytesProceed) { const char * c_pData = (const char *) c_pvOrig; BYTE bLastHeader = 0; int iLastPacketLen = 0; int iPacketLen; if (!m_pPacketInfo) { sys_err("No packet info has been binded to"); return true; } for (m_iBufferLeft = iBytes; m_iBufferLeft > 0;) { sys_err("teste"); BYTE bHeader = (BYTE) *(c_pData); const char * c_pszName; if (bHeader == 0) { iPacketLen = 1; sys_err("teste1"); } else if (!m_pPacketInfo->Get(bHeader, &iPacketLen, &c_pszName)) { sys_err("UNKNOWN HEADER: %d, LAST HEADER: %d(%d), REMAIN BYTES: %d, fd: %d", bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft, lpDesc->GetSocket()); //printdata((BYTE *) c_pvOrig, m_iBufferLeft); lpDesc->SetPhase(PHASE_CLOSE); return true; } if (m_iBufferLeft < iPacketLen){ sys_err("teste2"); // <--------------------------------------------------------- return true; } if (bHeader) { sys_err("teste3"); if (test_server && bHeader != HEADER_CG_MOVE) sys_log(0, "Packet Analyze [Header %d][bufferLeft %d] ", bHeader, m_iBufferLeft); m_pPacketInfo->Start(); int iExtraPacketSize = Analyze(lpDesc, bHeader, c_pData); if (iExtraPacketSize < 0){ sys_err("teste4"); return true; } iPacketLen += iExtraPacketSize; lpDesc->Log("%s %d", c_pszName, iPacketLen); m_pPacketInfo->End(); } // TRAFFIC_PROFILER if (g_bTrafficProfileOn){ sys_err("teste5"); TrafficProfiler::instance().Report(TrafficProfiler::IODIR_INPUT, bHeader, iPacketLen); } // END_OF_TRAFFIC_PROFILER if (bHeader == HEADER_CG_PONG) sys_log(0, "PONG! %u %u", m_pPacketInfo->IsSequence(bHeader), *(BYTE *) (c_pData + iPacketLen - sizeof(BYTE))); if (m_pPacketInfo->IsSequence(bHeader)) { BYTE bSeq = lpDesc->GetSequence(); BYTE bSeqReceived = *(BYTE *) (c_pData + iPacketLen - sizeof(BYTE)); sys_err("teste7"); if (bSeq != bSeqReceived) { sys_err("SEQUENCE %x mismatch 0x%x != 0x%x header %u", get_pointer(lpDesc), bSeq, bSeqReceived, bHeader); LPCHARACTER ch = lpDesc->GetCharacter(); char buf[1024]; int offset, len; offset = snprintf(buf, sizeof(buf), "SEQUENCE_LOG [%s]-------------\n", ch ? ch->GetName() : "UNKNOWN"); if (offset < 0 || offset >= (int) sizeof(buf)) offset = sizeof(buf) - 1; for (size_t i = 0; i < lpDesc->m_seq_vector.size(); ++i) { len = snprintf(buf + offset, sizeof(buf) - offset, "\t[%03d : 0x%x]\n", lpDesc->m_seq_vector[i].hdr, lpDesc->m_seq_vector[i].seq); if (len < 0 || len >= (int) sizeof(buf) - offset) offset += (sizeof(buf) - offset) - 1; else offset += len; } snprintf(buf + offset, sizeof(buf) - offset, "\t[%03d : 0x%x]\n", bHeader, bSeq); sys_err("%s", buf); lpDesc->SetPhase(PHASE_CLOSE); return true; } else { sys_err("teste10"); lpDesc->push_seq(bHeader, bSeq); lpDesc->SetNextSequence(); //sys_err("SEQUENCE %x match %u next %u header %u", lpDesc, bSeq, lpDesc->GetSequence(), bHeader); } } c_pData += iPacketLen; m_iBufferLeft -= iPacketLen; r_iBytesProceed += iPacketLen; iLastPacketLen = iPacketLen; bLastHeader = bHeader; if (GetType() != lpDesc->GetInputProcessor()->GetType()){ sys_err("teste11"); return false; } } return true; }
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.