Server Extension Help

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Jackiepro
Posts: 12
Joined: 30 Sep 2011, 06:54

Server Extension Help

Postby Jackiepro » 31 Oct 2011, 22:44

Hey, after playing around with the fpsExtension source files ive finally made code that I want to compile. How do I recompile all the source code into a .jar file assuming that the heirarchy of file systems must be maintained because a class importants a class in a seperate folder. Thus is there a fast way to just make a .jar file out of the current filesystem? I tried the cmd option but when it compiled a .jar extension the result was 16kb while the original is meant to be 42kb so im assuming im missing something. Thanks.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 01 Nov 2011, 14:11

I would definitely either use Eclipse or IntelliJ IDEA - 2 excellent IDEs for Java development. Eclipse is open source and IDEA exists in a free version that should cover your needs for SFS development.

In general a jar file is simply a zip of the .class files in a correct folder hierachy. So if you compile on command line you need to zip up the resulting folder structure that contains your .class files, and then rename the zip to jar

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Jackiepro
Posts: 12
Joined: 30 Sep 2011, 06:54

Postby Jackiepro » 02 Nov 2011, 02:53

Ah ok yea downloaded eclipse. Though what if I used the cmd
jar cf JAR_FILE_NAME FILE_NAMES_OR_DIRECTORY_NAME
would the use of that retain the hierarchy of directories and ensure that the jar file retains the structure of dk/fullcontrol/fps? If so the folder I have to specify for the cmd is just the location of the dk folder given by windows properties?

Thanks again.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 03 Nov 2011, 09:20

Yeah - from what I remember, the jar tool is just a glorified zipper.

The "root" of the jar file should contain the namespace root - dk for example.

You can try to unpack the jar file in the demo to see the structure inside it to match it up

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund
Jackiepro
Posts: 12
Joined: 30 Sep 2011, 06:54

Postby Jackiepro » 03 Nov 2011, 16:22

Im definitely doing something wrong with the jar creation. I literally take the original jar file, use jar xf and extract its contents. Then I take the dk folder that was made from this command and use jar cf to recreate the file. The new file made is 43kb, but doesnt have a file type, so I rename it such that I add a .jar extra to it and it becomes a jar file. If I use jar xf on my newly created jar extension it will extract the exact same files in the same order as the original extension. However once I use my copy of the extension in the server folder, my fpsDemo no longer works. So yea... if im not able to recreate the original file something is definitely weird.

On the other hand, eclipse just keeps the files as .java source files rather than making them .class and im not sure why.

Might any of this have to do with the .classpath file as I dont do anything personally to specify any directories for the libraries yet I dont see how the original jar file specifies anything either.
Jackiepro
Posts: 12
Joined: 30 Sep 2011, 06:54

Postby Jackiepro » 05 Nov 2011, 16:18

Alright well I managed to resolve the issue. Eclipse seemed to be compiling my jar files with .javas and not making .class. On the other hand I think the command promt was just flawed in that when it made the jar files I had to manually add the .jar extension which somehow corrupted the files.

Using netbeans everything seemed to work fine, was a breeze.

Thanks for all the help though Thomas :)
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 08 Nov 2011, 10:56

Happy you ended up with a working solution

Personally I dont like Netbeans or Eclipse. I find Intellij IDEA many times more productive and less weird. But thats a personal preference :-)

/T
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund
DarkSlash
Posts: 30
Joined: 12 Feb 2016, 18:15

Re: Server Extension Help

Postby DarkSlash » 16 Feb 2016, 18:35

For all those using IntelliJ Idea, how do you add the Sfs2x libs to it? Because it has a bunch of framworks options but not SFS and I can't find how to do it!
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server Extension Help

Postby Lapo » 17 Feb 2016, 08:38

Hi,
you need to add the two libraries --> sfs2x.jar and sfs2x-core.jar to your project.

Here's how to do it:
http://stackoverflow.com/questions/2105 ... ellij-idea

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
DarkSlash
Posts: 30
Joined: 12 Feb 2016, 18:15

Re: Server Extension Help

Postby DarkSlash » 17 Feb 2016, 17:25

Oh thank you! I prefer Intellij over Eclipse, but couldn't find that in the intuitive way that Eclipse has it!

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 26 guests