Search:

Type: Posts; User: ManInTheMiddle

Page 1 of 2 1 2

Search: Search took 0.07 seconds.

  1. Replies
    6
    Views
    1,348

    Re: ChessMind for a ChessWorld

    We have to program chess moves using Forsyth Edwards Notation ..
  2. Replies
    6
    Views
    1,348

    Re: ChessMind for a ChessWorld

    No, there's no forums what so ever. It's a pain I know. Just thought I'd give this a try..

    Thanks for the info..
  3. Replies
    6
    Views
    1,348

    Re: ChessMind for a ChessWorld

    We have to design moves for a ChessWorld and upload them to the world.

    This might explain it a bit better

    CA318 practical

    or this

    The World-Wide-Mind project
  4. Replies
    6
    Views
    1,348

    ChessMind for a ChessWorld

    HI,

    I'm not sure which section this would go in.

    I have to write a ChessMind for an assignment. It's for a ChessWorld where minds can run each other and take each others pieces.

    I need...
  5. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Cheers thanks for that..

    Got it working

    Greatly appreciated...
  6. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    I don't quite follow. I'm not too sure why this is happening..
  7. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    hi,

    I have this completed and working now except for an error when a client disconnects..



    import java.net.*;
    import java.io.*;
    import java.util.*;
  8. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Cheers, rooky mistake. Much appreciated..
  9. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Got it i needed to change




    private ArrayList <ServerThread> nameList;
  10. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    when I print out name it prints data but the ArrayList "nameList" is null, so, I think that's causing it.

    I'v tried a few other things and the same error, it doesn't want to let me add data to...
  11. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    my private String name = null. I think this is causing it.

    I'v noticed that "name" should be reading in data just before the NPE error ( name = in.readInput), so, I think my client code needs to...
  12. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    The private String name is null. But it should be receiving data from



    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    name = in.readLine();
  13. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    It should be adding a Clients name if the name doesn't already exist, see previous post.

    I'v an ArrayList<String> nameList that should be getting the client from clientList.add(client);

    So,...
  14. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Exception in thread "ServerThread" java.lang.NullPointerException
    at ServerThread.run(Server.java:36)

    it's the


    if(!nameList.contains(name)) // line 36
    {
    nameList.add(name);...
  15. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    so, I'v come up with this but it's showing a NullPointerException. Any suggestions?



    class ServerThread extends Thread
    {
    private Socket socket;
    private String name, message;
    private...
  16. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Ah cool, much appreciated man.. I've never coded like that before so it's a bit tricky to get my head around..
  17. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    I don't quite follow. Can I add different data types ? As i'm adding Sockets and Strings.

    would I use?



    ArrayList<ClassName> ListName = new ArrayList<>();
  18. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Right, so, I'v come up with this



    class ServerStatus {
    private final ArrayList<Socket> clients;
    private final ArrayList<String> names;
    private final ArrayList<String> messages;

    ...
  19. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Actually, this class is just to save the number of connections. So, it displays on the server eg Client 1... Client 2...Client 3 then if someone leaves the chat it decrease eg. Client 2... Client 1...
  20. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    I came up with this Data Structure



    class CountConnections extends Thread{
    private ArrayList<Socket> connections = new ArrayList<>();
    private Socket socket;

    CountConnections(){...
  21. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Can this be done in the ServerThread class?
  22. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Cheers, I'll give it a go. Much appreciated..

    --- Update ---

    I have, class ServerThread and class Server in my Server, can it be done in the ServerThread? As the ServerThread class holds the...
  23. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    Sorry, I meant an ArrayList<Socket> ?
  24. Replies
    37
    Views
    7,087

    [SOLVED] Re: Reply to all clients Multithreading

    what would I use to hold the clients?

    a socket Array?
  25. Replies
    37
    Views
    7,087

    [SOLVED] Reply to all clients Multithreading

    I have a server/client written. At the moment it's replying to individual clients (User one receives user one's post only) and I need multiple users to receive all posts.


    Server



    import...
Results 1 to 25 of 50
Page 1 of 2 1 2