Announcing the Sylverant PSO Server Project

This forum is for the posting of new newsposts, and it stores the site's news and comments archives. Only newsposters have access to post new news in here; if you wish to submit news, please post it in the discussion section for your particular topic. We may choose to move it here as a newspost if we find that it's worthy for the front page.
Post Reply
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Announcing the Sylverant PSO Server Project

Post by BlueCrab »

Even though the day is almost over, and its not exactly what I was planning for the occasion of 9/9/09, I'd like to announce the Sylverant PSO Server Project.

Basically, Sylverant is an open-source Phantasy Star Online server written for Unix-like operating systems (Linux and Mac OS X are where it has been tested so far). My original plan was to have a fully-functional server running today, however a rather nasty bug exists when running the server under Linux, and the machine I'm running the server on runs Linux (thanks to GrizzlyAdams for use of the machine); so no running server today, sorry.

Anyway, if you care to know more and read about the project, visit http://sylverant.twihb.net/ . The current source code is available from the Google Code project linked to from there.
User avatar
Nico0020
DCEmu User with No Life
DCEmu User with No Life
Posts: 3837
Joined: Wed Oct 17, 2001 7:44 pm
Location: Fukuoka, Japan
Has thanked: 0
Been thanked: 1 time

Re: Announcing the Sylverant PSO Server Project

Post by Nico0020 »

only have one second to be on here, but very interesting. 1st in probably a series of a lot of questions from me. But will this be a completely independent server from schthack, or will your servers be linked and appear on the shipgate of schthack?
*The Cadillac of signatures*
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by BlueCrab »

Completely independent project, with its own shipgate and the like.
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Announcing the Sylverant PSO Server Project

Post by Neoblast »

Hummm, interesting, I would like to test it with someone, anyone up for it?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by BlueCrab »

Before anyone tries to run the server, and finds the major bug that prevented me from putting up an actual public server, I guess I should warn people about it...

For some (as of yet unknown) reason, when running the ship server on Linux, there's a bug where you cannot join an existing game. If you do, for some reason, the leader of the game will never send out all the synchronization data, thus you will end up staring at the pillar in the middle of the hunter's guild, unable to move. Also, the leader will end up frozen on the player is joining screen. Note that creating games and joining regular lobbies works just fine.

The bug doesn't happen when running the ship server on Mac OS X, which makes it a bit harder for me to debug (since I don't have direct, physical access to the Linux machine I'm running everything on).
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Announcing the Sylverant PSO Server Project

Post by Neoblast »

Oddly enough that bug happened in ther fuzziqer's server too, but only happened in the dc/pc version. it might be that the server HAS ( but doesnt, maybe thatpart is different form other versions of the game )to send the "PLAYER ALREADY HAS JOINED" command to everyone,then the player joining will spawn its character, and the oher won't be freeze no more with that "XXXXX player is joining the team please wait".

Can it be compiled for windows as well or only unix like systems?

Getting some game logs from this part, in both players, and both servers ( this and schthack for example ) would give us the idea of what is wrong or what data isnt sent.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by BlueCrab »

Neoblast wrote:Oddly enough that bug happened in ther fuzziqer's server too, but only happened in the dc/pc version. it might be that the server HAS ( but doesnt, maybe thatpart is different form other versions of the game )to send the "PLAYER ALREADY HAS JOINED" command to everyone,then the player joining will spawn its character, and the oher won't be freeze no more with that "XXXXX player is joining the team please wait".
What seems to be happening on Linux is that the leader never sends the second packet of game synchronization data. Other than that, the same things happens on Mac OS X as on Linux. On Mac OS X, all the synchronization data sends just fine (the code is the same between the two).
Can it be compiled for windows as well or only unix like systems?
The server is multi-threaded, and uses POSIX threads, so as long as there's a BSD-compatible network stack (Winsock should work fine here), and a working POSIX threading library, it should just work. The second part is what would prohibit it from working on Windows. In theory, it should work when compiled against Cygwin, but it hasn't been tested.
Getting some game logs from this part, in both players, and both servers ( this and schthack for example ) would give us the idea of what is wrong or what data isnt sent.
I've done plenty of packet logging, and like I said, my server behaves the same on Linux as it does on Mac OS X, but the game doesn't for whatever reason. The only obvious difference I can see is that the TCP receive window is different on Linux than it is on Mac OS X. I've tried at least two approaches to changing this but neither worked properly.
Ex-Cyber
DCEmu User with No Life
DCEmu User with No Life
Posts: 3641
Joined: Sat Feb 16, 2002 1:55 pm
Has thanked: 0
Been thanked: 0

Re: Announcing the Sylverant PSO Server Project

Post by Ex-Cyber »

