简体   繁体   English

为多个客户建立一个交互式网站

[英]Building an interactive website for multiple clients

I am a programming novice, so please forgive the technical ambiguity here. 我是编程新手,因此请原谅此处的技术歧义。 I will try to be as specific as possible about what I am trying to accomplish. 我将尽可能地具体说明我要完成的工作。

I am trying to build an interactive website where multiple clients can log on and view a board game. 我正在尝试建立一个交互式网站,多个客户可以在该网站上登录并查看棋盘游戏。 The board game consists of regions on a map with color (player who controls it) and number (armies) variables, as well as draggable tokens. 棋盘游戏由地图上具有颜色(控制它的玩家)和数字(军队)变量以及可拖动标记的区域组成。

I have built a client-end version in JavaScript using the Raphael interface for SVG graphics, and would like to build a server that can process any changes one client makes to the board and update the boards of the other clients. 我已经使用用于SVG图形的Raphael接口在JavaScript中构建了客户端版本,并且希望构建一个服务器,该服务器可以处理一个客户端对板所做的任何更改并更新其他客户端的板。 In my mind, the sequence would be something like: 在我看来,序列将类似于:

  1. Action performed by the user 用户执行的操作
  2. Action listener updates client view 动作侦听器更新客户端视图
  3. Update sent to server 更新已发送到服务器
  4. Server changes database to reflect change 服务器更改数据库以反映更改
  5. Server notifies all clients 服务器通知所有客户端
  6. Clients update view 客户更新视图

I've read up on Ajax/XML a bit, but the tutorials I have found have mostly been about getting static data, and I haven't seen an example of actually CHANGING dynamic data on a server, nor have I been able to find any examples of what the server functions should look like. 我已经阅读了一些有关Ajax / XML的文章,但是我发现的教程主要是关于获取静态数据的,并且我还没有看到在服务器上实际更改动态数据的示例,也没有找到服务器功能应具有的任何示例。

So basically my question is, can anyone point me in the right direction here? 所以基本上我的问题是,有人可以在这里向我指出正确的方向吗? I would very much appreciate a general outline about how I could go about accomplishing this, as well as direction to a tutorial or two that relates to the task. 我将非常感谢有关如何完成此任务的概述,以及与该任务有关的一两个教程的指导。 Thank you! 谢谢!

You may look at nodeJS and socket.io. 您可以看一下nodeJS和socket.io。 With this technology it is possibile to create real time web applications. 利用该技术,可以创建实时Web应用程序。

Its a bit older, but here is a game we did some time ago: https://github.com/stravid/unitacs It also uses raphaelJS. 它有点旧,但是这是我们前一段时间做的游戏: https : //github.com/stravid/unitacs它也使用raphaelJS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM