Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Spiral Knights server code in Beta client

Junior Spellweaver
Joined
Jul 29, 2013
Messages
186
Reaction score
78
I have had the Spiral Knights beta client on my hard drive for years, because of an old thread on here discussing potential server code within it. Recently I chose to delve into it myself and see what there was to find, and it would appear that 90-95% of the server code does in fact reside within. While i do have a decent feel for Java, I don't have a good enough grasp to take advantage of this, so I thought I'd post it on here for others to see.

Here's what I've found:
(Here's the beta client for those who don't have it: )
(note: I logged the current client to figure out the launch args for it, and adjusted them for the beta client. They are:)
Code:
java.exe -classpath F:\spiral\.\code\config.jar;F:\spiral\.\code\projectx-config.jar;F:\spiral\.\code\projectx-pcode.jar;F:\spiral\.\code\lwjgl.jar;F:\spiral\.\code\lwjgl_util.jar;F:\spiral\.\code\jinput.jar;F:\spiral\.\code\jutils.jar;F:\spiral\.\code\jshortcut.jar;F:\spiral\.\code\commons-beanutils.jar;F:\spiral\.\code\commons-digester.jar;F:\spiral\.\code\commons-logging.jar -Dcom.threerings.getdown=true -Xmx256M -XX:+AggressiveOpts -XX:SoftRefLRUPolicyMSPerMB=10 -Djava.library.path=F:\spiral\./native -Dorg.lwjgl.util.NoChecks=true -Dsun.java2d.d3d=false -Dappdir=F:\spiral\. -Dresource_dir=F:\spiral\./rsrc -Xmx512M com.threerings.projectx.client.ProjectXApp

1. De-compiling the code I found that the main class for the server resides at com.threerings.projectx.server.ProjectXServer. It can be launched with:
Code:
java.exe -classpath  F:\spiral\.\code\config.jar;F:\spiral\.\code\projectx-config.jar;F:\spiral\.\code\projectx-pcode.jar;F:\spiral\.\code\lwjgl.jar;F:\spiral\.\code\lwjgl_util.jar;F:\spiral\.\code\jinput.jar;F:\spiral\.\code\jutils.jar;F:\spiral\.\code\jshortcut.jar;F:\spiral\.\code\commons-beanutils.jar;F:\spiral\.\code\commons-digester.jar;F:\spiral\.\code\commons-logging.jar  -Dcom.threerings.getdown=true -Xmx256M -XX:+AggressiveOpts  -XX:SoftRefLRUPolicyMSPerMB=10 -Djava.library.path=F:\spiral\./native  -Dorg.lwjgl.util.NoChecks=true -Dsun.java2d.d3d=false  -Dappdir=F:\spiral\. -Dresource_dir=F:\spiral\./rsrc -Xmx512M  com.threerings.projectx.server.ProjectXServer
but it will crash with an error due to missing classfiles from the public Samskivert library specifically:
Code:
com.samskivert.depot.impl.PostgreSQL4Builder
and
com.samskivert.depot.impl.PostgreSQLBuilder
which can be merged in as classfiles without any additional errors relating to them from here:


2. Once they are added the server will get to init, but it will fail with the error
Code:
 WARNING com.threerings.projectx: Server initialization failed. java.lang.NoClassDefFoundError: Lcom/threerings/projectx/server/ProjextXSupportManager
Going through the dependencies for the main server class it would appear that this is the only missing classfile for the server project that isn't included in the beta client. It should be a simple matter to create a workaround for this... but that is beyond the scope of my abilities. In posting this I hope that someone may be able to find how to get a working server up and running.

Edit - Further exploration has shown that by editing the deployment.properties file in code/config.jar to have the server location be localhost, starting the client, then running:
Code:
java.exe -classpath  F:\spiral\.\code\config.jar;F:\spiral\.\code\projectx-config.jar;F:\spiral\.\code\projectx-pcode.jar;F:\spiral\.\code\lwjgl.jar;F:\spiral\.\code\lwjgl_util.jar;F:\spiral\.\code\jinput.jar;F:\spiral\.\code\jutils.jar;F:\spiral\.\code\jshortcut.jar;F:\spiral\.\code\commons-beanutils.jar;F:\spiral\.\code\commons-digester.jar;F:\spiral\.\code\commons-logging.jar  -Dcom.threerings.getdown=true -Xmx256M -XX:+AggressiveOpts  -XX:SoftRefLRUPolicyMSPerMB=10 -Djava.library.path=F:\spiral\./native  -Dorg.lwjgl.util.NoChecks=true -Dsun.java2d.d3d=false  -Dappdir=F:\spiral\. -Dresource_dir=F:\spiral\./rsrc -Xmx512M  com.threerings.presents.server.PresentsServer
creates a server which will accept incoming connections from the client, but cannot proceed from there. Perhaps this acts like a login sub-server for the game?

Edit 2: PresentsServer appears to be part of the open source Narya library that Threerings uses:
 
Last edited:
Initiate Mage
Joined
Aug 25, 2013
Messages
1
Reaction score
0
I have been playing around with this a little bit, one dependency I found that needs to be added is the redistributable api jar from:

There are bigger problems however, every "persist" folder is missing, leaving out classes like KnightRepository, ItemRepository, SceneRepository, etc. These are likely in a different jar that was never distributed with spiral. Clearly alot of recoding will need to take place.

Edit: Found another dependency, other deps can be found here too, so far ive needed cron as well:
 
Last edited:
Junior Spellweaver
Joined
Jul 29, 2013
Messages
186
Reaction score
78
Oh interesting I didnt see those. I'll check them out next time I get on my main machine. I've got a friend who's interested in trying to create a C# (bleh, C#) framework for the server, so I'll see where I can get.

Edit: Also im fairly sure the 'persist' libraries are part of the database, so I've been trying to see if I can 'ignore' those for now.
 
Initiate Mage
Joined
Aug 25, 2009
Messages
4
Reaction score
1
Guyz I think that we must run server from projectx to get sk working server.
If you will run presents it's blank server without configuration. Normal Spiral knights server runs in FreeBSD and it uses a lot of databases.
Even if you will connect client there will be no message. Server don't know which client version allow and which not allow etc. There are no accounts of course so you can't login. I think configuration for spiral knights is projectx folder since you can use narya to run other games and it's blank (no specific game configuration). Our misfortune is that projectx code was never shared ;[.

@Edit this files are missing only in ProjectXServer:
import com.threerings.projectx.server.persist.MachIdentRepository;
import com.threerings.projectx.server.persist.PlayerRepository;
import com.threerings.projectx.server.persist.ProjectXSceneRepository;
import com.threerings.projectx.slink.server.SlinkManager;
import com.threerings.projectx.social.server.SocialManager;
import com.threerings.projectx.town.server.TownManager;
import com.threerings.projectx.tx.server.TransactionManager;
import com.threerings.projectx.uplink.server.UplinkManager;
import com.threerings.projectx.util.DeploymentConfig;
import com.threerings.sega.SegaPass;
import com.threerings.slink.server.SlinkRegistry;
import com.threerings.underwire.server.SupportManager;
 
Last edited:
Junior Spellweaver
Joined
Jul 29, 2013
Messages
186
Reaction score
78
Guyz I think that we must run server from projectx to get sk working server.
If you will run presents it's blank server without configuration. Normal Spiral knights server runs in FreeBSD and it uses a lot of databases.
Even if you will connect client there will be no message. Server don't know which client version allow and which not allow etc. There are no accounts of course so you can't login. I think configuration for spiral knights is projectx folder since you can use narya to run other games and it's blank (no specific game configuration). Our misfortune is that projectx code was never shared ;[.

@Edit this files are missing only in ProjectXServer:

