Giter Site home page Giter Site logo

gamechain's People

Contributors

adyromantika avatar andreipope avatar bikashdas avatar enlight avatar gauravgitlab avatar hankxdev avatar mattkanwisher avatar parthdesai avatar pathornteng avatar phoorichet avatar sara-loom avatar sekl avatar sidmutha avatar zimm-lostpolygon avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gamechain's Issues

[Backend] Account Service

We need an account server for the user to sign up and login from the GUI and keep data to Dapp.

Functionality:

  • Sign Up

  • Login

Fetching ListDecks, when there is no deck

Getting an error when try to fetch getDeck when all the decks are deleted.
Should not return null reference
Should return empty array

Error
===== Deck Data Not Loaded from Backed ===== System.NullReferenceException: Object reference not set to an instance of an object

Research On Randomness

The game uses a lot of randomness. For example:

  • Draw a card
  • Random Attack
  • Random summon zombies.
  • more..

The contract must be able to generate random number without any consensus error when running on multiple validators.

Add Integration Test on Deck

Test cases to cover:

  • List
  • Get
  • Create
  • Update
  • Delete

Tasks:

  1. Get basic understanding of e2e test. See function TestE2E in e2e/e2e_test.go
  2. Create a new yaml test case in e2e. Examples can be found in e2e/test_cases.yaml
  3. Add more test cases to send a request in RunCmd and check validity of the output in Expected
  4. Run the test make test

Add Deck

Always have to Add Deck with Hero id and 0 Cards

"heroId": 0,
     "name": "Deck 1",
     "cards": []

[Backend] Add PurchasePack

Requirements From frontend:

/purchasePacks POST
Sent parameters:
Packs: Int, number of packs the user has purchased. This increases the Packs parameter of the player profile
Based on the purchase method and platform, the server might want to have some security checks to validate the purchase.

More meaningful output format when running cli

Currently we have commands:

  • create_account
  • get_account
  • update_account
  • get_decks
  • create_deck
  • delete_deck

But when running these command, we get nothing back or just simple Go struct e.g.

{loom false false false Image2 false 0 0 3 [100 101 102 97 117 108 116 0 74 190 12 219 233 52 88 240 118 171 244 175 157 83 214 185 225 216 103 226]}

The requirements for this issue it to format output so that it can be find by e2e test, which relies on finding patterns on standard output and error

Also, the input to command line should be minimal so we can add it in test cases.

Account Integration with LoomAuth

The game play should allow the user to login using the account from LoomAuth.

Ref: Account Flow

  • Setup local Vault server to work with LoomAuth
  • Authenticate user in LoomAuth
  • Create and Store private key in Vault
  • The frontend fetches the private key in Vault
  • Get user information

Delete Default Deck

Client side is able to delete default Deck.
but server side is not allow deleting default deck.

[Backend] Init Card and Collection

We need to provide 2 functionality for the unity client so that the client can have a view of cards and collection. We can now just fix the data in the init call when deploying the contract.

  1. Card
  2. Collection

GetDeck Error

Getting an Null from Backend, When there is no deck available.
Should not return Null.

it should have empty array
{
"decks": []
}

Merge Frontend with `playtest`

Try to merge some code that connects to backend to the playtest branch.

The backend method calls currently supported:

  • Account
  • Deck

[Backend] Card contract functionality

Card contract should support the following functionality:

  • List(addr loom.Address)
  • Get(addr loom.Address, cardID string)
  • Total(addr loom.Address, cardUID string)
  • Transfer(to loom.Address)

Not able to add Deck

There are some scenario when player select some cards while creating new deck or edit deck, but not able to save deck or add deck because of following exception
you cannot add more than 0 for your card id: 0

[Backend] Add OpenPack

Requirements from frontend:

/openPack GET
 
Called once every time a user opens a pack.
Upon checking that the user has indeed a pack to open (Packs parameter of profile), it will decrease the Packs parameter of 1. Will return:
cardsFound: [id1, id2, id3, id4, id5], the server returns an array of strings, containing 5 ids (or the number of cards that can be found in each pack), chosen randomly based on the rarity of the cards. It also immediately adds those 5 cards to the Collection parameter of the user profile. The client will then show the new 5 cards to the user.

[Backend] Refactor cli

  • Remove PersistentPreRunE because not all the command need PrivKey and RPC
  • Group all the init functions in to one init function. [optional] - styling choice

[Backend] Refactor Code

Styling

  • rename filename using Go's convention.
    e.g. createAccount.go --> create_account.go
  • reformat error message using golinter
    e.g user already exists.\n -> no ., no \n,
    fmt.Errorf("invalid JSON passed in value field. Error: %s\n", err.Error()) -> no ., no \n
  • the name of cli subcommand should be all small letters:
    ./bin/cli createAccount --> should be create-account or create_account

Functional

  • change the method receiver that does not internal state to just a normal function.
    e.g. func (z *ZombieBattleground) deleteDecks(...) --> should be just deleteDecks(...)

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.