Jump to content
Eternal Lands Official Forums
Entropy

Server chooser GUI

Recommended Posts

Since i've been playing around with the SDL lib during the last weeks, i *might* volunteer writing such a starter menu (but i dont know exactly, when i have the time to do it, so if it's urgent, i'm out)

 

I would make a window sized 640x480, which loads a background picture, if available, and displays the first word of each line (without comments) from servers.lst found in ~./elc (or the corresponding windows directory), like this:

1 - main
2 - pk
3 - test

ESC - Quit

 

With a single key press you can choose server 1, 2 or 3 (or by hitting ENTER server 1), then the program would

start el.exe (for windows) with the right command line or, for Linux, it tries to start

 

1) elc (if available)

2) el.x86.linux.bin

 

with the right command line.

 

So, under Linux, if you want to use your self compiled client, or any of the others like el.x86.amd.linux.bin, you must rename (or copy) them to elc, otherwise el.x86.linux.bin will be started per default.

 

Help i would need:

 

o someone who creates a 640x480 *.bmp pic for the background EL stylish

 

o someone who can compile that thing for windows with gcc, i can only compile it for Linux. And test it, of course.

 

Thoughts, ideas?

 

Piper

Share this post


Link to post
Share on other sites

I can compile for windows, I just wrote a sample sdl image loader to make sure.

 

Mail me the source to labby@labby.co.uk

Share this post


Link to post
Share on other sites

SDL is a great way to do it. But I'd like to have some buttons and stuff.

It just so happens that I am working at an unrelated application as a hobby, using SDL for the GUI (an ARM disassembler).

If you need the init code and stuff (guaranteed to work on Windows) let me know. I also have the code to load 8b BMPs, and to print colored strings (one line strings only).

Share this post


Link to post
Share on other sites
SDL is a great way to do it. But I'd like to have some buttons and stuff.

It just so happens that I am working at an unrelated application as a hobby, using SDL for the GUI (an ARM disassembler).

If you need the init code and stuff (guaranteed to work on Windows) let me know.

Ok, you've got a forum PM :)

 

I also have the code to load 8b BMPs, and to print colored strings (one line strings only).

 

Nice, colored strings, was looking for something like that too.

 

Piper

Share this post


Link to post
Share on other sites

I have code for loading dds images and I have code that can detect the supported FSAA (Full Scene Anti-Aliasing) modes of a graphic card (using glx). I am working at FSAA detection for windows. For mac I can only write code, but I can't test or debug because I have no mac. If anyone want to have it, just tell me.

Edited by Xaphier

Share this post


Link to post
Share on other sites

Ok, here is now a screenie of a first dirty hack, which seems to work under Linux, at least it starts the right client with the right parameter.

 

Clicky: http://img.photobucket.com/albums/v623/the...erverSelect.png

 

(At least i have now an EL stylish background picture to honor our old friend piggy, lol :P )

 

So i am going to work on the GUI then, add buttons that you can just click to select a server, add support for cursor up/down keys, make everything looking more nice, and and and..

 

And then pester Labrat to test it for Windows :)

 

Is someone able and willing to compile and test it for Macintosh?

 

@radu:

Can i use the fonts which come with the EL client? The one i am using right now is free, but ugly IMO and it seems to be easy to change your colored string printing routine to the format of the EL bitmap fonts.

 

More to come soon..

 

Piper

Share this post


Link to post
Share on other sites
Yes, sure, go ahead.

Did you find my code useful, or is it too hard to use/modify?

 

The code about colored text is useful and quite easy to understand, i'm going to modify it to use the EL bitmap fonts and replace my own write_text() function with it.

 

Today/this weekend i will have a closer look at the gui code and try to add it to my coding.

 

Piper

Share this post


Link to post
Share on other sites
How about the load bitmap code? That's a little bit more tricky.

 

I haven't had a look at it right now, playing with the EL bitmap fonts kept me busy today, at least i can use now the EL bitmap fonts with my own write_text() function, which uses bitblt().

 

So i am going to use this function to display text to create clickable buttons (and try to reuse stuff from your gui code, everything else is just fine tuning imo :D)

 

Next thing i was thinking about was the auto update:

 

The auto update could copy a new client named el.exe.new for windows and el.x86.linux.bin.new onto the local computer and then terminate.

 

The server selector could check if el.exe.new or el.x86.linux.bin.new are in the EL directory, and if yes, try to replace the current client with the *.new one.

 

