954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Packets?

Alrighty, ur in the game you click a NPC, you click to buy an item. It then sends a packet to the server seeing if you have enough money an so on if you do it sends a packet back? Would that be correct? If not can someone help me?

Tauren
Junior Poster
108 posts since Oct 2006
Reputation Points: 9
Solved Threads: 0
 

You're talking about network programming. You send packets through sockets in C, which allows you to setup a client-server interface. Here is a good tutorial on sockets.

Next time try googling around before asking a question; googling for "packets" would have brought up a wealth of information that would have answered your question.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

Are you using *nix or Windows. For Linux you can basically learn off the manual documentation (i.e man 7 socket). For Windows socket programming I recommend referrencing the Microsoft's website http://msdn2.microsoft.com/en-us/library/ms740673.aspx it'll provide documentation and tutorials for both Winsock and Winsock 2 programming.

For you question my answer is no, usually a client side module or program will check to see if you've got enough money to buy something. As for updating your current balance, sometimes the client will buffer and send an update at certain intervals or might just send it when the current balance changes; it all depends is what I mean.

Good luck, LamaBot

Lazaro Claiborn
Junior Poster
171 posts since Jan 2007
Reputation Points: 11
Solved Threads: 13
 

Any good books on networking in c++ With packets and stuff

Tauren
Junior Poster
108 posts since Oct 2006
Reputation Points: 9
Solved Threads: 0
 

Perhaps there's not better place than to learn than from the creator of the language, that is, Bjarne Stroustrap. C++ Network Programming Volume 1
C++ Network Programming Volume 2

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 
Perhaps there's not better place than to learn than from the creator of the language, that is, Bjarne Stroustrap.


Small correction, those are not written by Bjarne Stroustrup. Good books though.

WolfPack
Postaholic
Moderator
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You