views:

73

answers:

4

Hi Folks

We Want to Create an online game like this.I think that ,this type of games have a scheduling software on web server. For Example : Player Click to create a resource And resource creation will be take a moment like 20 Minutes.(Every resource creation time will be different). This message will send to web server application but this message will not processed at same time for example must be processed after 20 Minutes. The web server application after getting the message must be put the order in the Queue.

We have Some big problems :

1- The Jobs must be complete by the web server application Even the player Exit the Game. I think that we must create something like Windows service on Web Server. Can we do it? or Is there a better way?

2- The Second problem depended on problem 1 .Because we will have many Jobs (every player can create 20,30 Jobs in every Loggin and we will have thousands of users) , So Our Scheduling System Must be Work On time . it's possible that , there is 100 , 1000 jobs in a same second , if application Can't Done Jobs in him Second will be use the next second Time and the next second jobs will shift to next second and etc. How We can do for this problem ?

Platform : .Net 3.5 On Windows 2003 Web server

Cheers

Asad Safari

Agile Coach , Scrum Master

A: 

Well the specific answer would depend on which technology/language/platform you're using. In java, check the scheduling services provided by Quartz to schedule jobs; and check JMS/MDBs to implement the asynchronous event processing you mention in question 2.

Ramiro Gonzalez Maciel
+2  A: 

On unix, use cron to schedule a script to run every minute - the script then handles all the jobs.

http://en.wikipedia.org/wiki/Cron

adam
A: 

I think my answer won't exactly fit your question but it will solve your problem. Both points at once.

First at all, why do you want to automatize the execution of this events? As far as I understand, you need to give the player access to his resource if and only if he created the resource an especific time ago.

Well, this is my solution: Insert a field in your resource model class named usable_since or something like that and, when the player create his resource, just set it the value of this field to the current time plus the desired waiting time.

In this way you beat the two problems:

  1. the resource will be usable even if the player gets offline and
  2. you just won't need to set up so big job handler, even with a million users.

I hope it helps. I wish you the best luck in developing the game. Make it fun!

Erik Escobedo
A: 

I Find Quartz.net . Is Quartz.net Useful tool for my Case? If User Exit Game , the Jobs Will Be Alive in Quartz.net?

asad