BlueCrab wrote:The only obvious difference I can see is that the TCP receive window is different on Linux than it is on Mac OS X. I've tried at least two approaches to changing this but neither worked properly.
Could it be a race condition, or is that part strictly sequential?
"You know, I have a great, wonderful, really original method of teaching antitrust law, and it kept 80 percent of the students awake. They learned things. It was fabulous." -- Justice Stephen Breyer
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Announcing the Sylverant PSO Server Project

Post by Neoblast »

Hmmm it could be sent manually using the server.
As I said earlier this very same error occured in the pc part of kohle's server ( running on win ).
Do the clients keep sending the idle command every X seconds to the server when this occurs?

it was something like 04 00 00 00 and so on.

Try another TCP module, newer version or so.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by BlueCrab »

Neoblast wrote:Hmmm it could be sent manually using the server.
As I said earlier this very same error occured in the pc part of kohle's server ( running on win ).
Do the clients keep sending the idle command every X seconds to the server when this occurs?

it was something like 04 00 00 00 and so on.
Not that I've seen, no.
Try another TCP module, newer version or so.
I'm using version 2.6.30 of the Linux Kernel, which was the newest version up until today.
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Announcing the Sylverant PSO Server Project

Post by Neoblast »

The TCP module in MACOSX is different or does it use the same as linux?


Hmmm is command 65 sent properly?

Code: Select all


DC/GC: 67 NN SS SS CC LL 01 TT BB BB EE EE 00 00 00 00 <player data sets, 0x43C bytes each>

(S = size, N - number of players, C = client's ID, L = leader's ID, T = lobby number, B = block number, E = event)

Always one player in the 65 command.
Make sure the command 6F is sent after the player is done loading:

Code: Select all

6F - set game status (client->server) (all versions)
DC/GC: 6F 00 04 00
PC: 04 00 6F 00
BB: 08 00 6F JJ 00 00 00 00
(J = 0 if game is open, 1 if a quest is in progress and the game should not be joined by anyone else)
Note: this command tells when the client is done loading into a game, so other players may join
Also in the dc join game command something might be different because it has not been documented at least on all the docs I have, it seems to be the same as the pcv2 version but with some header differences...

Code: Select all

64 - join game (server->client) (all versions)

PC: 68 01 64 NN LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL WW WW WW WW WW WW WW WW WW WW WW WW
WW WW WW WW WW WW WW WW WW WW WW WW WW WW WW WW
WW WW WW WW WW WW WW WW WW WW WW WW WW WW WW WW
WW WW WW WW XX XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX YY YY YY YY YY YY YY YY YY YY YY YY
YY YY YY YY YY YY YY YY YY YY YY YY YY YY YY YY
YY YY YY YY YY YY YY YY YY YY YY YY YY YY YY YY
YY YY YY YY ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ
ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ
ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ
ZZ ZZ ZZ ZZ II MM 00 DD BB EE SS CC RR RR RR RR
00 01 00 00

DC FORMAT UNKNOWN

(N = number of players in game, L = map layout, W/X/Y/Z = player lobby data for players 1/2/3/4 respectively, I = client ID of joining player, M = leader ID, D = difficulty, B = battle mode enabled, E = holiday ID, S = section ID of original creator of game, C = challenge mode enabled, R = random number unique to this game, T = episode (0-2))
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by BlueCrab »

Neoblast wrote:The TCP module in MACOSX is different or does it use the same as linux?
Most certainly different. Mac OS X is based on FreeBSD, not Linux.
Hmmm is command 65 sent properly?

Code: Select all


DC/GC: 67 NN SS SS CC LL 01 TT BB BB EE EE 00 00 00 00 <player data sets, 0x43C bytes each>

(S = size, N - number of players, C = client's ID, L = leader's ID, T = lobby number, B = block number, E = event)

Always one player in the 65 command.
Make sure the command 6F is sent after the player is done loading:

Code: Select all

6F - set game status (client->server) (all versions)
DC/GC: 6F 00 04 00
PC: 04 00 6F 00
BB: 08 00 6F JJ 00 00 00 00
(J = 0 if game is open, 1 if a quest is in progress and the game should not be joined by anyone else)
Note: this command tells when the client is done loading into a game, so other players may join
Also in the dc join game command something might be different because it has not been documented at least on all the docs I have, it seems to be the same as the pcv2 version but with some header differences...

Code: Select all

64 - join game (server->client) (all versions)

PC: 68 01 64 NN LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL LL
LL LL LL LL WW WW WW WW WW WW WW WW WW WW WW WW
WW WW WW WW WW WW WW WW WW WW WW WW WW WW WW WW
WW WW WW WW WW WW WW WW WW WW WW WW WW WW WW WW
WW WW WW WW XX XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX YY YY YY YY YY YY YY YY YY YY YY YY
YY YY YY YY YY YY YY YY YY YY YY YY YY YY YY YY
YY YY YY YY YY YY YY YY YY YY YY YY YY YY YY YY
YY YY YY YY ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ
ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ
ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ
ZZ ZZ ZZ ZZ II MM 00 DD BB EE SS CC RR RR RR RR
00 01 00 00

