package org.mynonglam.server;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.mynonglam.dao.ChatMessageMod;
import org.mynonglam.entitys.Client;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;

/**
 * Servlet implementation class Chat
 */
public class Chat extends WebSocketServlet {
	
	private static final long serialVersionUID = 1L;
	
	public static ArrayList<Client> clientList = new ArrayList<Client>();
	
	HttpSession session;
	
	public Chat(){}
	 
    @Override
    protected StreamInbound createWebSocketInbound(String string, HttpServletRequest request) {
    	session = request.getSession();
    	return new ChatMessageMod((String) session.getAttribute("accountinfo"));
	}
}
