GithubHelp home page GithubHelp logo

nathanielgraham / mojo-poker Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 1.0 4.99 MB

Poker Client and Server built with the Mojolicious Framework

License: Other

Shell 0.29% Perl 45.50% CSS 8.56% JavaScript 26.02% HTML 0.21% Raku 19.41%
poker server mojolicious client perl poker-game-server

mojo-poker's Introduction

Mojo Poker Logo

[Build Status]

Mojo Poker is a web-based poker system that allows anyone to run their own private poker site.

Features

Includes all the clasics plus a large selection of offbeat games: Hold'em, Hold'em Jokers Wild, Pineapple, Crazy Pineapple, Omaha, Omaha Hi-Lo, 5 Card Omaha, 5 Card Omaha Hi-Lo, Courcheval, Courcheval Hi-Lo, 5 Card Draw, 5 Card Draw Deuces Wild, 5 Card Draw Jokers Wild, 2-7 Single Draw, 2-7 Triple Draw, A-5 Single Draw, A-5 Triple Draw, 7 Card Stud, 7 Card Stud Jokers Wild, 7 Card Stud Hi-Lo, Razz, High Chicago, Follow the Queen, The Bitch, Badugi, Badacey, Badeucy, Dealer's Choice.

SCREENSHOT

Install

Tested on Ubuntu 16.04. Other distros might require tweaking. Begin with a newly installed, "clean" install of Ubuntu 16.04. Issue the following commands in your terminal session:

cd /tmp
git clone https://github.com/nathanielgraham/Mojo-Poker.git
cd Mojo-Poker
sudo ./install

Starting the server

Issue the following command in your terminal session:

sudo systemctl start mojopoker.service

Now point your browser at http://localhost:3000

Creating new tables

To create a new six handed No-Limit Hold'em table for example, issue the following command:

/opt/mojopoker/script/mpadmin.pl create_ring -game_class holdem -limit NL -chair_count 6

See mpadmin.pl --help for a complete list of options.

Admin tool

mpadmin.pl is a command-line ultility for creating and deleting ring games, editing player info, crediting chips, and other admin tasks. For a complete list of options, type:

sudo /opt/mojopoker/script/mpadmin.pl --help 

Advanced websocket shell

wsshell.pl is a command-line utility for sending JSON encoded WebSocket messages directly to the server. Useful for automating certain tasks. To bulk load many games at once for example, issue the following command in your terminal session:

sudo /opt/mojopoker/script/wsshell.pl < /opt/mojopoker/db/example_games

Running in production

Additional steps to run a secure site:

  • Facebook login feature won't work without a registered domain
  • Setup nginx as reverse proxy to provide SSL/TLS certificate
  • Change admin password
  • Add firewall for DDOS protection
  • Anything else?

See Mojolicious::Guides::Cookbook. You can also contact me directly if you need additional support.

Contact

Questions and bug reports to [email protected]

TODO

  • Add support for tournaments
  • Change hand evaluator to Poker::Eval

COPYRIGHT AND LICENSE

Copyright (C) 2019, Nathaniel J. Graham

This program is free software, you can redistribute it and/or modify it nder the terms of the Artistic License version 2.0. https://dev.perl.org/licenses/artistic.html

mojo-poker's People

Contributors

nathanielgraham avatar

Stargazers

 avatar  avatar

Forkers

fapulito

mojo-poker's Issues

Ubuntu Server 22.04

Installed fine, but on sudo systemctl start mojopoker.service I get :

Job for mojopoker.service failed because the control process exited with error code.
See "systemctl status mojopoker.service" and "journalctl -xeu mojopoker.service" for details.

There's nothing interesting in details.
This works only with 16.04 ?

EDIT:
Actually there are some details, there seems to be a problem with route, if I comment out those lines with it, then it starts, but when accesing a page on port 3000, I get a webpage saying "raptor not found"

Oct 24 01:50:30 instance-20221024-0111-poker systemd[1]: Starting Mojo Poker...
Oct 24 01:50:31 instance-20221024-0111-poker mojopoker.pl[1454]: Can't locate object method "route" via package "Mojolicious::Routes::Route" at /opt/mojopoker/lib/Ships.pm line 49.
Oct 24 01:50:31 instance-20221024-0111-poker systemd[1]: mojopoker.service: Control process exited, code=exited, status=255/EXCEPTION
Oct 24 01:50:31 instance-20221024-0111-poker systemd[1]: mojopoker.service: Failed with result 'exit-code'.
Oct 24 01:50:31 instance-20221024-0111-poker systemd[1]: Failed to start Mojo Poker.
Oct 24 01:50:31 instance-20221024-0111-poker systemd[1]: mojopoker.service: Consumed 1.256s CPU time.

EDIT 2:
Never mind, I found the solution to that.

Websocket close after login

Hello Sir,
After login web socket is closing.
script modification is done with valid username and password and bookmark provided for same.

    $tx->send('["login", { "username": "test" , "password": "test" }]');
 
 # $tx->send('["login_book", {"bookmark":"dc17c0317495691235faf2ba1063278f08e2a524"}]');

Script output

perl wsshell.pl

server: ["login_res",{"block":{},"level":2,"remote_address":"127.0.0.1","handle":"test","last_visit":1558971007,"username":"test","birthday":null,"bookmark":"8bc55bb6f39c7fc446dccac859e5e2749821ba80","login_id":24,"invested":{"1":2000},"success":1,"chips":{"1":2000},"user_id":2,"email":null,"ring_play":{}}]

WebSocket closed with code 1005.
WebSocket closed with code 1005.

Getting no clue about the issue can you help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.