From: <dee...@gm...> - 2011-01-27 16:16:12
|
Hi I am working on common library for tux4kids and have found way so that servers can communicate. I want to know which information is to be sync.between server except scores or student and I also want implement a facility so that performance report of students can be generate. Can some one help me regarding this thing. Sent from my HTC |
From: deepak a. <dee...@gm...> - 2011-02-01 16:58:59
|
>At least for me, I would just like to be able to support more than one >network game at a time from a single machine, eventually. Most likely >this will be a single server program that can handle multiple >simultaneous games. Whether or not it involves a separate thread for >each game is not essential, likewise we may or may not open a separate >port for each game. I guess running multiple instances of the same >program on the same machine is another possibility, if we work out a >way to assign all the ports correctly. > David I am trying to implement exactly this thing :- What i am trying to do is that first client connect to permanent/master port then the server will send the new port number to client where a particular game is hosting by server. I find out a way so that multiple ports can be initialized easily work correctly. There is lot of work to done yet i.e reading code throughly and understanding it. Please send me email address so that i can send files to you. Is there anyone who can send me short outline of how server is implemented so that i can avoid unnecessary things and able to understand things more correctly. |
From: David B. <dav...@gm...> - 2011-02-01 17:28:40
|
Hi, On Tue, Feb 1, 2011 at 10:58 AM, deepak aggarwal <dee...@gm...> wrote: >>At least for me, I would just like to be able to support more than one >>network game at a time from a single machine, eventually. Most likely >>this will be a single server program that can handle multiple >>simultaneous games. Whether or not it involves a separate thread for >>each game is not essential, likewise we may or may not open a separate >>port for each game. I guess running multiple instances of the same >>program on the same machine is another possibility, if we work out a >>way to assign all the ports correctly. > >> David > > I am trying to implement exactly this thing :- Which one? I see you want to open a separate port for each game. Do you want to have a single instance of the server program be able to handle multiple simultaneous games and if so, are you going to spawn a separate thread for each one, or use an old-style fork() call? Or, is a separate program going to be launched to handle each game? > Please send me email address so that i can send files to you. This is going to be much better handled with a (remote) git branch. You need to know how to use git to contribute to our project. So, go to our alioth website, ask to be added to the tux4kids project, and make a "read/write" clone of the tuxmath repository. Then you can make your branch and start working in a way that lets all of us test out and help with your work. > Is there anyone who can send me short outline of how server is > implemented so that i can avoid unnecessary things and able to > understand things more correctly. The server code is in server.c. It is written so it can be invoked either in a pthread or as a standalone program. For the latter, servermain.c contains a small main() function that calls the RunServer() function from server.c (with some init and cleanup). RunServer() contains the main loop for the server. To let the clients connect, RunServer() sends out periodic UDP broadcasts. The clients respond by sending back the information needed to establish a TCP connection. Once connected, the server listens for incoming messages and responds with appropriate outgoing messages. The incoming messages are mainly about math questions that have been answered. The outgoing messages are new questions and other notifications (new wave, names and scores of connected players, game over, etc). The clients disconnect from the server when the game ends. Once the game is over, the server is supposed to be ready to accept connections to start a new game. The client network code is in network.c and game.c for the full graphical game. There is also a command-line client in testclient.c, but last I checked it isn't working. We probably should get the testclient working again if we are going to do a lot of work on the server program. Hope that helps, David Bruce |
From: David B. <dav...@gm...> - 2011-02-01 18:48:09
|
Hi Deepak, > For this :- > 1. First i initialize a thread pool(dynamically), pushed them in a > stack and put them into a > waiting state. > 2. Whenever we want to run a thread then a thread( refer by thread > ID ) and then > activating them. > 3. When a particular thread complete it's task it pushed itself > into a stack and then gets to > waiting state So it looks like a single server program, with a separate port and thread for each game. That sounds like the most elegant way to do it (or at least it will be really cool once it is finished and debugged). > One thing i forget to ask that which library are we using for > handling thread on window platform. Till now i am using pthread > library(on linux) for handling thread and it can be easily converted > in SDL library function for handling thread. > I currently make the windows releases by cross-building from Linux using mingw-cross-env: http://mingw-cross-env.nongnu.org mingw-cross-env contains pthreads from: http://sourceware.org/pthreads-win32 Hope that helps, David |
From: David B. <dav...@gm...> - 2011-01-27 17:03:18
|
Hi Deepak On Thu, Jan 27, 2011 at 10:15 AM, dee...@gm... <dee...@gm...> wrote: > Hi > I am working on common library for tux4kids and have found way so that > servers can communicate. > I want to know which information is to be sync.between server except scores > or student and I also want implement a facility so that performance report > of students can be generate. > Can some one help me regarding this thing. I'm not so sure what you are working on - I'm getting the idea that your work is more along the lines of our unfinished t4k-admin project, rather than the server for the tuxmath LAN game specifically, which is what I thought you meant in your earlier post. For the last two summers we have had a GSoC project to make a comprehensive administration tool for tuxmath and tuxtype using the Qt4 gui toolkit. The idea is to make the programs "enterprise-ready" so to speak for teachers and schools. A lot of code has been written but we've not had any package releases. The git repository for t4k-admin is at our alioth site, alongside our other projects. You should have a look at what has been done so far in that repo. Best, David Bruce |
From: Aviral D. <avi...@gm...> - 2011-01-27 17:35:11
|
On 27 January 2011 22:33, David Bruce <dav...@gm...> wrote: > Hi Deepak > > On Thu, Jan 27, 2011 at 10:15 AM, dee...@gm... > <dee...@gm...> wrote: > > Hi > > I am working on common library for tux4kids and have found way so that > > servers can communicate. > > I want to know which information is to be sync.between server except > scores > > or student and I also want implement a facility so that performance > report > > of students can be generate. > > Can some one help me regarding this thing. > > I'm not so sure what you are working on - I'm getting the idea that > your work is more along the lines of our unfinished t4k-admin project, > rather than the server for the tuxmath LAN game specifically, which is > what I thought you meant in your earlier post. > > For the last two summers we have had a GSoC project to make a > comprehensive administration tool for tuxmath and tuxtype using the > Qt4 gui toolkit. The idea is to make the programs "enterprise-ready" > so to speak for teachers and schools. A lot of code has been written > but we've not had any package releases. The git repository for > t4k-admin is at our alioth site, alongside our other projects. You > should have a look at what has been done so far in that repo. > > Best, > > David Bruce > > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better > price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________tly > Tuxmath-devel mailing list > Tux...@li... > https://lists.sourceforge.net/lists/listinfo/tuxmath-devel > About your first mail, I didn't quite get what you meant by "automatic allocation of ports". IMHO, for games, there's a static server port on which the server *listen*s for connections from clients, and once a connection is *accept*ed, the server *send*s and *rec*ei*v*es data (on an implicitly bound port; explicitly binding isn't necessary) per client. The reason why TuxMath can't handle running multiple servers atm. is that MathCards (the part of TuxMath) that generates data uses file level variables to maintain state. I had started some work on fixing that, and it should be ready soon (read: *sometime in the future*) About the "syncing" thing, things are synchronized between the server using messages and the main "things" that are synced are: 1. Player Names 2. Player Scores 3. Questions (I believe this is now Question - one at a time) -- Regards, Aviral |
From: Brendan L. <bm...@ri...> - 2011-01-28 01:13:49
|
Hey Aviral, > About your first mail, I didn't quite get what you meant by "automatic > allocation of ports". IMHO, for games, there's a static server port on which > the server *listen*s for connections from clients, and once a connection > is *accept*ed, the server *send*s and *rec*ei*v*es data (on an implicitly > bound port; explicitly binding isn't necessary) per client. The reason why > TuxMath can't handle running multiple servers atm. is that MathCards (the > part of TuxMath) that generates data uses file level variables to maintain > state. I had started some work on fixing that, and it should be ready soon > (read: *sometime in the future*) > > Man, have I been out of the loop. I'm trying to understand here...we want to run multiple instances of the server on a single machine? Or does this involve the client connecting to more than one server? In any case, it sounds like there's some good stuff happening :) Best, Brendan |
From: David B. <dav...@gm...> - 2011-01-28 02:30:37
|
Hi Brendan, > Man, have I been out of the loop. I'm trying to understand here...we want to > run multiple instances of the server on a single machine? Or does this > involve the client connecting to more than one server? At least for me, I would just like to be able to support more than one network game at a time from a single machine, eventually. Most likely this will be a single server program that can handle multiple simultaneous games. Whether or not it involves a separate thread for each game is not essential, likewise we may or may not open a separate port for each game. I guess running multiple instances of the same program on the same machine is another possibility, if we work out a way to assign all the ports correctly. However, for now I just want our single-game, single-thread, single-port server to be fully functional. We are still at the stage of adding basic things like stopping the server and changing the selected lesson without having to exit and restart the entire tuxmath program. David |