Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/04/16 in all areas

  1. PythonTextTail.cpp find fxAdd = 8.0f; 2x And edit liek that fxAdd = 4.0f;
    2 points
  2. Hi everyone, I forgot to wrote the Client-Game communication last week, but here it is now: First start again with the HEADER, the name of mine would be HEADER_CG_METIN2DEVORG. Navigate to UserInterface/Packet.h and add this: HEADER_CG_METIN2DEVORG = 58, I will send the VID of the player to the server with one int variable: typedef struct command_metin2dev_send_packet { BYTE byHeader; int data; } TPacketCGMetin2DevOrg; Now navigate to UserInterface/PythonNetworkStreamModule.cpp and add this: PyObject* netCallM2DevPacket(PyObject* poSelf, PyObject* poArgs) { int iData; if (!PyArg_ParseTuple(poArgs, "i", &iData)) { return Py_BuildException(); } if (iData < 0) { return Py_BuildNone(); } CPythonNetworkStream& rns = CPythonNetworkStream::Instance(); rns.SendMetin2DevOrgPacket(iData); return Py_BuildNone(); } Open UserInterface/PythonNetworkStream.h and search for this: bool RecvMallOpenPacket(); Add this over that: bool SendMetin2DevOrgPacket(int data); Open PythonNetworkStreamPhaseGame.cpp and the fill the content of the send function: bool CPythonNetworkStream::SendMetin2DevOrgPacket(int data) { TPacketCGMetin2DevOrg M2DevPacket; M2DevPacket.byHeader = HEADER_CG_METIN2DEVORG; M2DevPacket.data = data; if (!Send(sizeof(M2DevPacket), &M2DevPacket)) return false; return SendSequence(); } Now add the latest codes on the client side, navigate to UserInterface/PythonNetworkStreamModule.cpp and add this: // M2DEV { "SendM2DevPacket", netCallM2DevPacket, METH_VARARGS }, Lets continue with the server-side, first start again with the HEADER in game/packet.h: HEADER_CG_METIN2DEVORG = 58, And with the structure: typedef struct command_metin2dev_send_packet { BYTE byHeader; int data; } TPacketCGMetin2DevOrg; The first argument of Set is HEADER, second is the size of the structure, third is an optional string and the fourth is a boolean. Nearly the most important part of the function is the boolean, we can decide here, do we want to use sequence check? In this case I want, so set it to true. Open game/packet_info.cpp and add this to the CPacketInfoCG::CPacketInfoCG(): Set(HEADER_CG_METIN2DEVORG, sizeof(TPacketCGMetin2DevOrg), "Metin2Dev", true); Now navigate to game/input_main.cpp and add this to the switch at the end of the file: case HEADER_CG_METIN2DEVORG: Metin2DevReceivePacket(ch, c_pData); break; Create the function for the Metin2DevReceivePacket still in game/input_main.cpp: void CInputMain::Metin2DevReceivePacket(LPCHARACTER ch, const char* c_pData) { } Now add declaration of the Metin2DevReceivePacket to the CInputMain class in game/input.h: void Metin2DevReceivePacket(LPCHARACTER ch, const char* c_pData); Fill the content of the function: TPacketCGMetin2DevOrg* p = (TPacketCGMetin2DevOrg*)c_pData; sys_log(0, "PLAYER ID: %i", p->data); Thats all, now just make a simple button in the game to call this function: net.SendM2DevPacket(player.GetTargetVID()) Example: def Button1_Event(self): net.SendM2DevPacket(player.GetTargetVID()) Finally, check how it works: Kind Regards, Sanchez
    2 points
  3. Hi, In this thread I'm going to show you how to make a game-client or client-game communication with packets, instead of using the old quest-client, client-quest communication. Lets start with the game-client, in this example I will send 1 variable to the client. First start with the HEADER, open your binary source and navigate to UserInterface/Packet.h. Now you will see many headers, create a new one, but search for an empty number. I will use 57, because its not used. GC means it's used for Game -> Client packet, it's just a prefix. HEADER_GC_METIN2DEV Now add the structure for the packet, this is most important part. Structure is the "body" of the packet, it contains the HEADER as BYTE and the other optional variables. As I said I just want to send one int type to the client, so add it. typedef struct command_metin2dev_packet { BYTE bHeader; int M2int; } TPacketGCMetin2Dev; Now navigate to UserInterface/PythonNetworkStream.cpp and add your header to the CMainPacketHeaderMap class. The first parameter of the Set is the HEADER, second is the size of the structure. We will use just static size packets in this tutorial, but the third argument can be dynamic size too. Set(HEADER_GC_METIN2DEV, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCMetin2Dev), STATIC_SIZE_PACKET)); Now navigate to UserInterface/PythonNtworkStreamPhaseGame.cpp and add the function to the switch. case HEADER_GC_METIN2DEV: ret = RecvM2DevPacket(); break; The name of the function will be RecvM2DevPacket: Now declarate the function, navigate to UserInterface/PythonNetworkStream.h and add it as public: bool RecvM2DevPacket(); Now add the receiver part of the code. Recv "picks" out xy bytes from the buffer and the return type of it is false if there was no data in the buffer by that size otherwise true, which means it was successful. xy = size of the structure bool CPythonNetworkStream::RecvM2DevPacket() { TPacketGCMetin2Dev Metin2DevGC; if (!Recv(sizeof(TPacketGCMetin2Dev), &Metin2DevGC)) { Tracen("Recv Metin2DevGC Packet Error"); return false; } } Now we are calling the BINARY_M2DEV_Test function in game.py and passing the received data. PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_M2DEV_Test", Py_BuildValue("(i)", Metin2DevGC.M2int)); This was the client-side of the game-client communication, lets start the server-side: First of all we need to add the header again, navigate to game/packet.h and add this: And the structure: typedef struct packet_metin2dev_packet { BYTE byHeader; int M2int; } TPacketGCMetin2Dev; Now navigate to game/char.cpp and create a function which sends the packet. void CHARACTER::SendMetin2DevPacket() { } Declare it in the game/char.h: void SendMetin2DevPacket(); Now lets add the content of the function. Create a new instance of the structure, set the values of it and send it to the client. void CHARACTER::SendMetin2DevPacket() { if (!GetDesc()) { return; } TPacketGCMetin2Dev Metin2DevGC; Metin2DevGC.byHeader = HEADER_GC_METIN2DEV; Metin2DevGC.M2int = GetPlayerID(); GetDesc()->Packet(&Metin2DevGC, sizeof(TPacketGCMetin2Dev)); } Now add the last function to game.py, this will be called by the binary: def BINARY_M2DEV_Test(self, M2int): import dbg dbg.LogBox(str(M2int)) Finally, lets check how it works: If you have any question or suggestion, please just reply to this topic. Kind Regards, Sanchez
    1 point
  4. 1. Enable 6-7 opt: (Europe, Singapore, Vietnam) 2. Change the Success Rate on attaching a Stone to an Item 3. Remove 3% tax when selling an Item 4. Enable Selling an Item by 0 yang in NPC shop 5. Enable pc_change_name (Europe) 6. Enable Selling 70024 () and 70035 () in NPC shop 7. Disable 6/7 Bonuses ( - )on Costumes 8. Edit Shutdown Time (when doing /shutdown command) 9. Edit Max Level 10. Delete Glass () need for link items in chat: 11. Dice and ÁÖ»çŔ§ fix 12. Disable Players drop Yang to the floor 13. Bonus Change Time 0min for Players 14. Change the time from dropped items 15. Make a New Mount to be able to Attack 16. Edit Max Status Points 17. Remove and edit limit_time (alias TimeBomb) 18. Emotions without Emotion Mask () 19. Fix War Crash Bug 20. Edit GM Commands Authority 21. Get Status Points after Level 90 22. Remove Potions when Levelup 23. Edit Rates Values 24. Fix Client Version Check Pay attention to tabulations. Keep in mind that this is just a re-upload of them tut's, some of them can be found way more completed. If you find something wrong feel free to say.
    1 point
  5. change the 1 form 2 and delete the 2 ^^
    1 point
  6. You can use EterManager . EterManager can handle that strings. [Hidden Content]
    1 point
  7. Thank you, I saw yours older reply, but there's link goes down so I needed to ask Thread solved.
    1 point
  8. Since eternexus etc. can not find certain characters unpack eg 01.¼º / ³ª¹ "and then be renamed locations and made new ones. This is in the property, some of its folders/files have Chinese chars in its names. Here are resolved: [Hidden Content] You can go in property/property and creates a file named for * list * like that: [Hidden Content]
    1 point
  9. 4 type? e_O [Hidden Content] I'm searching the chick_pink1 and chick_blue1 .msm and .dds files from metin2_patch_easter1 ('cause I need fresher edition)
    1 point
×
×
  • 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.