Gui on server

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

Moderators: Lapo, Bax

isador34
Posts: 8
Joined: 20 Sep 2014, 12:23

Gui on server

Postby isador34 » 22 Oct 2014, 16:19

hello all I have a question, how to open a GUI when server launch?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Gui on server

Postby Lapo » 22 Oct 2014, 17:38

In theory you could create a JFrame in your Extension's init() method and add all of the controls in there... If you do that make sure to release all the UI related resources in the destroy() method.
Lapo
--
gotoAndPlay()
...addicted to flash games
isador34
Posts: 8
Joined: 20 Sep 2014, 12:23

Re: Gui on server

Postby isador34 » 22 Oct 2014, 18:07

look my code:
http://pastebin.com/VEfq5s1q
http://pastebin.com/3HmEptCZ

but when I launch the extension with eclipse I have an error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/ReadablePartial
at com.smartfoxserver.v2.Main.main(Main.java:21)
Caused by: java.lang.ClassNotFoundException: org.joda.time.ReadablePartial
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Gui on server

Postby Lapo » 23 Oct 2014, 08:28

Launching the Extension with Eclipse?
No, you won't be able to do that unless you run the entire server under Eclipse, which I would not recommend.

All you need to do is deploying your Extension class in SmartFoxServer as illustrated in the docs or in this YouTube video:
https://www.youtube.com/watch?v=nKGxhwJ ... 94B9D7C3E5
Lapo

--

gotoAndPlay()

...addicted to flash games
isador34
Posts: 8
Joined: 20 Sep 2014, 12:23

Re: Gui on server

Postby isador34 » 23 Oct 2014, 09:54

I know how to use extension ;), so for test my GUI I create another project for my test

But when I upload my Ext on smartfox, the gui don't open on load, how to process for open this on load?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Gui on server

Postby Lapo » 23 Oct 2014, 10:03

If the extension starts up correctly, with no errors, the window will open.

Are you sure you have no errors on the server side?
Lapo

--

gotoAndPlay()

...addicted to flash games
isador34
Posts: 8
Joined: 20 Sep 2014, 12:23

Re: Gui on server

Postby isador34 » 23 Oct 2014, 10:17

it's work thank, but how to process to make a persistant windows?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Gui on server

Postby Lapo » 23 Oct 2014, 10:35

What is a persistent window?
Lapo

--

gotoAndPlay()

...addicted to flash games
isador34
Posts: 8
Joined: 20 Sep 2014, 12:23

Re: Gui on server

Postby isador34 » 23 Oct 2014, 10:38

a GUI which can't be close

EDIT: I found the method: this.setResizable(false);

EDIT2: I have another problem: My server can't receive extensionRequest from my client

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 104 guests