public void onlineGame(boolean playerOne){

        Main.v.resetAll();
        if(playerOne){
            Main.v.player1Turn = true;
            Main.v.player1 = true;
            Main.v.currentMap = 0;
            Main.v.showShips[0] = true;
        } else{
            Main.v.player1Turn = false;
            Main.v.player1 = false;
            Main.v.currentMap = 1;
            Main.v.showShips[1] = true;
        }
        
        
        //////////////////////////////////////////////////////////////////////////
        
        System.out.println("Placing Your ships");
        
        if(playerOne){
            placeShips(Main.v.maps[0]);
            om.sendMap(Main.v.maps[0]);
            
            Main.v.menuItems = new String[1];
            Main.v.menuItems[0] = "Waiting for player 2....";
            p.printMenu();
            repaint();
            System.out.println("waiting for player 2's to place ships");
            
            Main.v.maps[1] = om.getMap();
        }else{
            placeShips(Main.v.maps[1]);



            Main.v.menuItems = new String[1];
            Main.v.menuItems[0] = "Waiting for player 2....";
            p.printMenu();
            repaint();
            System.out.println("waiting for player 2's to place ships");


            Main.v.maps[0] = om.getMap();
            om.sendMap(Main.v.maps[1]);
        }
        
//        Main.v.player1Turn = true;
//        if(playerOne){
//            System.out.println("Placing player 1's ships");
//            placeShips(Main.v.maps[0]);
//            om.sendMap(Main.v.maps[0]);
//            //sendMapAndCheck(Main.v.maps[0]);
//        }else{
//            Main.v.menuItems = new String[1];
//            Main.v.menuItems[0] = "Connected! Waiting...";
//            p.printMenu();
//            repaint();
//            System.out.println("waiting for player 1's to place ships");
//            //Main.v.maps[0] = getMapAndCheck();
//            Main.v.maps[0] = om.getMap();
//        }
//        System.out.println("Switching player and placing ships");
//
//        
//        Main.v.player1Turn = false;
//        if(!playerOne){
//            System.out.println("Placing player 2's ships");
//            placeShips(Main.v.maps[1]);
//            om.sendMap(Main.v.maps[1]);
//            //sendMapAndCheck(Main.v.maps[1]);
//        }else{
//            Main.v.menuItems = new String[1];
//            Main.v.menuItems[0] = "Waiting for player 2";
//            p.printMenu();
//            repaint();
//            System.out.println("waiting for player 2's to place ships");
//            //Main.v.maps[1] = getMapAndCheck();
//            Main.v.maps[1] = om.getMap();
//        }
        

        int[] xy = new int[2];
        do{
            Main.v.player1Turn = true;
            p.printGame();
            repaint();
            
            if(playerOne){
                System.out.println("Player 1 attacking...");
                attackPlayer();
                om.sendXY(Main.v.curserX, Main.v.curserY);
            }else{
                System.out.println("waiting for player 1 to attack");
                xy = om.getXY();
                Main.v.maps[1].setHit(xy[0], xy[1], true);
                if(Main.v.maps[1].isShipHere(xy[0], xy[1])){
                    Main.v.totalHits[0]++;
                }
            }


            Main.v.player1Turn = false;
            p.printGame();
            repaint();
            //did player 1 win?
            if(v.totalHits[0] < 17){
                if(!playerOne){
                    System.out.println("Player 2 attacking...");
                    attackPlayer();
                    om.sendXY(Main.v.curserX, Main.v.curserY);
                }else{
                    System.out.println("waiting for player 2 to attack");
                    xy = om.getXY();
                    Main.v.maps[0].setHit(xy[0], xy[1], true);
                    if(Main.v.maps[0].isShipHere(xy[0], xy[1])){
                        Main.v.totalHits[1]++;
                    }
                }
            }
        }while((v.totalHits[0] < 17) && (v.totalHits[1] < 17));

        om.closeAll();
        endGame();
        
    }