nodechan

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

commit 9762b42627fa0d924082f8d91aa438339f461173
parent 657edeb30c6ebb0515c96d39e3f3bb43c5794790
Author: joshiemoore <jxm5210@g.rit.edu>
Date:   Tue,  6 Aug 2019 14:09:02 -0400

Add ChanThread and ChanPost

Diffstat:
Asrc/ChanPost.java | 11+++++++++++
Asrc/ChanThread.java | 16++++++++++++++++
Msrc/NodeChan.java | 11+++++++++++
3 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/src/ChanPost.java b/src/ChanPost.java @@ -0,0 +1,11 @@ +public class ChanPost { + private String tid; + private boolean isRoot; + private String text; + + public ChanPost(String tid, boolean isRoot, String text) { + this.tid = tid; + this.isRoot = isRoot; + this.text = text; + } +} diff --git a/src/ChanThread.java b/src/ChanThread.java @@ -0,0 +1,16 @@ +import java.util.ArrayList; + +public class ChanThread { + private String tid; + private String title; + private ArrayList<ChanPost> posts; + + public ChanThread(String tid, ChanPost firstPost, String title) { + this.tid = tid; + this.title = title; + + posts = new ArrayList<ChanPost>(); + + posts.insert(firstPost); + } +} diff --git a/src/NodeChan.java b/src/NodeChan.java @@ -5,6 +5,8 @@ import java.io.InputStreamReader; import java.net.URL; import java.net.InetAddress; +import java.net.DatagramSocket; +import java.net.DatagramPacket; import com.dosse.upnp.UPnP; @@ -46,6 +48,7 @@ public class NodeChan { // UPnP port mapping successful System.out.println("UPnP port mapping enabled.\n"); } else { + // UPnP port mapping failed System.out.println("UPnP port mapping failed. You will need to " + "manually forward port " + PORT + " to your " + "local IP.\n"); @@ -54,6 +57,9 @@ public class NodeChan { System.out.println("Port " + PORT + " already mapped, continuing.\n"); } } else { + // client does not have UPnP + // the user is either not behind a NAT or they will need to manually + // configure port forwarding on their router System.out.println("UPnP not available. You will need to manually " + "forward port " + PORT + " to your local IP.\n"); } @@ -71,6 +77,11 @@ public class NodeChan { // try to connect directly to the user-specified peer first_peer_ip = input; } + + if (first_peer_ip.equals("nopeer")) { + System.out.println("No peer available from tracker. Waiting for " + + "connections...\n"); + } } /**