#ButiJS
ButiJS is a server-client application for the Catalan cards game: Butifarra
The server code is based on the node.js asynchronous asynchronous event-driven model.
##Server API
The server will respond to the following events
Used to identify the user with a name on the server.
Expects the player's name.
Returns the player's assigned name
Create a new game. The creator of the game will automaticaly join the game.
Expects the new game.
Returns the created game.
Make the current player join the game.
If the player is currently on a game should throw an error.
Watch the game selected game.
If the player is currently on a game should throw an error.
Add a bot to an existing game.
Returns the current game's on the server
Returns the current game's on the server
Sends messages to all the players connected on the server (public chat)
Expects a string message.
The following events are specific to the Butifirra game.
Notify the chosen thriumph to the server.
Roll a new card on the active game.
Fired when the player wants to make a contro.
##Client API
The client is supposed to recibe the following events.
Returns the server welcome message
Returns a message sent by the server
Fired when the info of the game has been updated.
A game (which the player plays) is started. All the game data is on the first parameter
The following events are specific to the Butifirra game.
Fired when the player has to make thriumph on the current round.
Returns the choiced thriumph of the current round.
Fired when the player has to select a card to move
Fired when a card has been played. Data contains the played card and the player who played it.
Fired when the move (4 played cards) is ended.
Fired when the move (4 played cards) is ended.
Fired when the player has the posibilty of make a contro.
Fired when the another player has countred the game.
Fired when the round is ended. It contains all the round info.
Fired when the game is ended. It contains all the game info.
##License
The MIT License (MIT)
Copyright (C) 2011 by Sergi Almacellas pokoli@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.