Do you want such a feature? Thats just a few lines of code, but that method can fail due to access rights of the EL folder.

 

My time table is, to get it technically working until the 25th of april, because then i am off for a week for vacations, so it would be nice to have a version, which runs under linux/windows and maybe OSX (if someone wants to volunteer to test this stuff for OSX).

 

And it would be nice, if someone volunteers to create a background picture, to get rid of that fat pig :)

 

Thats my goal right now, other things, like making it look very nice, is IMO at a lower priority.

 

Piper

Share this post


Link to post
Share on other sites

Well, there is no rush, but I'd like to have it done (and tested) by late may.

Updating the bin might be a problem, not sure if Vista prompts the user for that or just ignores it. I think for Linux you must do a su or something.

But it would be nice if we could at least move the normal update code from the client to this program.

Share this post


Link to post
Share on other sites
Well, there is no rush, but I'd like to have it done (and tested) by late may.

Ok, thats plenty of time for coding, discussing/testing :)

Updating the bin might be a problem, not sure if Vista prompts the user for that or just ignores it. I think for Linux you must do a su or something.

Under Linux it depends on how you install it. If you install EL as admin and run it as a usual user, you have to use admin rights (su) to update the client. I myself install it as myself, a user, not an admin, because nobody else than me is using my computer.

 

So, yes, that might be a problem both under Windows/Linux/OSX, to update the client itself.

 

And even the data files, if someone got the glorious idea to set all data files access rights to readonly as an admin and runs the game from a non-admin account. >.<

 

But it would be nice if we could at least move the normal update code from the client to this program.

 

I will add that to my mental to do list, makes sense, to have all update features in only one program.

 

Latest feature added after a chat with some players:

 

The server selector interprets now the argv[] parameter list, so you can create shortcuts again on your desktop and connect to your desired server with just a mouse click.

 

Meaning:

"serverselector.bin main" connects to main server

"serverselector.bin pk" connects to pk server

"serverselector.bin test" connects to test server

 

And the serverselector can now start multiple clients, so you can log on to main server, then another client to PK server, then a 3rd client to test server, or whatever :P

 

Piper

Share this post


Link to post
Share on other sites
And the serverselector can now start multiple clients, so you can log on to main server, then another client to PK server, then a 3rd client to test server, or whatever :)

Does/will that include multiple clients on the same server? After all, multi-playing is allowed on the PK server so many/most people are running more than one client there.

Share this post


Link to post
Share on other sites
And the serverselector can now start multiple clients, so you can log on to main server, then another client to PK server, then a 3rd client to test server, or whatever :)

Does/will that include multiple clients on the same server? After all, multi-playing is allowed on the PK server so many/most people are running more than one client there.

 

Under Linux it's a yes, i'm starting the clients in the background (with "&"), so the serverselector gets control back and can start other clients, there are no limits to just one client to one server.

 

Hopefully that method via system() command works under windows too.

 

Piper

Share this post


Link to post
Share on other sites

And an update:

 

Screenshot-EternalLandsServerSel-2.png

 

The buttons are now clickable, you can navigate through the buttons with the TAB key and hit ENTER to select the highlighted (green) button.

 

(The list of buttons/servers is of course dynamically taken from servers.lst from the EternalLands directory, so there is space for one or two more servers, limited by the screen size)

 

So 99% of all players, who just want to log in into main server, have just to hit the ENTER key to start the client.

 

Plus you can create shortcuts on your desktop and add the desired server as a parameter to the server selector.

 

The future plan is to post a link to a zip file here with the source code during the next days. And hopefully Labrat is back then and can volunteer as a tester for windows \ö/

 

Still needed: A volunteer to test it for mac.

 

And an artist, to improve the crappy background picture :)

 

Piper

Edited by The_Piper

Share this post


Link to post
Share on other sites
(The list of buttons/servers is of course dynamically taken from servers.lst from the EternalLands directory, so there is space for one or two more servers, limited by the screen size)

servers.lst:

# ID			Config Dir	  Address				 Port	Description (to be used for server selection window)
main			main			game.eternal-lands.com  2000	Main game server
pk			  pk			  game.eternal-lands.com  2002	PK game server
test			test			game.eternal-lands.com  2001	Test server
lrnr-main	   main			proxy1.other-life.com	443	Learner's redirection service for the Main game server

I assume this is obvious and only not done due to development phase, but figured i'd ask anyway;

