Slight confusion with sending sendXtMessage to room

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
pilot
Posts: 10
Joined: 16 Jun 2010, 22:10

Slight confusion with sending sendXtMessage to room

Post by pilot »

Hi there,

I've got my application creating and room and my user is moving away from the lobby (Private) to the new room. However I'm noticing when I continue sending messages to the server, instead of sending the messages through the new room my sendXtMessage request is being sent to the zone file.

Perhaps I'm missing something but how do I send the new requests through the extension in my room? It's basically the same extension I'm using on the Zone to help push the person to the proper room. Eventually I'll make two separate extensions for security purposes, but for now I can't seem to pass the requests through the room (to eventually propagate to each user in the room as well).

My login functions and such are called 'mainCore' and each room being created is assigned the same extension 'mainCore' but I see traces and responses happening in my AdminTool on the Zone view and nothing happening in the extension view of the specific room.

I also can't retrieve information about the room using _server.getCurrentRoom().

Thanks,

Dave
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

re

Post by mrnothersan »

Probably a question for Lapo here.
pilot
Posts: 10
Joined: 16 Jun 2010, 22:10

Post by pilot »

A response from Lapo would be nice. :-) heh. Also note that I recently patched up to 1.6.8.

The other very minor thing I was wondering, in my .as extension class I'm passed a room value for each triggered message received, I'm wondering how to retrieve the room name rather than the ID since my application depends on the name more than ID.

Tried setting _server.getCurrentRoom(); then using getName on that object but it's not working very well.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

pilot:
Each Extension has name. That's the way you identify which extension you are talking to. You will need to use two different names for the Zone and Room extension in order to communicate with both of them.
I also can't retrieve information about the room using _server.getCurrentRoom().
This method returns the Room only if it's called within a Room Extension
Lapo
--
gotoAndPlay()
...addicted to flash games
pilot
Posts: 10
Joined: 16 Jun 2010, 22:10

Post by pilot »

Ah, that's what I thought the problem may have been. I thought it would first pick up the room extension then go to the zone level.

Hmmm, you say Room Extension. So as soon as I point to the correct extension value this will populate correctly?

Excellent.

Thank you! I thought since Private was a room itself, that it will simply return the Room class regardless. Oh well.
Post Reply