简体   繁体   English

需要多人游戏服务器配置的建议

[英]Need Advice for a multiplayer game server configuration

I'll try to be as clear as possible, but english is notmy native language ;) 我会尽量保持清晰,但英语不是我的母语;)

What I want to do is to create a "join this game" interface. 我要做的是创建一个“加入此游戏”界面。 This will consists of different pages : 这将包含不同的页面:

  1. The "Connect Page" : if a user is not logged-in, he'llbe redirected here. “连接页面”:如果用户未登录,则将其重定向到此处。
  2. The "General Page" : the players can join created games or can create his own game room. “常规页面”:玩家可以加入创建的游戏,也可以创建自己的游戏室。
  3. The "Waiting Room" : when a player join or create a game, he goes to this waiting room. “等候室”:当玩家加入或创建游戏时,他将进入此等候室。
  4. The "In Game Page" : when the creator of the game thinks there's enough players, he launches the game and all those players are send in the game. “游戏中页面”:当游戏的创建者认为有足够的玩家时,他启动游戏,所有这些玩家都被送入游戏。

My problem here, is that I don't know if I should create a physical different page for each; 我的问题是,我不知道是否应该为每个页面创建一个物理上不同的页面。 or just have a single page and .html() everything. 或者只有一个页面,然后将.html()都包含在内。

For the moment, I have managed to create a secured connection and everything work fine. 目前,我已经设法创建了安全的连接,并且一切正常。 Exept that each time i change page, the session is destroy and I lose every datas. 每次我更改页面时,会话都被破坏,并且我丢失所有数据。

Here is my rep for code: https://github.com/Babas/croa 这是我的代码代表: https : //github.com/Babas/croa

Babas, I recommend you investigate angular and maybe the mean.js stack. Babas,我建议您研究有角度的,也许要研究mean.js堆栈。 Angular will provide you separate views necessary to compartmentalize your view logic without losing your socket.io connetion. Angular将为您提供必要的单独视图,以分隔视图逻辑,而不会丢失socket.io连接。 The MEAN stack will give you a common project structure for the server and client-side pieces. MEAN堆栈将为您提供服务器和客户端部分的通用项目结构。

https://angularjs.org/ https://angularjs.org/

http://meanjs.org/ http://meanjs.org/

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

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