石英.NET网络游戏计划 [英] Quartz .NET for online game scheduling

查看:182
本文介绍了石英.NET网络游戏计划的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算创建一个在线即时战略游戏,将使用Quartz .NET在PostgreSQL数据库更新值。

I plan to create an online RTS game that will use Quartz .NET for updating values in a postgresql database.

下面是在游戏中的场景的一个例子。

Here is an example of a scenario in the game.

  1. 一个玩家将创建一个有建筑物是时间量将会完成之前。完成时间将计算并保存在数据库中。

  1. A player will create a building and there is amount of time before it will be completed. The completion time will be computed and saved on a database.

在生产建筑物的开始时,我将创建时置在建筑物的完成时间到达充当一个石英触发。触发器将启动,这将更新数据库提示该建筑已经完成了价值的工作。

Once the production of the building is commenced, I will create a quartz trigger that is set to act when the completion time of the building arrives. The trigger will initiate a job that will update a value on the database prompting that the building is already completed.

在这种情况下,我们可以得出结论,可以有一百的千石英触发器,可以创建给出了巨大的玩家对游戏号码。

In this scenario, we can conclude that there can be hundred-of-thousand of quartz triggers, that can be created given a huge number of players on the game.

下面是我的问题。

  1. 为石英适合这种网上申请?如果是的话,我应该有主办石英及其作业和触发器一个单独的服务器?应该是什么我的服务器的最低配置?

  1. Is Quartz appropriate for this online application? If yes, should I have a separate server for hosting Quartz and its jobs and triggers? What should be the minimum spec of my server?

如果石英不适合这个,有什么方法可以部分替代解决方案?我已经看到了很多与独特的完成单位生产时间处理网络上的在线即时战略游戏,建筑,但我没有想法实现它们。

If Quartz is not appropriate for this, what can be some alternative solutions? I have seen a lot of online RTS game on the web that deals with unique completion of productions times of units, building but I don't have ideas for implementing them.

感谢。

你的,

标记

推荐答案

至于说,你可以更新与预期完成时间数据库。此外,有可能是没有必要与你的客户在完成同步。你可以告诉客户:这个建筑将完成XYZ,除非我告诉你不同的

As said, you can update your database with the expected completion time. Also, there's probably no need to sync with your client on completion. You can tell the client: this building will be finished XYZ unless I tell you differently.

大多数的游戏服务器可能不使用的石英,但某些种类的事件循环。也;不要用你的数据库进行实时更新。做你更新的内存和写入通过后台获得更好的性能。在崩溃时,你只失去发生自上次通写操作的事件。

Most game servers probably don't use quartz, but an event loop of some sorts. Also; don't use your database for real-time updates. Do your updates in-memory and write through in background for better performance. In case of a crash you only loose the events that happened since your last write-through action.

这篇关于石英.NET网络游戏计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