Log in

View Full Version : Making a server


Silicate Wielder
January 9th, 2012, 03:47 PM
I've tried to setup a chat network to test Server programing abilities and it seems not to write properly, Anyone know what i did wrong?
I want to make a multiplayer game and if i get the server up i do this, its just a matter of networking. Can someone help me with this?

Heres an example code i have

Start
Clear ["Players"]
Length of url ("Http://dl.dropbox.com/u/00000000/Servers/GE_U.txt")
Add (read file ("C:/Users/Example/User.txt") to [Last] of ["Players']
Write ((([Last] of ["Players"] to ("Http://dl.dropbox.com/u/00000000/Servers/GE_U.txt")
Set ["PUpdate"] to ("1")
Clear ["PlayerPositons"]
@Repeat ((Length of ["Players"]) - ("1")
Add (Line (PUpdate) of url ("Http://dl.dropbox.com/u/00000000/Servers/GE_U.txt") to ["PlayerPositions"]
Change ["PUpdate"] by ("1")
Broadcast ["Player Load"]

Its pretty basic but i still need to work on it so it has full functionality. I'll be using either Bingo or Panther to write the test game in.
It will be an Addon to the 3D Generator once its finished and perfected.

Rayquaza
January 9th, 2012, 04:20 PM
Have you port forwarded to allow incoming connections?

Silicate Wielder
January 9th, 2012, 04:23 PM
Have you port forwarded to allow incoming connections?

I just typed up an example script take a look. If i can't use the URL then how would I go about using an IP?

TheMatrix
January 9th, 2012, 07:59 PM
You're going to use....dropbox!? That will never work efficiently or well!
First of all, in order for the chat to work, it looks like you will be reading and writing to the remote file many times per second. You don't even want to know how slow that will be. Be considerate, not everyone has a T1 line at their house ;)

You will need to have your own dedicated server, such as IRC and interface that through your code. You can set up your own or use one such as freenode. If you want to set up your own server, you will need your own IP address and server that allows you to run daemons. Start looking for ways to buy a VPS.

Also, the code you have makes no sense to me. Consider putting comments in it; not everybody can read FORTRAN(or whatever that is).

Rayquaza
January 10th, 2012, 03:06 PM
It doesn't to me either.

Maybe put it into pseudo code?

Commander Thor
January 10th, 2012, 03:13 PM
Yeah, you can't use dropbox to host the file.

If you're just in the process of writing it, I wouldn't even begin to worry about getting it on the web.
First thing I'd do, is install either IIS if you're on Windows, or Apache if you're on Linux, then use either the url http://localhost/ for your url, or the IP address http://127.0.0.1/ for your development/testing. After you have an actual working product, then you can go about getting a web host that will allow you to run that, or use a service like DynDNS to run it off your local machine.

Silicate Wielder
January 10th, 2012, 03:23 PM
Yeah, you can't use dropbox to host the file.

If you're just in the process of writing it, I wouldn't even begin to worry about getting it on the web.
First thing I'd do, is install either IIS if you're on Windows, or Apache if you're on Linux, then use either the url http://localhost/ for your url, or the IP address http://127.0.0.1/ for your development/testing. After you have an actual working product, then you can go about getting a web host that will allow you to run that, or use a service like DynDNS to run it off your local machine.

I've done this before exept this new code allows for Multi-player game type chatting :) Last time i used it it just posted the backblog plus the message you typed in. and it was very slow. But How do I go about directing the Client to the right files?

Also, the code you have makes no sense to me. Consider putting comments in it; not everybody can read FORTRAN(or whatever that is).

This code tells the client to clear out its Cache and download a new list of Usernames and add the Players Username into the Host Player Cache, It then Uses the list named "Player Positions" to Add each user into the Directory and sends the code to load each players Avatar and complete the loading proccess

I could test this using the Computers Internal file system by operating two clients at one time.

Please don't double post. Use the "Multi-quote" or Edit button if you have something to add. ~TheMatrix

TheMatrix
January 10th, 2012, 07:40 PM
This code tells the client to clear out its Cache and download a new list of Usernames and add the Players Username into the Host Player Cache, It then Uses the list named "Player Positions" to Add each user into the Directory and sends the code to load each players Avatar and complete the loading proccess

I could test this using the Computers Internal file system by operating two clients at one time.
darkwoon and I were busy with a complete server a while ago (http://www.virtualteen.org/forums/showpost.php?p=1367583&postcount=14). Due to a lack of time on my part, I stopped writing the client.(I should continue that some time...)

The server is in Java, so I don't know if that's compatible with your code.