Package com.google.appengine.api.channel

Examples of com.google.appengine.api.channel.ChannelService.sendMessage()


        if( gm != null && gm.move(mtr, piece) == true){
          rId = gm.getUserId(userId);
          Checkers.log.info("++++++++++++GAME_MOVE    Sending Move to remote host id "+rId+"++++++++++++");
          channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_MOVE+"\"}"));
            channelService.sendMessage(new ChannelMessage(rId, gson.toJson(mtr)));   
           
            if( gm.getMTable() == null ){
              channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PLAY+"\"}"));
              channelService.sendMessage(new ChannelMessage(rId, gson.toJson(Constant.GAME_PLAY)));               
            }
View Full Code Here


          channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_MOVE+"\"}"));
            channelService.sendMessage(new ChannelMessage(rId, gson.toJson(mtr)));   
           
            if( gm.getMTable() == null ){
              channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PLAY+"\"}"));
              channelService.sendMessage(new ChannelMessage(rId, gson.toJson(Constant.GAME_PLAY)));               
            }
           
        }else
          Checkers.log.info("++++++++++++GAME_MOVE  game not "+gm+" OR invalid move for token "+tk+" AND mtr "+mtr+" ++++++++++++");
View Full Code Here

          channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_MOVE+"\"}"));
            channelService.sendMessage(new ChannelMessage(rId, gson.toJson(mtr)));   
           
            if( gm.getMTable() == null ){
              channelService.sendMessage(new ChannelMessage(rId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PLAY+"\"}"));
              channelService.sendMessage(new ChannelMessage(rId, gson.toJson(Constant.GAME_PLAY)));               
            }
           
        }else
          Checkers.log.info("++++++++++++GAME_MOVE  game not "+gm+" OR invalid move for token "+tk+" AND mtr "+mtr+" ++++++++++++");
       
View Full Code Here

       
        if( gm != null ){
          Position[][] mt = gm.getMTable(piece);
         
          channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_MTABLE+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(mt)));           
        }
       
        break;
      case Constant.JOIN_GAME :
View Full Code Here

        if( gm != null ){
          Position[][] mt = gm.getMTable(piece);
         
          channelService = ChannelServiceFactory.getChannelService();
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_MTABLE+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(mt)));           
        }
       
        break;
      case Constant.JOIN_GAME :
        userId = req.getParameter(Constant.USER_ID).toString();
View Full Code Here

         
          gm = new Game(userId, rId);
          gameMap.put(tk, gm);
         
          //----USER 1
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.JOIN_GAME+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(Checkers.userMap.get(rId))));           
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_BOARD+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getCBoard())))
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PIECE+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getTurn())))
View Full Code Here

          gm = new Game(userId, rId);
          gameMap.put(tk, gm);
         
          //----USER 1
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.JOIN_GAME+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(Checkers.userMap.get(rId))));           
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_BOARD+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getCBoard())))
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PIECE+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getTurn())))
           
View Full Code Here

          gameMap.put(tk, gm);
         
          //----USER 1
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.JOIN_GAME+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(Checkers.userMap.get(rId))));           
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_BOARD+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getCBoard())))
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PIECE+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getTurn())))
           
            channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PLAY+"\"}"));
View Full Code Here

         
          //----USER 1
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.JOIN_GAME+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(Checkers.userMap.get(rId))));           
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_BOARD+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getCBoard())))
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PIECE+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getTurn())))
           
            channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PLAY+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(Constant.GAME_PLAY)))
View Full Code Here

          //----USER 1
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.JOIN_GAME+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(Checkers.userMap.get(rId))));           
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_BOARD+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getCBoard())))
          channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PIECE+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(gm.getTurn())))
           
            channelService.sendMessage(new ChannelMessage(userId, "{\""+Constant.MESSAGE_TYPE+"\":\""+Constant.GAME_PLAY+"\"}"));
            channelService.sendMessage(new ChannelMessage(userId, gson.toJson(Constant.GAME_PLAY)))
           
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.