Yeah, I know the main code is in ProjectX, but the configuration library is missing (projectx.projectxsupportmanager) the rest is easy to bypass.
 
Initiate Mage
Joined
Aug 25, 2009
Messages
4
Reaction score
1
Strange cause I've decompilled ProjectXServer and there is no info to import this class. Missing classes are only the ones that I wrote earlier.
Maybe projectx.projectxsupportmanager is com.threerings.underwire.server.SupportManager and the name was changed because it imports locally.
 
Junior Spellweaver
Joined
Jul 29, 2013
Messages
186
Reaction score
78
Strange cause I've decompilled ProjectXServer and there is no info to import this class. Missing classes are only the ones that I wrote earlier.
Maybe projectx.projectxsupportmanager is com.threerings.underwire.server.SupportManager and the name was changed because it imports locally.
It is.
 
Initiate Mage
Joined
Jul 18, 2014
Messages
2
Reaction score
0
Sorry for the up
But i have looked the source code of the class file
and i think it's totally possible to make a localhost server.
Just need to work on it because i don't understand all the code im not a pro.
It can be cool a private server is possible but it's complicated.
So why not try to make a localhost server and try to work more on it for improve it.
PS: Sorry for the bad english.


EDIT : I have found something cool

I have decompile the projectx-pcode
and in projectx-pcode\com\threerings\presents\client\

Client.class i have found the use of the port
DEFAULT_SERVER_PORTS = { 47624 };
But i can't found where change the hostname.
 
Last edited:
Initiate Mage
Joined
Dec 31, 2013
Messages
1
Reaction score
0
Can anyone find any of the server sources left in the current client?
 
Initiate Mage
Joined
Aug 25, 2009
Messages
4
Reaction score
1
I think sources was only in closed beta, then it was partial deleted in open beta and since game is not in beta there is 0 % server side.
I think also we are missing all databases, like account etc. and we can't create server without it.
It's easy to modify client to connect to every server you want but it does nothing when you don't know account that you want to log in ;]
 
Newbie Spellweaver
Joined
Aug 13, 2014
Messages
12
Reaction score
5
[Sorry. This has been redacted]
 
Last edited:
Initiate Mage
Joined
Aug 25, 2009
Messages
4
Reaction score
1
Hi Meehoweq
Jak idzie ? / How it's going ?

I have some progress
I can run narya server and connect a client to my narya server.
I've deleted authentication by adding narya classes before auth patch (Smart me :D)
I can see that I'm connected but this server is not spiral knights server, just empty server so when I will try to logon it will try to logon for ever.

I have completed missing class list from projectx/server
com.threerings.projectx.server.AccountActionManager
import com.threerings.projectx.server.persist.KnightRepository;
import com.threerings.projectx.server.persist.NameMapRecord;

com.threerings.projectx.server.KnightManager
import com.threerings.projectx.craft.server.persist.RecipeRepository;
import com.threerings.projectx.dungeon.server.persist.DungeonRepository;
import com.threerings.projectx.dungeon.server.persist.GateProgressRecord;
import com.threerings.projectx.guild.server.persist.GuildMemberRecord;
import com.threerings.projectx.guild.server.persist.GuildRepository;
import com.threerings.projectx.item.server.persist.ItemRepository;
import com.threerings.projectx.server.persist.KnightCatalogRecord;
import com.threerings.projectx.server.persist.KnightRecord;
import com.threerings.projectx.server.persist.KnightRepository;
import com.threerings.projectx.server.persist.NameMapRecord;
import com.threerings.projectx.server.persist.PlayerRecord;
import com.threerings.projectx.server.persist.PlayerRepository;
import com.threerings.projectx.server.persist.StoredObjective;
import com.threerings.projectx.social.server.persist.FriendRecord;
import com.threerings.projectx.social.server.persist.FriendRepository;
import com.threerings.projectx.uplink.server.persist.UplinkRepository;

