|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [gameprogrammer] Re: Multiplayer networking advice
oh cool, so you know databases (: I do a little web dev too so know where you are coming from. DB's in C++ are basically the same as in PHP, that would be real easy for you to use if you chose to. You wouldn't want to use DB's to keep track of data you access every frame or anything like that, but storing login information and player data and even keeping a server log in a database wouldn't be such a bad thing. You could even have a php script that queried the DB to see who was on so people could go to a website to see them (and even chat with them in game from the site?). It could be pretty cool to integrate the 2 things together. For keeping track of IP's, if you open a socket with TCP/IP you would want to keep that socket open until the player quits the game. Having to re-open the socket every time you want to send or receive data would really be a pain for you, the server, and the network! (: If you use UDP, you would have to remember an IP address but Chris is probably right in that you should avoid UDP until it's time to optomize (if you even need to). IMO multi threading is essential for programming a server, you should deffinately check into that stuff I think. On Jan 27, 2008 6:33 PM, Taylor Peterson <assbone@gmail.com> wrote: > > Would this be for security reasons, to know what IP's have logged in > > for each account? If you know how to use a database (or feel like you > > want to try!) that may be a good place to log the ip address info > > since it handles the storage in memory / to files issue for you. You > > could also store login information and even maybe player data in the > > database tables, which would give you a neat interface to be able to > > quickly update or search through your data. > > Well.. I meant to keep a list of IPs to send data too with it. Like > whenever data is sent, the server looks at that list then sends the > data to each IP on that list. But I see what your saying with > threads, although my knowledge of threads is a bit limited; I'm heard > of them but have not really gotten into using them. > > I know databases, but I've never used them with c or c++ only php. > > So I guess I'll go into looking up threads. > > > On Jan 27, 2008 8:07 PM, Chris Nystrom <cnystrom@gmail.com> wrote: > > > > On Jan 27, 2008 6:56 PM, Alan Wolfe <alan.wolfe@gmail.com> wrote: > > > > > > > > TCP/IP vs UDP > > > > > > If you don't know the difference between TCP/IP and UDP, TCP/IP is > > > reliable transmisions while UDP is not necesarily reliable, but is a > > > lot faster with less overhead. If you have things in your game that > > > if the information doesn't get to the player on a rare basis you'd be > > > ok with it, you might want to check out using UDP for those thing, and > > > using TCP/IP for the things that really really matter. You can > > > squeeze a lot more network preformance out of your game that way. > > > > I have found that UDP is a little more difficult to work with. I think > > going straight to UDP might be a premature optimization. I suggest > > keeping it simple and start with TCP and then if you have performance > > issues, try UDP to see if it helps. > > > > Chris > > > > > > > > > > --------------------- > > To unsubscribe go to http://gameprogrammer.com/mailinglist.html > > > > > > > > > > -- > -Taylor Peterson > > > --------------------- > To unsubscribe go to http://gameprogrammer.com/mailinglist.html > > > --------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
|
|