• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

eqs

[java] Java server?

6 posts in this topic

What would i have to do to implement a high score server for a game? My understanding is that the server class must be RUNNING as in in a window type running, on the actual servre. How do i make it run without opening it up in a window?? If that makes sence PLEASE reply. Its stopped me doing soo much and its such a stupid thing to get stuck on. PEAC GAZZ
0

Share this post


Link to post
Share on other sites
If you are running NT for your web server, then you will always need some sort of "window" open just to get to the command line(AFAIK, I don't do much with NT). Now that i think about it... i don't know how to get to a command line from Gnome or KDE either without opening up a terminal window. But other than that, you don't need to code any java.awt.Window or java.awt.Frame into your server application to get them to listen on ports. If your server allows you to run java apps, just telnet in and type the correct command.

Edited by - Jim_Ross on 2/11/00 8:46:53 AM
0

Share this post


Link to post
Share on other sites
So your saying i can put the server.class whereever, and i telnet into it? I suppose that makes sence, but how would the client connect to it then?

PEACE
GAZZ
0

Share this post


Link to post
Share on other sites
I think you need to read up more on client/server relationships

In a nutshell:

The server will be listening on a port on the computer it's running on. You specify which port with a number in the cofe (there are standard ports used for certain purposes, so you should avoid those). The client should be written to check the port number the server is listening to. If the server is up and running when the client probes the port, the communication process begins.

If memory serves correctly, there was an article at
http://www.javacoffeebreak.com that explains java client/server stuff. Also, if you want to run the server from your personal page, you need to check with your host to make sure you have permission to run programs in your space. If you're using Yahoo/Geocities or Xoom or some such, then you probably don't.

Edited by - Aldacron on 2/11/00 10:03:11 PM

Edited by - Aldacron on 2/11/00 10:03:58 PM
0

Share this post


Link to post
Share on other sites
Aldacron:
So all i have to do, assuming im allowed programs on the web server. Is upload the server file? Then my prog will automattically be listening to the port?
Also, is it best to hardcode the URL? Or to make it with respect to the codebase?


Thanks for your help guys.

PEACE
GAZZ
0

Share this post


Link to post
Share on other sites
Really, you need to research this. Coding a server in Java is a cakewalk compared to C/C++, but it''s not something you can learn from a message board

To answer your question, you''re program will not automatically do anything! You need to start it first When the server is running it will listen to the port. That''s what a server does. A basic java server that does nothing would consist of 3 (at least 2) classes. The main function will be in MyServer. Of the other 2, one we''ll call MyPortListener, the other we''ll call MyConnection. (You could also put main in the MyPortListener if you wanted).

The program flow would be something like this:

In main you create a new MyPortListener. MyPortListener should implement Runnable (or extend Thread). When MyPortListener''s thread is started, it listens to the specified port. If a client requests a connection, MyPortListener creates a new MyConnection and then continues listening.

Now, obviously there would be more to it than that. Each connection would need to be handled in a seperate thread and you woul;d want classes to manage the flow of information between the server and each connection, but the outline above is the core of every server on the web. Listening to ports and creating connections.

And, yes, the port should be hardcoded into the source. It''s up to you which port number you use (as long as it''s not one of the standardized ports) and makes need not change even if the domain does. As far as the clients go, the actual URL to connect to should not be hardcoded (in most cases). It''s better to give the user an option. All depends on what you use it for. The port should be hardcoded in the client, but again, depends on what you use it for.

For a high-score server like you want, I would hardcode everything, including the URL. However, if you want to allow other people to run your high score server, hardcode the port in the server AND the client and let the user choose the URL.
0

Share this post


Link to post
Share on other sites