nodechan

decentralized peer-to-peer anonymous messageboard client
git clone git://squid-tech.com/nodechan.git
Log | Files | Refs | README

commit db5b63bd259126d5ef9306b991164a6c7f3878fd
parent 5a2c6c53a1c1b1d88ee10b4e35aa64e9964b3481
Author: joshiemoore <jxm5210@g.rit.edu>
Date:   Fri,  9 Aug 2019 01:09:35 -0400

Add basic "help" command

Diffstat:
Msrc/NodeChan.java | 19+++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/NodeChan.java b/src/NodeChan.java @@ -297,11 +297,30 @@ public class NodeChan { System.out.println("Cannot send hello-packets when the -nohello " + "flag is set."); continue; + } else if (peers.size() == 0) { + System.out.println("No peers to send hello-packets to."); } else { for (Peer p : peers) { sendHelloPacket(p); } + + System.out.println("Hello-packet(s) sent."); } + } else if (input.equals("help")) { + // display a list of commands to the user + System.out.println("=== NodeChan command list ==="); + System.out.println("To use a command, simply enter the command name and follow the prompts.\n\n"); + + System.out.println("addpeer - add a new peer by IP address"); + System.out.println("exit - quit NodeChan"); + System.out.println("getpeer - request a peer from the peer tracker"); + System.out.println("hello - send hello-packets to all peers"); + System.out.println("newthread - create a new thread"); + System.out.println("numpeers - print the number of peers this client has"); + System.out.println("threadlist - list all threads"); + System.out.println("readthread - read a thread based on its TID"); + System.out.println("reply - reply to a thread based on its TID"); + } else { System.out.println("Command not recognized."); }