{"id":18280138,"url":"https://github.com/treasersimplifies/deeroftheantihero_dota","last_synced_at":"2025-04-09T04:49:50.280Z","repository":{"id":217579217,"uuid":"156559095","full_name":"treasersimplifies/DeeroftheAntihero_DotA","owner":"treasersimplifies","description":"A DApp based on EOS/EOSC, see readme for details.","archived":false,"fork":false,"pushed_at":"2018-11-18T14:31:52.000Z","size":40437,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T23:27:31.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treasersimplifies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-07T14:31:13.000Z","updated_at":"2024-04-25T15:09:11.000Z","dependencies_parsed_at":"2024-02-02T20:30:53.628Z","dependency_job_id":null,"html_url":"https://github.com/treasersimplifies/DeeroftheAntihero_DotA","commit_stats":null,"previous_names":["treasersimplifies/deeroftheantihero_dota"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treasersimplifies%2FDeeroftheAntihero_DotA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treasersimplifies%2FDeeroftheAntihero_DotA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treasersimplifies%2FDeeroftheAntihero_DotA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treasersimplifies%2FDeeroftheAntihero_DotA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treasersimplifies","download_url":"https://codeload.github.com/treasersimplifies/DeeroftheAntihero_DotA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980820,"owners_count":21027803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T12:33:20.429Z","updated_at":"2025-04-09T04:49:50.264Z","avatar_url":"https://github.com/treasersimplifies.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dear of the Anti-hero (DotA)\nThis is a dapp of game. The title comes from an ancient Chinese idiom——群雄逐鹿( qun xiong zhu lu ), whos superficial meaning is a lots of ambitious warlords fighting to get The Dear. \"The Dear\" is a representative of power. In ancient times, power comes from territory and army. \u003cp\u003e\nThis game is about players compete with each other to get as much territory which is in form of a limited number of cities as they can in order to produce incomes(EOS/EOSC) and win the game.\u003cp\u003e\n\n## How to use\n```bash\n# 0. Start the nodeos\nnodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --contracts-console --verbose-http-errors\n\n\n# 1. Create new wallet with the name \"dota\"(or whatever name you like)\ncleos wallet create -n dota —-to-console\n\n\n# 2. Generate two pair of keys (use the command twice)\ncleos create key\ncleos create key\n\n\n# 3. Import the generated private keys in the wallet(you need to specify the wallet at the end)\ncleos wallet import -n dota \ncleos wallet import -n dota \n\n\n# 4. Add the private key of the \"eosio\" into your wallet\n# Note: If you're receiving an Error 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations\n# you probably should add the private key of the \"eosio\" account to your wallet. \ncleos wallet import --private-key=5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 -n dota\n\n\n# 5. Create the account using the public keys\ncleos create account eosio invoker EOS5uwWCjvFRExqAHm2QgPp5yfRmY9VPzsikf4B9bXYpoktyP3rQx EOS5PRkgchBGS7MNms4JvSJzQf7mDjg1j2szikjaP6QoeLSQLZWhD\ncleos create account eosio storm EOS6mg1jYHnyWrXbMn8aqfbbg6cydjdBgTKwKB1bSSpHSQpitxMzZ EOS59w3S5worNr52DHGJ4Zu9HeDDwuRsUtm4ypHVHnkDQFduKhdhQ\n\n\n# 6. Create more testing accounts\ncleos create account eosio testhero EOS5vtqE4i8j1tad58DWPgXDKavUc9Tn7jRZTz6b86xFkhqgFYo2N EOS6S8Snum6Z46swRFLRX5Bd99QsLZs3ioVeAYhULMNYkUYmRGfx6\ncleos create account eosio sniper EOS5TCc6ZE7eamcnyAu54aAivizXxPjoFGBTdbBVL5s3HacRBcFVt EOS6uKkjWEJq3hvCWGPDa3Vex5WZ2iNQ3StR7zZSzfZ4faxUT6LCb\n# create the root account for setting contracts\ncleos create account eosio god EOS5hdugsVWNbBnU3v4EGE8ktL29gDkcrUKwX1Xdr7kv2ZHsbxD9F EOS6ocAHgBf6dbQTDsCBp28Emx7rBqiGBkVs4g4s8ohTLH4zere42\ncleos create account eosio dota EOS5ust6g8US4EPX21FUJENYXMYbGLXqfNdM4spED2ot9fG46Xd1C EOS8iPHfjgbAGi3tAQ8GvmRSBsbBFawtEJtp4tbcgffwYWQXTWZy6\ncleos create account eosio fy EOS4v2oX9ZbF4ninG6NieWUpcXrvYKaS1tNDFQFEZ6Dy8DUXFYkPu EOS56DVgR7vMEyuqkx44h53DmDDmRjEg7wsVBBPkUYY1Lvfxn4Wes\n\n\n# 7. Compile the Players/Citygroup contract\ncd /DeeroftheAntiheroDIR/contracts/Players\neosio-cpp -o Players.wasm Players.cpp --abigen\ncd /DeeroftheAntiheroDIR/contracts/Citygroup\neosio-cpp -o Citygroup.wasm Citygroup.cpp --abigen\n\n# 8. Deploy the Players contract\ncleos set contract dota /Users/treasersmac/programming/EOS/Dapps/DeeroftheAntihero/contracts/Players -p dota@active\n\n\n# 9. Test the Players contract\n# test Player::add action\ncleos push action dota add '[\"testhero\",\"testy\"]' -p testhero@active\ncleos push action dota getplayer '[\"testhero\"]' -p testhero@active\ncleos push action dota add '[\"testhero\",\"testy\"]' -p testhero@active # assert error test\ncleos push action dota add '[\"sniper\",\"snippy\"]' -p sniper@active\ncleos push action dota getplayer '[\"sniper\"]' -p sniper@active\n\ncleos push action dota add '[\"invoker\",\"kaer\"]' -p invoker@active\ncleos push action dota getplayer '[\"invoker\"]' -p invoker@active --json\n\n# test Player::update action\ncleos push action dota update '[\"testhero\",100]' -p testhero@active\ncleos push action dota getplayer '[\"testhero\"]' -p testhero@active\n\ncleos push action dota update '[\"testhero\",-50]' -p testhero@active\ncleos push action dota getplayer '[\"testhero\"]' -p testhero@active\n\ncleos push action dota update '[\"sniper\",50]' -p sniper@active\ncleos push action dota getplayer '[\"sniper\"]' -p sniper@active\n\ncleos push action dota update '[\"sniper\",-100]' -p sniper@active\ncleos push action dota getplayer '[\"sniper\"]' -p sniper@active\n\n# test Player::addtitle action : Succeed !\ncleos push action dota addtitle '{\"account\":\"testhero\",\"atitle\":{\"title_id\":1,\"name\":\"GoldCity\",\"num\":10}}' -p testhero@active\ncleos push action dota getplayer '[\"testhero\"]' -p testhero@active\ncleos push action dota addtitle '{\"account\":\"testhero\",\"atitle\":{\"title_id\":2,\"name\":\"hhh\",\"num\":9}}' -p testhero@active\ncleos push action dota getplayer '[\"testhero\"]' -p testhero@active\n\n\n# 10. Deploy the Citygroup contract\ncleos set contract fy /Users/treasersmac/programming/EOS/Dapps/DeeroftheAntihero/contracts/Citygroup -p fy@active\n\n\n# 10. Test the Citygroup contract\n# In order to test it, first list all players to make clear their account_names\n# Player::playergetall action \ncleos push action dota playergetall '[\"testhero\"]' -p testhero@active\n\n# test Citygroup::cityinit action\ncleos push action fy cityinit '[\"testhero\"]' -p testhero@active # Transaction should have at least one required authority\n\n# test Citygroup::getbyid action\ncleos push action fy getcitybyid '[1]' -p testhero@active\ncleos push action fy getcitybyid '[2]' -p testhero@active\n\n# test Citygroup::citylistall action\ncleos push action fy citylistall '[]' -p testhero@active\n\n# test Citygroup::declarewar action\ncleos push action fy declarewar '[\"testhero\",1,1]' -p testhero@active\ncleos push action fy declarewar '[\"testhero\",1,2]' -p testhero@active\n\n# test Citygroup::getbattle action\ncleos push action fy getbattle '[1]' -p testhero@active\n\n# test Citygroup::attack action\ncleos push action fy attack '[\"testhero\",1,10,\"(3/3+2)*8\",1]' -p testhero@active\n# test more ... \ncleos push action fy declarewar '[\"testhero\",1,2]' -p testhero@active\ncleos push action fy attack '[\"testhero\",2,10,\"(3/3+2)*8\",1]' -p testhero@active\ncleos push action fy getbattle '[2]' -p testhero@active\n\ncleos push action fy declarewar '[\"testhero\",1,3]' -p testhero@active\ncleos push action fy attack '[\"testhero\",3,10,\"(3/3+2)*8\",1]' -p testhero@active\ncleos push action fy getbattle '[3]' -p testhero@active\n\ncleos push action fy declarewar '[\"testhero\",1,4]' -p testhero@active\ncleos push action fy attack '[\"testhero\",4,10,\"(3/3+2)*8\",1]' -p testhero@active\ncleos push action fy getbattle '[4]' -p testhero@active\n\n```\n\n## Versioning\nv0.01 : implement players management and primitive citys management.\nv0.02 : implement 24-count attack.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreasersimplifies%2Fdeeroftheantihero_dota","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreasersimplifies%2Fdeeroftheantihero_dota","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreasersimplifies%2Fdeeroftheantihero_dota/lists"}