create room sendUpdate param

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

corwin
Posts: 77
Joined: 17 Jul 2009, 08:19

create room sendUpdate param

Postby corwin » 27 Jul 2010, 07:31

I have that simple piece of code:

Code: Select all

      Double roomId = -1.0;
      
      if (blah) {
         
         try {
            room = extension.currentZone.getRoomByName(roomName);
            if (room == null) {
               room = extension.helper.createRoom(extension.currentZone, params, user, false, true);   
            }
              extension.helper.joinRoom(user, extension.lobby.getId(), room.getId(), false, "", false, true);        
            room.setUcountUpdates(false);

         } catch (Exception e) {
            e.printStackTrace();
         }
         
         roomId = new Double(room.getId());
      }      
      
      
        recipients.add(user.getChannel());
        response.put("_cmd", "joinGuildRoomResponse");
        response.put("roomId", roomId);
        extension.sendResponse(response, -1, null, recipients);


It is pretty straightforward. If you have room for that guild, join it. If you don't have, create and join it. The problem is that this piece of code doesn't return extension response to the user. When users make any other request to the server it is returned ok, except this one.
I managed to fix it setting "sendUpdate" param of createRoom to true - the client start recieving joinGuildResponse. But I need sendUpdate param set to false, because otherwise all users start getting roomAdded - with 10k guilds and 15k users it is pretty laggy.
So is that a bug, and how can I what can I do about that?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 28 Jul 2010, 06:41

When a new room gets created via the server, you'll need to send the updated room list as well:

extension.helper.sendRoomList(user.getChannel());

This needs to be done before joining a room.
Smartfox's forum is my daily newspaper.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: Google [Bot] and 6 guests