« Return to Thread: Same page different params!

Same page different params!

by stojadinovicp :: Rate this Message:

Reply to Author | View in Thread



Hi everyone!

In short, the problem is the following. Its an online card game with Rooms and Tables organization. Now, one JSP is used to open different rooms, naturally. Same goes for tables. Depending on the params passed, like "room/index.jsp?roomID=NewOrleans" for example, and then another room "room/index.jsp?roomID=BabyBlue"

The problem is that when I use:
        String currentPage = wctx.getCurrentPage();
        Collection<ScriptSession> sessions = wctx.getScriptSessionsByPage(currentPage);
        for (ScriptSession ss : sessions) ss.addScript(new ScriptBuffer(js));

then ALL rooms get ALL messages :(((
So, if a user chats in one room, this goes to all the rooms :(((

It does make sense to see "room/index.jsp" as one page regardless of the "?roomID=BlaBla" part, but therein lies my problem :(

Now, one obvious solution is to include the roomID in the JavaScript call and then if the roomID is not valid I ignore the message. BUT, this sucks big time because the idea is to have a few rooms but each of these should have many tables opened at the same time. So there will be a LOT of messages flying around and being ignored. In other words, one table page will get ALL messages from ALL tables in ALL rooms.

I would REALLY like to avoid sending THIS much data to my users :(

Any ideas how to solve this? PLEASE!
ANY idea is welcome! And I do have a deadline :(((

THANKS!!!

 « Return to Thread: Same page different params!

LightInTheBox - Buy quality products at wholesale price