problem with network code

This is a discussion on problem with network code within the Networking/Device Communication forums, part of the General Programming Boards category; Code: pacPos.dwSize = sizeof(PacketPosition); pacPos.dwType = PACKET_TYPE_POSITION; pacPos.fx = PlayerInfo[g_iMyPlayerId].x; pacPos.fy = PlayerInfo[g_iMyPlayerId].y; packet = (VOID*)&pacPos; hReturn = hrSendPeerMessage(-1,PACKET_TYPE_POSITION,packet); ... ...

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    4

    problem with network code

    Code:
    			pacPos.dwSize = sizeof(PacketPosition);
    			pacPos.dwType = PACKET_TYPE_POSITION;
    			pacPos.fx = PlayerInfo[g_iMyPlayerId].x;
    			pacPos.fy = PlayerInfo[g_iMyPlayerId].y;
    			packet = (VOID*)&pacPos;
    			hReturn = hrSendPeerMessage(-1,PACKET_TYPE_POSITION,packet);

    ...

    Code:
    				    vUpdateNetwork();
    					
    					DrawGLScene();					// Draw The Scene
    					SwapBuffers(hDC);				// Swap Buffers (Double Buffering)

    this code wont let me set a position for player one or player two, they both start at zero...

    i also would like to have someone help me optimize this program. its very small so if you would like to help email me at brian4u_2001@yahoo.com

  2. #2
    Registered User
    Join Date
    Sep 2010
    Posts
    4
    this code works fine but after the client joins... and updatenetwork is called... it resets all players to x:0 y:0 when i beforehand had them set to different locations. i am not sure how to fix this

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Since it did work at one time, the best I can suggest is that you go back over recent changes in your code and see if something you've changed is producing an "unintended benefit"

  4. #4
    Registered User
    Join Date
    Sep 2010
    Posts
    4
    thanks... i actually just fixed it... im not sure how but its doing what i want it to, so i must study the code more and understand it better, thanks for the help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with compiling code with option -O2
    By koushikyou in forum C Programming
    Replies: 16
    Last Post: 01-07-2009, 05:03 AM
  2. Problem with network code
    By cornholio in forum Linux Programming
    Replies: 1
    Last Post: 12-20-2005, 12:21 AM
  3. problem with selection code
    By DavidP in forum Game Programming
    Replies: 1
    Last Post: 06-14-2004, 01:05 PM
  4. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM

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