Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/27/18 in all areas

  1. Hi there So, I needed a script that was able to transfer my backups through SSH to another UNIX based server (in this case, Ubuntu). Since I already had the server authenticating with key I had to set it up on the script. Prerequisites: mysqldump gzip ssh scp How does it work: -Dumps and compresses the desired mysql databases -Transfers compressed files to remote host -Removes local compressed files Here's the script with as using private key (it needs to be in OpenSSH format, not PuTTY): #!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin # Bins MYSQLDUMP=`which mysqldump` GZIP=`which gzip` SSH=`which ssh` SCP=`which scp` # Date for folders and filenames DAY=$(date +"%Y-%m-%d.%T") FILETIME=$(date +"%Y-%m-%d.%T") # Local backup folder (no trailing slash) LOCAL_FOLDER="/tmp/backups" # FTP Configuration REMOTE_HOST="IP" REMOTE_PORT="PORT" REMOTE_USER="USER" REMOTE_PEM="/PATH/TO/KEY" #With no trailing slash REMOTE_FOLDER="/PATH/TO/DESTINATION/FOLDER/" # With trailing slash # MySQL Configuration MYSQL_USER="USER" # Which databases shall we backup? # Databases should be separated with a space DATABASES="account common log player" # Check if DATABASES var is set... if [ "$DATABASES" == "" ]; then echo -e "\033[31mThere is no databases specified...\033[0m" exit 1 fi # Dump and compress for db in $DATABASES do FILE=$db.$FILETIME.gz echo -e "\033[32mDumping $db!\033[0m" $MYSQLDUMP --set-gtid-purged=OFF -u $MYSQL_USER $db | $GZIP -9 > $LOCAL_FOLDER/$FILE done # Transfer all backup files to remote host echo -e "\033[32m\nTransfering files!\033[0m" # Create the remote folder $SSH -p "${REMOTE_PORT}" -i "${REMOTE_PEM}" "${REMOTE_USER}@${REMOTE_HOST}" "mkdir ${REMOTE_FOLDER}${DAY}" # Transfer the files to the remote folder $SCP -P "${REMOTE_PORT}" -r -i "${REMOTE_PEM}" "${LOCAL_FOLDER}" "${REMOTE_USER}@${REMOTE_HOST}:/${REMOTE_FOLDER}/${DAY}" # Delete local dump files rm -f $LOCAL_FOLDER/* If you don't want to use key just remove: -i "${REMOTE_PEM}" You can add more databases to the backup, just edit the array: DATABASES="account common log player" Don't forget to set the script to UNIX formatted text file. I based my script on MadTiago's one, but his only works for FTP. Hope it's useful for someone
    2 points
  2. 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
  3. Emmm... Show us Root/UIPrivateShop.py and UIScript/UIPrivateShop.py.
    1 point
  4. I know, however, this lag persists when changing the bonus Edit: i activated log.txt from binary and err is :: ENABLE_NEW_EQUIPMENT_SYSTEM0727 17:39:51320 :: 0727 17:39:51320 :: 2060727 17:39:51320 :: 0727 17:39:51320 :: 00727 17:39:51320 :: 0727 17:39:51320 :: 00727 17:39:51320 :: i define but same err #define ENABLE_NEW_EQUIPMENT_SYSTEM in locale_inc full file with this solution?
    1 point
  5. Look it is so easy I have this idead you can make a quest that looks like an event you enable the event . the quest be like when login begin if it is gm charachter then return if it is npc(player) command dc "the player" and you can disable it just like an event . Also make a timer when the player enter syschat"there is a maintenance" thene command logout is better
    1 point
  6. I was wondering in your opinion as a coder, programmer, hacker or developer: Where do you think it's easier to bruteforce or check account and passwords on the official GF servers, client-side or website-side ? Please tell why would you choose one or another ? Arguments!
    1 point
  7. i think vegas showed a video of his brute force
    1 point
  8. Do also the locale.cfg changes.
    1 point
  9. This is rlly long code for delete all in client.. Just unpack locale and open inventorywindow.py delete or comment this code: ## Dragon Soul Button { "name" : "DSSButton", "type" : "button", "x" : 114, "y" : 107, "tooltip_text" : uiScriptLocale.TASKBAR_DRAGON_SOUL, "default_image" : "d:/ymir work/ui/dragonsoul/dss_inventory_button_01.tga", "over_image" : "d:/ymir work/ui/dragonsoul/dss_inventory_button_02.tga", "down_image" : "d:/ymir work/ui/dragonsoul/dss_inventory_button_03.tga", }, You disable/hide button in game like your screenshot. Btw. delete server side in locale on server this: dragon_soul_table.txt and items for alchemy in item_proto.
    1 point
  10. What about thinking on how to fix it yourself?
    1 point
  11. Rewritten, slottypes = { ["armor"] = 90, ["helmet"] = 91, ["shoes"] = 92, ["bracelet"] = 93, ["weapon"] = 94, ["necklace"] = 95, ["earrings"] = 96, ["slot1"] = 97, ["slot2"] = 98, ["shield"] = 100, ["costume_armor"] = 109, ["costume_hair"] = 110, ["costume_weapon"] = 111 }; function string_in_table(s, t) return t[s] ~= nil; end -- function function item.is_worn(itype) if (not string_in_table(itype, slottypes)) then return false; end -- if local itemcell = slottypes[itype]; item.select_cell(itemcell); return item.get_cell() == itemcell; end -- function function item.select_cell_check(itype) if (not string_in_table(itype, slottypes) or not item.is_worn(itype)) then return; end -- if local itemcell = slottypes[itype]; item.select_cell(itemcell); end -- function function item.get_worn_vnum(itype) item.select_cell_check(itype); return item.get_vnum(); end -- function function item.get_worn_wearflag(itype) item.select_cell_check(itype); return item.get_wearflag(); end -- function function item.get_worn_flag(itype) item.select_cell_check(itype); return item.get_flag(); end -- function function item.get_wearflag() return mysql_query(string.format("SELECT wearflag FROM player.item_proto WHERE vnum = %d;", item.get_vnum()))[1]; end -- function function item.get_flag() return mysql_query(string.format("SELECT flag FROM player.item_proto WHERE vnum = %d;", item.get_vnum()))[1]; end -- function
    1 point
  12. I hate when some people delete their bug fix topic...
    1 point
  13. LoadMotion: cannot find accumulation data in file 'data/monster/horse_event1/03.msa' LoadMotion: cannot find accumulation data in file 'data/monster/boar/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/dog_god/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/lion/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/boar/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/dog_god/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/lion/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/boar/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/dog_god/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/lion/run.msa' LoadMotion: cannot find accumulation data in file 'data/monster/horse_event1/03.msa' I will teach you only the rationale and after that you will be able to fix it in whatever file syserr gives. I will teach you only the rationale and after that you will be able to fix it in whatever file syserr gives. As an example, while driving the lion (wild, young, brave) mobs are loading late or never loading npc's / metin's disappears. Follow the steps for solution; Here we download the granny viewer and install it. In the pack folder, we find and opening patch2, eix and epk. We go to \ patch2 \ ymir work \ npc \ lion directory, and find "run.msa" and open it with notepad ++ run.gr2 We open it with granny viewer and go to "Animation List" tab. Right click on the animation file and press "View in detail" button. We click on the "click to view sub-structure" button opposite the void ** TrackGroups that opens. A window opens up and we'll add the value to our work here "granny_real32 Loop Translation" in the run.msa file we opened earlier. Now we go back to the run.ms file and add the following lines; Accumulation 0 -589.625915 0 The value from 0-589 that is written in the opposite direction will change to whatever is in your .gr2 file. We also apply it to the server side, so we go to / usr / game / share / data / monster / lion and change the run.msa to what we had previously done. As shown in the attachment; Explain why we are doing this: Accumulation is the speed value of the model animation. If we assign this value incorrectly or leave it blank, the model and animation will work independently of each other. If the client-side and server-side accumulation values match, you will see the animation at real speed. READY .MSM FILES VIRUSTOTAL GOOGLE TRANSLATE MADE THIS
    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.