Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from inaka/elbrujohalcon.1.make_it_open_source_…
…able Make it open-source-able
- Loading branch information
Showing
13 changed files
with
1,617 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,42 @@ | ||
# gold_fever | ||
# Gold Fever | ||
A Treasure Hunt for Erlangers | ||
|
||
## Introduction | ||
This repo provides the server for a distributed treasure hunt game using erlang nodes. | ||
It was originally used for Inaka's Erlang Dojo 2015, but it can hopefully be used by anyone :) | ||
|
||
## Instructions | ||
To run the server just clone the repo and start the app in shell: | ||
|
||
```bash | ||
git clone https://github.com/inaka/gold_fever.git | ||
cd gold_fever | ||
make && make shell | ||
``` | ||
|
||
Then let the players connect to it by giving them your node name and cookie (as a bonus you can give them a *clue* to get the cookie instead). | ||
|
||
## Configuration | ||
The different game stages are configured by application environment. To help you with that a [sys.config.template](config/sys.config.template) is provided, along with the configuration we used at [inaka](config/inaka.config) and the [generic](config/generic.config) one that's used by default. | ||
If you want to start the server using your own config, just do: | ||
|
||
```bash | ||
CONFIG="path/to/your.config" make shell | ||
``` | ||
|
||
You can also set the IP part of your node name by doing: | ||
|
||
```bash | ||
NODEIP=192.168.48.33 make shell | ||
``` | ||
|
||
## Contact Us | ||
For **questions** or **general comments** regarding the use of this project, | ||
please use our public [hipchat room](https://www.hipchat.com/gpBpW3SsT). | ||
|
||
If you find any **bugs** or have a **problem** while using this project, please | ||
[open an issue](https://github.com/inaka/shotgun/issues/new) in this repo | ||
(or a pull request :)). | ||
|
||
And you can check all of our open-source projects at | ||
[inaka.github.io](http://inaka.github.io) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
[ | ||
{lager, | ||
[ | ||
{colored, true}, | ||
{async_threshold, 200}, | ||
{async_threshold_window, 5}, | ||
{error_logger_hwm, 500}, | ||
{handlers, [{lager_console_backend, [debug, true]}]} | ||
] | ||
}, | ||
{sasl, | ||
[ | ||
{sasl_error_logger, false}, | ||
{errlog_type, error} | ||
] | ||
}, | ||
{gold_fever, | ||
[ {step1, #{ cookie => 'erlang-dojo-2015' | ||
, message => "Welcome to the far west, fellow!" | ||
"\nNow spawn 'larry' and listen to me." | ||
"\nI have something for you..." | ||
}} | ||
, {step2, #{ message => "Keep the token, now send a flower to Kathy " | ||
"she will help you find that thief..." | ||
, unexpected => "I'm expecting flowers, my dear. " | ||
"~p is not a flower -L-\n" | ||
}} | ||
, {step3, #{ message => "Oh! Nice flower, dear... I love flowers!\n" | ||
"I also love maps and Larry told me you have a fancy" | ||
"\ngen_server over there. Send me a map that will" | ||
"\nguide me to it and don't forget to add the token" | ||
"\ngiven to Larry before, that way I will be sure" | ||
"\nit's really you" | ||
, missing => "You didn't send me the '~p' of your gen_server :(" | ||
, badauth => "Who *are* you?!~i" | ||
, unexpected => "I'm expecting maps, my dear.\n" | ||
"~p\nis not a map -L-\n" | ||
}} | ||
, {step4, #{ message => "Hurry up, I fear someone is watching me. " | ||
"Please, please kill him!!" | ||
}} | ||
, {step5, #{ message => "You might have killed me but my people will avenge " | ||
"my death. BRACE YOURSELF... YOU'LL BE EXTERMINATED!" | ||
, reason => "If you can read this, then Kathy is free. " | ||
"Beware of her, she is not a lady: she's an FSM. " | ||
"I bet you sent her flowers, try asking her about " | ||
"their color a couple of times" | ||
}} | ||
, {step6, #{ answers => [red, pink, blue, white, orange] | ||
, message => "You've got me... I'm just a machine, but I'll " | ||
"never tell you where the real 'kathy' is!! " | ||
"You won't be able to call her!" | ||
, regexes => [<<"color">>, <<"flower">>] | ||
, missing => "Will you ask me a '~p'?" | ||
, unknown => "I don't know the answer to that. " | ||
"Ask me something else" | ||
, badauth => "I'm not talking to you!~i" | ||
, unexpected => "I'm expecting maps, my dear.\n" | ||
"~p\nis not a map -L-\n" | ||
}} | ||
, {step7, #{ welcome => "Aw, thanks! you found me!!" | ||
, again => "Hey again!" | ||
, message => "Now I know you're with me. But are you a real " | ||
"cowboy? If so, cast me a map with your address and " | ||
"your token and I'll PUT something in your pocket " | ||
"to help you find the thief" | ||
, expired => "I'm not talking to you anymore!" | ||
, badauth => "Please send me your token, I need to know that " | ||
"you are on my side" | ||
}} | ||
, {step8, #{ image => "priv/joe.png" | ||
, path => "pocket" | ||
, headers => #{<<"content-type">> => <<"image/png">>} | ||
, message => "Do you know him? Find his node! He hid his treasure" | ||
" there. The treasure must be in his 'vault'" | ||
, missing => "I still need '~p' :)" | ||
, toosoon => "Too soon, my dear... don't you think you should " | ||
"give me a call first?" | ||
, badauth => "Please send me your token, I need to know that " | ||
"it is you" | ||
, notaurl => "I don't know how to get to that address, sorry :/" | ||
}} | ||
, {step9, #{ nodename => joe | ||
, attempts => 5 | ||
, passwords => [letitcrash, "let it crash"] | ||
, warning => "Vault locked, enter the key" | ||
, rickroll => "http://ow.ly/NQkbK" | ||
, unlocked => "Vault unlocked, ask for contents" | ||
, wrongpwd => "Wrong key@, try again~i" | ||
, treasure => "http://ow.ly/NQmoH" | ||
}} | ||
] | ||
} | ||
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
[ | ||
{lager, | ||
[ | ||
{colored, true}, | ||
{async_threshold, 200}, | ||
{async_threshold_window, 5}, | ||
{error_logger_hwm, 500}, | ||
{handlers, [{lager_console_backend, [debug, true]}]} | ||
] | ||
}, | ||
{sasl, | ||
[ | ||
{sasl_error_logger, false}, | ||
{errlog_type, error} | ||
] | ||
}, | ||
{gold_fever, | ||
[ {step1, #{ cookie => 'erlang-dojo-2015' | ||
, message => "Welcome to the far west, fellow!" | ||
"\nNow spawn 'larry' and listen to me." | ||
"\nI have something for you..." | ||
}} | ||
, {step2, #{ message => "Keep the token, now send a flower to Kathy " | ||
"she will help you find that thief..." | ||
, unexpected => "I'm expecting flowers, my dear. " | ||
"~p is not a flower -L-\n" | ||
}} | ||
, {step3, #{ message => "Oh! Nice flower, dear... I love flowers!\n" | ||
"I also love maps and Larry told me you have a fancy" | ||
"\ngen_server over there. Send me a map that will" | ||
"\nguide me to it and don't forget to add the token" | ||
"\ngiven to Larry before, that way I will be sure" | ||
"\nit's really you" | ||
, missing => "You didn't send me the '~p' of your gen_server :(" | ||
, badauth => "Who *are* you?!~i" | ||
, unexpected => "I'm expecting maps, my dear. " | ||
"~p is not a map -L-\n" | ||
}} | ||
, {step4, #{ message => "Hurry up, I fear someone is watching me. " | ||
"Please, please kill him!!!" | ||
}} | ||
, {step5, #{ message => "You might have killed me but my people will avenge " | ||
"my death. BRACE YOURSELF... YOU'LL BE EXTERMINATED!" | ||
, reason => "If you can read this, then Kathy is free. " | ||
"Beware of her, she is not a lady: she's an FSM. " | ||
"I bet you sent her flowers, try asking her about " | ||
"their color a couple of times" | ||
}} | ||
, {step6, #{ answers => [red, pink, blue, white] | ||
, message => "You've got me... I'm just a machine, but I'll " | ||
"never tell you where the real 'kathy' is!! " | ||
"You won't be able to call her!" | ||
, regexes => [<<"color">>, <<"flower">>] | ||
, missing => "Will you ask me a '~p'?" | ||
, unknown => "I don't know the answer to that. " | ||
"Ask me something else" | ||
, badauth => "I'm not talking to you!~i" | ||
, unexpected => "I'm expecting maps, my dear. " | ||
"~p is not a map -L-\n" | ||
}} | ||
, {step7, #{ welcome => "Aw, thanks! you found me!!" | ||
, again => "Hey again!" | ||
, message => "Now I know you're with me. But are you a real " | ||
"cowboy? If so, cast me a map with your address and " | ||
"your token and I'll PUT something in your pocket " | ||
"to help you find the thief" | ||
, expired => "I'm not talking to you anymore!" | ||
, badauth => "Please send me your token, I need to know that " | ||
"you are on my side" | ||
}} | ||
, {step8, #{ image => "priv/thief.png" | ||
, path => "pocket" | ||
, headers => #{<<"content-type">> => <<"image/png">>} | ||
, message => "Do you know him? Find his node! He hid his treasure" | ||
" there. The treasure must be in his 'vault'" | ||
, missing => "I still need '~p' :)" | ||
, toosoon => "Too soon, my dear... don't you think you should " | ||
"give me a call first?" | ||
, badauth => "Please send me your token, I need to know that " | ||
"it is you" | ||
, notaurl => "I don't know how to find that address, sorry :/" | ||
}} | ||
, {step9, #{ nodename => inako | ||
, attempts => 5 | ||
, passwords => [nuestraclave, "nuestraclave"] | ||
, warning => "Vault locked" | ||
, rickroll => "http://ow.ly/NQkbK" | ||
, unlocked => "Vault unlocked, ask for contents" | ||
, wrongpwd => "Wrong password, try again~i" | ||
, treasure => "http://ow.ly/NQmoH" | ||
}} | ||
] | ||
} | ||
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
elvis, | ||
[ | ||
{config, | ||
[#{dirs => ["src"], | ||
filter => "*.erl", | ||
rules => [{elvis_style, line_length, #{limit => 80, | ||
skip_comments => false}}, | ||
{elvis_style, no_tabs}, | ||
{elvis_style, no_trailing_whitespace}, | ||
{elvis_style, macro_names}, | ||
{elvis_style, macro_module_names}, | ||
{elvis_style, operator_spaces, #{rules => [{right, ","}, | ||
{right, "++"}, | ||
{left, "++"}]}}, | ||
{elvis_style, nesting_level, #{level => 3}}, | ||
{elvis_style, god_modules, #{limit => 30}}, | ||
{elvis_style, no_if_expression}, | ||
{elvis_style, invalid_dynamic_call, #{ignore => [elvis]}}, | ||
{elvis_style, used_ignored_variable}, | ||
{elvis_style, no_behavior_info}, | ||
{ | ||
elvis_style, | ||
module_naming_convention, | ||
#{regex => "^g([a-z][a-z0-9]*_?)*(_SUITE)?$", | ||
ignore => []} | ||
}, | ||
{elvis_style, state_record_and_type}, | ||
{elvis_style, no_spec_with_records}, | ||
{elvis_style, dont_repeat_yourself, #{min_complexity => 10}} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
]. |
Oops, something went wrong.