com.threerings.projectx.server.ProjectXClientResolver
import com.threerings.projectx.server.persist.KnightRecord;
import com.threerings.projectx.server.persist.KnightRepository;
import com.threerings.projectx.server.persist.MachIdentRecord;
import com.threerings.projectx.server.persist.MachIdentRepository;
import com.threerings.projectx.server.persist.PlayerRecord;
import com.threerings.projectx.server.persist.PlayerRepository;
import com.threerings.projectx.uplink.server.persist.UplinkRepository;

com.threerings.projectx.server.ProjectXEvent
import com.threerings.panopticon.common.event.EventType;
import com.threerings.panopticon.common.event.annotations.Event;
import com.threerings.panopticon.common.event.annotations.Index;

com.threerings.projectx.server.ProjectXEventLogger
import com.threerings.panopticon.client.EventLogger;

com.threerings.projectx.server.ProlectXSceneRegistry
import com.threerings.projectx.server.persist.ProjectXSceneRepository;
import com.threerings.projectx.server.persist.SceneNameRecord;

com.threerings.projectx.server.ProjectXServer
import com.threerings.projectx.server.persist.MachIdentRepository;
import com.threerings.projectx.server.persist.PlayerRepository;
import com.threerings.projectx.server.persist.ProjectXSceneRepository;
import com.threerings.projectx.slink.server.SlinkManager;
import com.threerings.sega.SegaPass;
import com.threerings.slink.server.SlinkRegistry;
import com.threerings.underwire.server.SupportManager;

com.threerings.projectx.server.ProjectXSession
import com.threerings.projectx.server.persist.KnightRepository;
import com.threerings.projectx.server.persist.MachIdentRepository;
import com.threerings.projectx.server.persist.PlayerRepository;
Also you need to add to your code ooo-cron-1.1.jar and ooo-facebook-1.1.jar because this files are used too.

I think that some part can be bypassed same way like it was done in other game called "Puzzle Pirates"
Search for ThreeDonuts Puzzle Pirates and you will find tool and source ;]
I'm not that good in java but if I'm not wrong somebody listened TCP and UDP packets when he is connecting to server and he has emulated this packets in his app.
 
Newbie Spellweaver
Joined
Aug 13, 2014
Messages
12
Reaction score
5
[Sorry. This has been redacted]
 
Last edited:
Newbie Spellweaver
Joined
Aug 13, 2014
Messages
12
Reaction score
5
[Sorry. This has been redacted]
 
Last edited:
Newbie Spellweaver
Joined
Aug 13, 2014
Messages
12
Reaction score
5
[Sorry. This has been redacted]
 
Last edited:
Initiate Mage
Joined
Nov 27, 2018
Messages
1
Reaction score
0
I am aware that this is a bit of an old topic, though I have come here in an attempt to revive the Spiral Knights server project.

My expertise is in C#, SQL, javascript/css/html, game and web development, and intermediate reverse engineering. Right now I am taking a look at what can be done in order to at least play offline or over LAN. If anyone else has any information, please send me a PM or email me at cooltripct@gmail.com.

I will start trying to figure the files out, and hope for the best - this game was amazing in my opinion.

Right now, I believe I am just missing the ProjectX dependencies, but it may only be a matter of time to replicate or find them.
 
Newbie Spellweaver
Joined
Jul 17, 2019
Messages
8
Reaction score
0
So was this project abandoned? I would extremely wish to be able to download a working server of Spiral Knights, just as insurance so I know I can always play it even when the main game dies, so, if you're losing/lost motivation, I'd extremely encourage you to carry on!
 
Newbie Spellweaver
Joined
Jul 17, 2019
Messages
8
Reaction score
0
Man! I can't tell you how thankful and excited I am that you're doing this! Seriously man! You've been working on this for what, 5 years!? That amount of perseverance is really admirable, keep up the good work!
 
Back
Top