Need help with packets, I'm noob :p

This is a discussion on Need help with packets, I'm noob :p within the C++ Programming forums, part of the General Programming Boards category; I was looking trough a source I got and it works with packets, here is how it creates one of ...

  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
    Portugal
    Posts
    7,475
    > 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.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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-03-2006, 11:41 PM
  4. Adding delay to all packets (incoming and leaving)
    By ingtabby in forum Windows Programming
    Replies: 1
    Last Post: 01-31-2006, 09: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21