vampserv / node-poker-stack

node.js based poker game server and HTML5 web client
125 stars 95 forks source link

install has errors #5

Closed telostia closed 6 years ago

telostia commented 6 years ago

has issues with installing and cannot run server. heres the debug file: npm-debug.zip

below is the runtime error: installerror

LeXXik commented 6 years ago

I doubt anyone maintains this any longer. Pity.

telostia commented 6 years ago

Ok. I got it to work. For anyone that's interested. heres the instructions how to run it(at least how I did it): Before you begin uninstall all previous node.js or npm on system and even clear caches or delete node directory just to be safe.

  1. download latest node.js(for me its x64 windows so i downloaded 6.11.2) and install it on your system.
  2. clone project by typing git clone https://github.com/vampserv/node-poker-stack.git
  3. cd node-poker-stack:
  4. Install pomelo globally(on windows it installs to C:\Users[yourusername]\AppData\Roaming\npm\node_modules): npm install -g pomelo
  5. install game: sh npm-install.sh
  6. run webserver: node web-server/app
  7. open another bash and run game server: cd game-server pomelo start
  8. open web browser and load page: localhost:3002

9 If everyone went well. try to register and user name and password and u will be able to login.

My result just to prove that it's working:

image

Have fun learning!

telostia commented 6 years ago

@delster you can try changing the package.json file to let pomelo install version 1.20. seems to work.

Heres my current version:

png

Im using windows 7 on this system.

One thing to note, this game uses gyp so you need to have python 2.7.6 installed to work build properly.

latest pomelo 2.2.5 can be installed and run globally though.

LeXXik commented 6 years ago

@delster I have installed the fork you linked on my Ubuntu. Haven't tried this one yet, but I am sure it is same. Had some issues with the installation at first. It was due to the node being new and I had to add an older version. You can check your log, after running the ./npm-install.sh. Not sure what error you have there. If you have the error with gyp failing to build it, then you can try another version of node. I am using nvm for managing my node versions. I switched to version 0.10.21. After that the installation went fine and I used node app --harmony from the game-server folder to start it.

telostia commented 6 years ago

@delster when you go and uninstalled the dependencies, it's best you cleared out all the caches including npm and node versions. This happened to me as the different versions was colliding with my build somehow. I'm not sure if it has any effects on the linux side as it did for me in windows, I will install a virtual machine for ubuntu later and will let you know if those setup works for that too. But it is best to start from scratch of all the dependencies including cache files with:
npm cache clean

Another note is try changing the pomelo ports to something else if you haven't already done it, since you're running on a server there might have been used ports.

telostia commented 6 years ago

@delster I have to be honest with you I haven't used linux for a while now so im not too familiar with environment so It might take a while for me to find my way around with cache locations and paths. That is why I will install a virtual machine to revise my memory. But if you don't mind I can try winscp and do abit of poking around though I can't guarantee I will succeed. On a side note. was the version of python u used is 2.7.x? if perhaps you're using both 2.7 and 3.x. that might cause problems too. try pomelo start in game-server command instead of node app. it will use the 2.2.5 version of global pomelo instead

telostia commented 6 years ago

@delster hold on. I found out that the github fork you had uses higher version of pomelo than this one. I'm getting the same error as you have so I'll be digging out the errors as of now. See if I could get it working and we'll proceed further.

telostia commented 6 years ago

@delster you mentioned you had this fork installed before? what was the version of npm,node were you using?

LeXXik commented 6 years ago

@delster Hmm, somehow I don't have the XMLHttpRequest error. Here is my output of running pomelo start:

image

image

image

telostia commented 6 years ago

@delster I think I know what the problem was. when you do a npm install -d command when changing nodes and doing it again it somehow corrupts the whole node_modules folder(or w/e happened in there...)

