Skip to content

xorgnak/monsternet

Repository files navigation

Monsternet

  • install: git clone https://github.com/xorgnak/monsternet && cd monsternet && ./monsternet [nickname]

  • Quick Start (in no particular order):

    • Announce yourself on the network: hi
    • Say "Hi!" to everyone on the server: yell "Hi!"
    • Message a user: yo 'username', "Your message."
    • View a user's profile: look 'username'
    • Perform an action: act 'username', 'action', number: 1, string: "a string", boolean: true, symbol: :sym, array: [ 1, "abc", :symbol, true ]
    • Quit: bye

Monster (Bots) Events - monster.rb

EV[:hi] = lambda() { |peer| puts "#{peer} arrived" }
EV[:sup] = lambda() { |peer| puts %[#{peer} peered] }
EV[:yo] = lambda() { |peer, msg| puts "#{peer} said #{msg}" }
EV[:bye] = lambda() { |peer| puts "#{peer} left" }
EV[:get] = lambda() { |peer, page, params| puts %[#{peer} got #{page} with #{params}] },
EV[:new] = lambda() { |id, nick, peer| puts %[NEW CIRCUIT> #{id} #{nick} #{peer}] },
EV[:peer] = lambda() { |id, nick, peer| puts %[NEW PEER> #{id} #{nick} #{peer}] },
EV[:act] = lambda() { |body| puts %[FETCH>\n#{body}]; nil },
EV[:help] = lambda() { |h| h }

Other Files:

  • peers.txt: a list of peer to connect to.
  • uuid.txt: a static generated uuid.
  • attr.json: a json dictionary of attributes.

About

A minimal chat and browsing service.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors