How to access room extension variables from another class

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to access room extension variables from another class

Postby Lapo » 24 Oct 2016, 08:17

Hi,
you need to deploy your Room Extension under extensions/__lib__/ in order to be able to do what you're asking for...
Since you didn't mention it, I suspect that's the problem.

If not, then I would like to know what error are you getting exactly, if any...

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC
Contact:

Re: How to access room extension variables from another class

Postby Carl Lydon » 24 Oct 2016, 15:59

Ok, I read this doc:

http://docs2x.smartfoxserver.com/Advanc ... assLoading

Which mentions that you should "deploy the model classes in the extensions/__lib__/ folder...

When you say "deploy" you mean place the jar in that folder, then set the email class in admin tool or config file?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to access room extension variables from another class

Postby Lapo » 24 Oct 2016, 16:21

Code: Select all

When you say "deploy" you mean place the jar in that folder

Yes, deploying is the process of copying all the relevant files of your Extension to your server which may include also dependencies, additional resources, config files etc...

then set the email class in admin tool or config file?

The email class? No, you need to specify the top class of your Extension, the one extending SFSExtension.

hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC
Contact:

Re: How to access room extension variables from another class

Postby Carl Lydon » 24 Oct 2016, 17:01

Sorry, typo, meant "main" class. Thanks.
Basto
Posts: 4
Joined: 11 Oct 2020, 07:18

Re: How to access room extension variables from another class

Postby Basto » 11 Oct 2020, 07:20

Hello,

when i use handleInternalMessage with a custom type object in 2nd argument i cannot cast it back to the original type, can i have some help ?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to access room extension variables from another class

Postby Lapo » 11 Oct 2020, 16:36

Hi,
can you please give us an example of code that is not working and the stack trace of the relative error?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 34 guests