C++ Fix code for trade NPC packet crash

Results 1 to 10 of 10
  1. #1
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    shout C++ Fix code for trade NPC packet crash

    Hello there, i have a little question for those who really know what i am talking about here...
    I have been developing my Season 3 Episode 2 server and i made some fixes/addons etc.
    The really annoying thing is, that i have tried to fix the check trade function. I a player plays a bit with the packets, he is able to trade anything, like NPC`s or monsters, thus crashing the gamesever.
    This is what i have been able to come up with ( with the help of a good friend alin ):
    Code:
    case 0x37:
    			OBJECTSTRUCT *tintaObject = (OBJECTSTRUCT*)OBJECT_POINTER(gObj->TargetNumber);
    			if(tintaObject->Type !=1)
    			{
    			MsgAll("[SYSTEM] :'%s' Has tried to Crash Our Server!",gObj->Name);
    			MsgAll("[SYSTEM] :Instead He got Banned! Hahaha!");
    			MuOnlineQuery.ExecQuery("UPDATE Character SET CtlCode = 1 WHERE Name = '%s'",gObj->Name);
                CloseClient(aIndex);
    			return false;
    			}
    	     break;
    But the problem is, sometimes it`s able to block, sometimes not... i need to fix the code to 100% block that annoying packet, or maybe make another check trade function?
    Please help :)


  2. #2
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: [Help] C++ Fix code for trade NPC packet crash

    Bump?

  3. #3
    Retired NanoGuy is offline
    MemberRank
    Jul 2012 Join Date
    IsraelLocation
    286Posts

    Re: [Help] C++ Fix code for trade NPC packet crash

    instead of checking in Trade Recv check in Trade Send if you sending trade to normal player

  4. #4
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: [Help] C++ Fix code for trade NPC packet crash

    Quote Originally Posted by NanoGuy View Post
    instead of checking in Trade Recv check in Trade Send if you sending trade to normal player
    You don`t understand, you don`t need that, and you can`t do that... the trade packet is send from a simple packet editor...you need the check in the server side... anyone help ??

  5. #5
    Retired NanoGuy is offline
    MemberRank
    Jul 2012 Join Date
    IsraelLocation
    286Posts

    Re: [Help] C++ Fix code for trade NPC packet crash

    Quote Originally Posted by mecanik1 View Post
    You don`t understand, you don`t need that, and you can`t do that... the trade packet is send from a simple packet editor...you need the check in the server side... anyone help ??
    i know that lol but you dont want to listen to what i say

  6. #6
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: [Help] C++ Fix code for trade NPC packet crash

    Quote Originally Posted by NanoGuy View Post
    i know that lol but you dont want to listen to what i say
    OK, let`s start over, can you explain to me detailed? please?

  7. #7

    Re: [Help] C++ Fix code for trade NPC packet crash

    c3 05 30 ff ff old stuff ^^

  8. #8
    Apprentice mugamexx is offline
    MemberRank
    Jan 2014 Join Date
    17Posts

    Re: [Help] C++ Fix code for trade NPC packet crash

    C3 05 30 ID ID = Open NPC Packet
    C3 05 36 ID ID = Trade Request Packet

  9. #9
    Apprentice N3messys is offline
    MemberRank
    Jun 2010 Join Date
    11Posts

    Re: [Help] C++ Fix code for trade NPC packet crash

    Check if your so called 'gObj->TargetNumber' is between OBJ_MIN and OBJ_MAX. Your code only checks if the target is a player, not if it is in bounds. Also get a real codder.

  10. #10
    LiveGuard Software Ltd Mecanik is offline
    MemberRank
    Jan 2012 Join Date
    404 Not FoundLocation
    343Posts

    Re: [Help] C++ Fix code for trade NPC packet crash

    Quote Originally Posted by N3messys View Post
    Check if your so called 'gObj->TargetNumber' is between OBJ_MIN and OBJ_MAX. Your code only checks if the target is a player, not if it is in bounds. Also get a real codder.
    well i do the coding :) i only need to learn certain stuff...that`s why i have posted here...

    - - - Updated - - -

    Quote Originally Posted by N3messys View Post
    Check if your so called 'gObj->TargetNumber' is between OBJ_MIN and OBJ_MAX. Your code only checks if the target is a player, not if it is in bounds. Also get a real codder.
    well i do the coding :) i only need to learn certain stuff...that`s why i have posted here...



Advertisement