I have been read this post: https://smartfoxserver.com/blog/kotlin- ... server-2x/
This post guild to create Kotlin Extension and export it by InteliJ.
But I wanna try with Eclipse
have Anybody know a guild about this?
please help me!
Thanks allot
Export Kotlin Extension from Eclipse
Re: Export Kotlin Extension from Eclipse
Hi,
(I moved your post in the correct section, since this is a request for SFS2X and you posted under SmartFoxServer PRO 1.x).
If you are already familiar with how Eclipse works you should have no problem setting up the project as project management should work the same in Java and Kotlin.
If you're not familiar with Eclipse then you can start with our guide here:
http://docs2x.smartfoxserver.com/Extens ... extensions
and apply the same concepts to a Kotlin project.
Hope it helps
(I moved your post in the correct section, since this is a request for SFS2X and you posted under SmartFoxServer PRO 1.x).
If you are already familiar with how Eclipse works you should have no problem setting up the project as project management should work the same in Java and Kotlin.
If you're not familiar with Eclipse then you can start with our guide here:
http://docs2x.smartfoxserver.com/Extens ... extensions
and apply the same concepts to a Kotlin project.
Hope it helps
Re: Export Kotlin Extension from Eclipse
Thanks, Labo!
I know how to export extension file in Java.
But when I do the same in Kotlin, I cannot add this extension to zone in server beccause I could not find out Main class
There are what I do:
1. Create Kotlin project and Write an extension class:
2. Export to jar file which name: "KotlinEclipseExtension.jar" and put to extension folder
3. Open the admin side and add a zone. But could not find extension name and Main class
By another way, when Export I include the "kotlin_bin" folder
Then I can find "extension name" and "Main class". I can Submit this new zone but it cannot start
Reach this error when start server
Sorry if this post too long.
I know how to export extension file in Java.
But when I do the same in Kotlin, I cannot add this extension to zone in server beccause I could not find out Main class
There are what I do:
1. Create Kotlin project and Write an extension class:
Code: Select all
import com.smartfoxserver.v2.core.ISFSEvent
import com.smartfoxserver.v2.core.SFSEventType
import com.smartfoxserver.v2.extensions.BaseServerEventHandler
import com.smartfoxserver.v2.extensions.SFSExtension
class EventHandler : BaseServerEventHandler()
{
override fun handleServerEvent(event: ISFSEvent?)
{
trace("Event received >> " + event?.type)
}
}
class KotlinEclipseExtension : SFSExtension()
{
override fun init()
{
trace("Kotlin Extension running in Zone: " + parentZone.toString())
// Add server event handler
addEventHandler(SFSEventType.SERVER_READY, EventHandler())
}
override fun destroy()
{
super.destroy()
trace("Extension shutting down");
}
}
2. Export to jar file which name: "KotlinEclipseExtension.jar" and put to extension folder
3. Open the admin side and add a zone. But could not find extension name and Main class
By another way, when Export I include the "kotlin_bin" folder
Then I can find "extension name" and "Main class". I can Submit this new zone but it cannot start
Reach this error when start server
Sorry if this post too long.
Re: Export Kotlin Extension from Eclipse
Hi,
none of the images are visible, instead of linking them externally just add them to the post.
At the botton of the post text area there's an "Attachments" tab. That's where you can add images.
Thanks
none of the images are visible, instead of linking them externally just add them to the post.
At the botton of the post text area there's an "Attachments" tab. That's where you can add images.
Thanks
Re: Export Kotlin Extension from Eclipse
Hi,
Thanks, Labo a lot
I can resolve this by maven
Thanks, Labo a lot
I can resolve this by maven
Who is online
Users browsing this forum: Baidu [Spider] and 67 guests