DC FORMAT UNKNOWN

(N = number of players in game, L = map layout, W/X/Y/Z = player lobby data for players 1/2/3/4 respectively, I = client ID of joining player, M = leader ID, D = difficulty, B = battle mode enabled, E = holiday ID, S = section ID of original creator of game, C = challenge mode enabled, R = random number unique to this game, T = episode (0-2))
I don't know off the top of my head what happens where, but it should work right. Anything I've seen seems to work right.
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Announcing the Sylverant PSO Server Project

Post by Neoblast »

Hmmm try to make the server a little more verbosy, and compare the packets, there are enough differences with versions for one or two things to not work properly sometimes, and take a special look in these packets, maybe linux won't send them correctly or with a bad format thus why it hangs on that part...
I will test it tonight see if we can isolate this problem.
User avatar
Quzar
Dream Coder
Dream Coder
Posts: 7497
Joined: Wed Jul 31, 2002 12:14 am
Location: Miami, FL
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by Quzar »

Ex-Cyber wrote:
BlueCrab wrote:The only obvious difference I can see is that the TCP receive window is different on Linux than it is on Mac OS X. I've tried at least two approaches to changing this but neither worked properly.
Could it be a race condition, or is that part strictly sequential?
That's the first thing I thought when I saw 'multi-threaded'. It's almost assured that the threads would go in a different order between OSX and any Linux distro.
"When you post fewer lines of text than your signature, consider not posting at all." - A Wise Man
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by BlueCrab »

Quzar wrote:
Ex-Cyber wrote:
BlueCrab wrote:The only obvious difference I can see is that the TCP receive window is different on Linux than it is on Mac OS X. I've tried at least two approaches to changing this but neither worked properly.
Could it be a race condition, or is that part strictly sequential?
That's the first thing I thought when I saw 'multi-threaded'. It's almost assured that the threads would go in a different order between OSX and any Linux distro.
Games are guaranteed to be on the same thread (since currently, there's only one thread per block). I doubt its related to the threading...
Guaripolo
DCEmu Freak
DCEmu Freak
Posts: 89
Joined: Mon Jul 28, 2008 10:04 am
Has thanked: 0
Been thanked: 0

Re: Announcing the Sylverant PSO Server Project

Post by Guaripolo »

wow! Congratulations! this is a good surprise for the DC users! thanks!

Maybe a net auditing tool can be useful? (like wireshark). If the mac version runs fine and the linux don't, a comparision between the two sequences can isolate the problem.
User avatar
Neoblast
DC Developer
DC Developer
Posts: 314
Joined: Sat Dec 01, 2007 8:51 am
Has thanked: 3 times
Been thanked: 1 time

Re: Announcing the Sylverant PSO Server Project

Post by Neoblast »

Yeah, probably some packet isnt sent properly to the client, then it still waits for something and stands still.
Impulse921
DCEmu Newbie
DCEmu Newbie
Posts: 3
Joined: Thu Sep 17, 2009 3:21 am
Has thanked: 0
Been thanked: 0
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by Impulse921 »

BlueCrab, congrats on the server! This is very impressive.

This bug happens occasionally on the schthack server and is very common on the PPSOS v2. I wonder if it is a similar problem. I always thought it had to do with connection, but I guess it's in the code.

I grabbed the code from the Google site. How should I go about compiling it. I'd like to help in testing. I could run it on linux or Mac os x. What compiler would you recommend to get it running?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Announcing the Sylverant PSO Server Project

Post by BlueCrab »

Impulse921 wrote:BlueCrab, congrats on the server! This is very impressive.

This bug happens occasionally on the schthack server and is very common on the PPSOS v2. I wonder if it is a similar problem. I always thought it had to do with connection, but I guess it's in the code.

I grabbed the code from the Google site. How should I go about compiling it. I'd like to help in testing. I could run it on linux or Mac os x. What compiler would you recommend to get it running?
Well... If you're on Mac OS X, most of what you need is included with Xcode (at least on Leopard and Snow Leopard). You'll need to install MySQL (at least the development libraries) to build any part of it, and if you intend to run a shipgate/login server, you'll actually need to have a MySQL database running. Most of that can easily be transferred over to Linux. Note, a ship server is pointless without a shipgate to log into.

The build process... well... is a bit hairy at the moment. Only libsylverant (a dependency of all the other parts) has an autotools script setup at the moment. This is something I'd rather rectify before all kinds of people try to compile it and start reporting odd/random errors. But, if you really want to compile it ship server requires the following libraries: libsylverant, libcrypto (from OpenSSL, should be included just about everywhere), libiconv (only on Mac OS X), and libexpat. The other two parts require the MySQL libraries as well as what was listed there for shipgate. libsylverant itself requires libexpat and the MySQL libraries.

Hopefully this weekend I can work on the build process a bit and put up the stuff to set up a MySQL database for use with shipgate and login server.
Post Reply