Any reason why the descriptive server title (column 5, "Description") isn't being used for the menu buttons? Would look 'nicer' :P

 

EDIT: If the descriptive titles are to be used, perhaps future servers.lst's should have "Learner's redirection service for the Main game server" replaced with "Main server (Learner's proxy)", so the menu button isn't too long.

Edited by Korrode

Share this post


Link to post
Share on other sites
EDIT: If the descriptive titles are to be used, perhaps future servers.lst's should have "Learner's redirection service for the Main game server" replaced with "Main server (Learner's proxy)", so the menu button isn't too long.

 

Agreed, it doesnt look very nice as it is now :P

 

Screenshot-EternalLandsServerSel-3.png

 

Piper

Share this post


Link to post
Share on other sites
And here is the source code: http://the-green-leaf.de/serverselector.zip

This is looking good:)

A few of comments. The app uses 100% of my CPU so may be you could add a sleep in there somewhere or an event queue, sorry I have not studied the code much to see what you are doing. I wonder if the app should not quit once you have launched the game.... How about highlighting the option under the mouse in some way? Could there be an error message if the launch fails? May be you could suggest the user look in the error_log.txt.

Share this post


Link to post
Share on other sites
The app uses 100% of my CPU so may be you could add a sleep in there somewhere or an event queue,

Opps.. with an usleep() its now down to 2-3%.

I wonder if the app should not quit once you have launched the game....

No, you might want to start more than one client. For your alt maybe, or one for main server, the 2nd one for PK server, and and and.

How about highlighting the option under the mouse in some way?

I think no, that would be too confusing IMO. Click and you select the button. At least you see where the mouse pointer is, that should be enough :P

 

Could there be an error message if the launch fails? May be you could suggest the user look in the error_log.txt.

 

Yeah, that would be handy. Not everyone starts the program from a console and sees the error messages.. I'll add something like that and post an update tomorrow or so.

 

Piper

Share this post


Link to post
Share on other sites

Nice, but two things:

1. Most people do not start multiple clients, so it should quit after the selection has been made.

2. We need some sort of text area somwhere at the bottom, so that when you mouse over a button it will display the description. It is very important for newbies to have that.

Share this post


Link to post
Share on other sites
Nice, but two things:

1. Most people do not start multiple clients, so it should quit after the selection has been made.

Ok, i'm adding a config file with an option. Default is, the server starter terminates after starting the client. And the few ppl who start more than one client, can edit the config file and turn on that option.

 

So the huge majority of players must just start the server selector, hit ENTER key and the client starts and connects to the main server and the server selector terminates.

 

2. We need some sort of text area somwhere at the bottom, so that when you mouse over a button it will display the description. It is very important for newbies to have that.

 

What kind of description are you thinking about? Like "Click here to connect to Main game server" (bold part is taken from servers.lst).

 

This message could overwrite the yellow message at the bottom (Select the server to....). So per default the yellow "Select server..." message is displayed, but when the mouse pointer is over a button, it changes to "Click here to connect...".

 

Piper

Share this post


Link to post
Share on other sites
What kind of description are you thinking about? Like "Click here to connect to Main game server" (bold part is taken from servers.lst).

I would think more of a description of the items (e.g. The longer text about Learner's proxy service) would be good for newbies.

 

Maybe another "field" for description should be added to the servers.lst file?

Share this post


Link to post
Share on other sites

Ok, no config file, there is now an argument (-stay) the server selector interprets. Without that argument given, the server selector terminates after starting a client, with that argument, the server selector doesnt terminate and you can start more than one client.

 

What kind of description are you thinking about? Like "Click here to connect to Main game server" (bold part is taken from servers.lst).

I would think more of a description of the items (e.g. The longer text about Learner's proxy service) would be good for newbies.

 

Maybe another "field" for description should be added to the servers.lst file?

 

Descriptions like what?

Main server, the free server to play
PK server, the pay to play server, player killing
Test server, for testing purposes only

 

and such?

 

Piper

 

Edit:

 

To make it clear, i use the first word in a line of servers.lst to give it as an argument to the client.

The part of a line behind the port number is used as the text on the buttons.

Right now i use that text too to generate and display a message "Click here to connect to XXXXXXXXXX", when the mouse is over a button.

Do we really need a third text in servers.lst, or is it enough to change the description after the port number?

If we do, no problem to read a 3rd text, maybe separated from the description with a "#" sign or such.

Edited by The_Piper

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×