Thread: Need help with packets, I'm noob :p

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    Need help with packets, I'm noob :p

    I was looking trough a source I got and it works with packets, here is how it creates one of them.

    Code:
    BEGINPACKET( pak, 0x07a8 );
    
    ADDWORD( pak, 0x8746 ); // ??
    ADDWORD( pak, thisclient->posMap ); // MAP ID?
    ADDFLOAT( pak, thisclient->pos.x*100 ); // POSITION X
    ADDFLOAT( pak, thisclient->pos.y*100 ); // POSITION Y
    ADDWORD( pak, 0x0001 ); // IM NOT USING IT EVEN THOUGH I SHOULD
    for(int i=0; i<58; i++) ADDBYTE( pak, 0 ); // Dunno what the ........ this is for
    thisclient->SendPacket( &pak );
    Now if you run this program its just a console ( like cmd ) and I would like to see what packet it sends in that console so it should be something like this

    Code:
    Log( MSG_GMACTION,"packet send:", ????????????
    and then in the console it would show like : [GM ACTION] : packet send: 7a8 xx xx......

    any help ?

    btw : I just started learning c++, dont be harsh

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    > btw : I just started learning c++, dont be harsh

    Why is it then you are trying to do this? Why not just... learn the programming languages instead?

    As for your specific problem... that's not standard C++. What's the library? What are ADDFLOAT, pak, ADDBYTE, etc? Too vague.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to recieve all packets coming to machine??
    By shady_Dev in forum Networking/Device Communication
    Replies: 6
    Last Post: 03-29-2008, 10:21 AM
  2. Accessing and editing packets of other applications
    By Inder in forum Linux Programming
    Replies: 1
    Last Post: 09-01-2006, 12:00 PM
  3. Recieve packets
    By valt in forum C++ Programming
    Replies: 9
    Last Post: 02-04-2006, 12:41 AM
  4. Adding delay to all packets (incoming and leaving)
    By ingtabby in forum Windows Programming
    Replies: 1
    Last Post: 01-31-2006, 10:33 AM
  5. establish a connection using TCP and capture the incoming packets
    By shraddha in forum Networking/Device Communication
    Replies: 12
    Last Post: 10-22-2005, 02:15 AM