what I did to solve it was to build using old version of node.

  1. do nvm use 0.10.21(nvm install 0.10.21 64 to install it if you haven't got it) with the following settings in the package.json file:

image

  1. change to another version of node with: nvm use 4.8.4(maybe higher works I dunno but try this) now go to game-server folder and run: node app

image

What a pain in the ass this was. if you get errors chances are your node_modules folder got corrupted(easiest to tell is that you have alot more modules in it than you declared...)

So delete the node_modules folder before you do an npm install -d or npm-install.sh. That's my two cents :)

EDIT: maybe you don't need to change to version 4.8.4 but for me I use windows and --harmony doesn't seem to work. version 4.8.4 has the feature built in(something to do with ECMAScript 6)

telostia commented 6 years ago

@delster I don't think the new fork is without errors so you might have to go into the code and fix it yourself.

When I tried the following settings:

[package.json]

"dependencies": { "pomelo": "^2.2.5", "crc": "0.2.0", "hoyle": "^0.2.2", "node-uuid": "^1.4.1", "pomelo-logger": "^0.1.6", "redis": "^2.7.1" }

and build using node 4.8.4 globally(reason globally is so that I could use command pomelo list to see whats being running) image

Although I see some errors, it doesnt affect the gameplay. image

Heres the SS during play image

You can edit the index.html file and change the socket.io.js to something like latest

for example, to me i noticed a boost in reaction time but it's just my feelling.

Good luck with code! I will be making my own poker type server(and something like unity or phaser js client for mobile devices whichever is more feasible) based on this code soon. Hopefully nothing major goes wrong, if not i could fall back to just using without pomelo and using just redis itself like how this guy did it https://github.com/floatinghotpot/casino-server. So if all goes well, I could come back and adjust this codebase to have mongodb or mysql database and with a proper client for the masses.(big plans... so hopefully things go smooth :) )

telostia commented 6 years ago

@delster Not sure about that error but It doesn't sound like it from the game itself. are you running local host or over the net?

telostia commented 6 years ago

@delster wouldn't it be more stable to run this main branch than the fork branch?

telostia commented 6 years ago

No. what i meant was . where is the client running on? from server or from another device

telostia commented 6 years ago

the same theory applies to this branch too. I tried both, works flawlessly

LeXXik commented 6 years ago

@telostia by the way, those errors in the console, which as you mentioned do not affect the gameplay, are caused by game-server/node-modules/pomelo/lib/sioconnector.js, which is sending socket.io some options, that are no longer supported. The list of supported options can be found here. You can safely comment out those options to remove the console errors.

EDIT: Looking forward for mongodb and redis integration :)

LeXXik commented 6 years ago

Another point I wanted to mention regarding using pomelo start vs node app.js --harmony is that pomelo start is preferred.

image

From pomelo wiki:

It can be seen from the figure, the process "pomelo start" will spawn a child process, which execs "node app.js env = development", and then the child process will spawn a series of child processes, all the child processes exec same orignal file "app.js", but with more parameters, such as id, serverType, port and so on.

telostia commented 6 years ago

@LeXXik thanks for the heads up. Are you one of pomelo's developer? I see you have updated the pomelo-framework overview. --harmony doesn't work in my case so that's no good. About the socketio I see because the fork used higher version which then made the errors pop up. Does that mean I have to build a pomelo version of 2.2.5 and manually comment it out?

telostia commented 6 years ago

instead of building, I went and comment like this:

//sio.set('path', '/socket.io'); sio.set('transports', this.opts.transports); //sio.set('close timeout', this.closeTimeout); //sio.set('heartbeat timeout', this.heartbeatTimeout); //sio.set('heartbeat interval', this.heartbeatInterval); //sio.set('heartbeats', this.heartbeats); //sio.set('log level', 1);

which results as:

image

EDIT: Which would mean that pomelo doesn't use the latest socketio?

LeXXik commented 6 years ago

@telostia Nope, I am not related to pomelo project. I only made some minor changes to the wiki pages.

You can leave heartbeat timeout and heartbeat interval uncommented. Pomelo will convert them to pingTimeout and pingInterval respectively, which are supported.

And regarding your question, I am not sure what would be the best way to proceed. Ideally, NetEase team should update their framework of course. However, they probably no longer support it, or not very actively.

EDIT: And no, it doesn't use the latest socket.io. I believe it uses v1.7.2.