npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

com.hashbang.showdown

v1.1.6

Published

Hashbang Showdown card game server & client

Downloads

4

Readme

Showdown Cadence Engine & Client

Showdown is a two player card game similar to poker. It's cadence is driven by a Beamable set of microservices and has a client that can listen for messages from the miroservice.

Microservice Engine

The Microservice engine consist of two files and the Beamable microservice will generate the Client File which is then wrapped by ShowdownClient

There are three main parts to the Engine, CommonModels, MatchCadence & MatchInfo

CommonModels - This file holds all the shared models between the client and the server

MatchCadence - This is the Microservice which has multiple client callable API's. The auto generated client will look at this to determine which Client API's to include.

  • As a child of MatchCadence there is a MatchCadenceService which is used as a helper class which provides helper functionality functions.

MatchInfo - This holds the recference to create the MongoDB Microservice Storage capabilities. For the most part no one should ever need to modify this.

Note: You will need a Beamable Realm for this Engine to work.

Installation of The Unity Package

Note: Upon installation of this package it will be broken, this is normal.

Once you have installed the latest version of this package you will need to install the autogenerated client so that the project can compile without errors. To do this:

  • Install the sample for AutoGenerated Files
  • Copy to files in that folder to /Assets/Beamable/AutoGenerated/Microservices

    If there is already a beamable.autogenerated file in this folder in your project already then only copy the .cs files.

  • Click on the ASMDEF file named beamable.autogenerated and change the name in the name property from beamable.autogenerated_samples to beamable.autogenerated.

Initializing a client

To initialize the client for a player, pass in a matchId which should be obtained by whatever matchmaking system and a playerId. PlayerId for Beamable can by found on the context.playerId.

var client = new ShowdownClient(_matchId, _player);
client.Initialize();

Standard API

CreateJoinMatch () - Creates a match based on MatchId if one exists it will join that match instead.

ReadyForCards () - Sends a signal to the server that the player is ready to receive new cards. This typically happens at startup & when player receives notification of the next round.

ConfirmHand (IEnumerable<CardHand>) - This will create a card submission to the server sending the GUID's for the cards they are Playing this round from their hand.

ConfirmWager (IEnumerable<CardHand>, int) - This will confirm the hand & set a wager to the server which is used by the server to evaluate the hand and bet cadence. When both players submit this it triggers a Resolution of the hand to determine if the hand was won or lost or if a player needs go to a call/fold scenario.

Destroy - Call this when a player has been removed or the game stops to cleanup all subscriptions.

Events

UnityEvent<JoinedNotification> OnJoined - this event is fired when a player has joined the match

UnityEvent<List<CardHand>> OnHandDealt - This event is fired when a player has been dealt new cards.

UnityEvent<string,int> OnOtherPlayerHandDealt - This event is fired when the other player received their cards

UnityEvent<List<CardHand>> OpponentConfirmedHand - This event is fired when the other player has confirmed their hand

UnityEvent<DamageNotification> OnDamaged - this event is fired when players receive / report damage

UnityEvent<NextRoundNotification> OnNextRound - this event is fired when a round is started / incremented

UnityEvent<GameOverNotification> OnGameOver - this event is fired when a the game ends

UnityEvent<bool, CallFoldNotification> OnCallFold - this event is fired when a player is required to call or fold due to a bet mismatch. (e.g. Poker term: Raise)