--- a/src/rps.erl Sun Mar 02 22:10:59 2014 +0900
+++ b/src/rps.erl Sun Mar 02 22:41:13 2014 +0900
-define(BOTS, [fool, copycat, gambler]).
+ register(nickserv, spawn_link(rps_nickserv, nickserv, [])),
register(lobby, spawn_link(?MODULE, lobby, [])),
register(counter, spawn_link(?MODULE, counter, [])),
register(printer, spawn_link(?MODULE, printer, [])),
--- a/src/rps_bots.erl Sun Mar 02 22:10:59 2014 +0900
+++ b/src/rps_bots.erl Sun Mar 02 22:41:13 2014 +0900
-export([fool/0, copycat/0, gambler/0]).
+ nickserv ! {nick, self(), "fool"},
+ nickserv ! {nick, self(), "copycat"},
+ nickserv ! {nick, self(), "gambler"},
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/rps_nickserv.erl Sun Mar 02 22:41:13 2014 +0900
+-export([nickserv/0, whois/1]).
+ {nick, Who, Nickname} ->
+ nickserv(dict:store(Who, Nickname, Nicknames));
+ Pid ! {ok, dict:fetch(Who, Nicknames)},
+ nickserv ! {whois, self(), Who},
+ {ok, Nickname} -> Nickname