Just so you know, I've posted this to 3 places not including here, all with the username twostars. (Ragezone, Devias forums and my community - not advertising )
I just found this place so you guys rock.
I will attempt to make this guide 'general', that is - workable for most private server files. If you have a problem, please post here.
Note: This guide assumes you have a set of private server files and a client; the private server files pre-extracted.
Pre-step: Database
If your server files use a database, you'll need to go download mySQL 5.0 "Community Edition" from MySQL AB :: The world's most popular open source database
If you're unsure, look for a .sql file in your server files - if you find one, you'll know you need to continue with this "Pre-step". If not, continue to Step 1!
1. Download mySQL
If you're using Windows and have no idea what x64 is, download the "Windows" version rather than "Windows x64". ;P
2. Install and configure it.
- Typical Setup
- Skip Sign-Up
- make sure "Configure the mySQL Server now" is checked
- "Detailed Configuration"
- "Developer Machine"
- "Multifunctional Database"
- "InnoDB Tablespace Settings" - leave everything default
- "Decision Support (DSS)/OLAP"
- make sure "Enable TCP/IP Networking" is checked and leave the port number at 3306 (at this point, if you have a firewall, it will usually try to access itself on the localhost)
- "Standard Character Set"
- check "Install As Windows Service"
- I recommend leaving "Include Bin Directory in Windows PATH" checked
- enter your root password
- then hit "execute" and it'll install and set it up
Now download SQLyog
Run it.
Hit "Continue..."
Press "New", enter in "localhost" and press enter.
Fill in the details that aren't filled in (IE: password)
Hit "Connect" and press "Yes"
Open up your SQL file in notepad and copy the contents.
Back in SQLyog, paste the contents into the "Query" box then press the green triangle like a classic CD player's "play" icon, (it's the second one on the left just under the menu =]).
Congratulations. You've just setup the database.
I will not go into detail about the website/register page just yet. I'll add that into this tutorial sometime soon. =]
Step 1: Configuration
What we aim to achieve in this step: Have the server configured for public/private use
Private server files ALWAYS have something you need to pre-configure before compiling. This is usually the server IP, but with private servers that support mySQL databases, they can also have database server IP, database username and of course the database password - NOT to mention the database name itself.
The more user-friendly private servers have a separate configuration file, nearly always ending in a ".CFG" file extension.
Common sense will help you find the right one.
Once you've found it, fill in the details it asks. Again, common sense.
If however you cannot find a file ending in ".CFG" with anything that MUST be configured, your best bet is to look in "client.java". This is something I despise in a set of private server files - having to go into the main source and manually LOCATE everything you need to change, when it could be so easily setup in a ".CFG" file.
You'll want to be searching for things like "SERVERIP" and "HOST". If these searches find nothing, (CTRL+F in any good text editor is what I'm referring to here) search for "localhost". If this search finds nothing, I suggest looking for "localhost" or just manually scrolling through, replacing them as you go. Remember: if it's got quotation marks (--> " <--) around it, then you can edit it. If not, it's most likely a function and you should NOT change it. ;D
Once you've found and replaced everything that should be configured, we move onto the next step. Compilation.
Step 2: Compilation
What we aim to achieve in this step: Successfully compile the server so that we can run it
This step can get ugly, so be on guard.
Firstly, make sure that you have the latest Java Development Kit (JDK) from java.sun.com so that you can compile your edited private server files.
At the time of writing this, the latest is JDK 6 update 3.
Once it's downloaded and installed, we may proceed.
Most private server files contain some sort of compiler batch script (most are named compiler.bat). I personally, don't really like any but Devias' as it's simple, and usable however I did make one adjustment to it so that it would display the details of any warnings or errors that the .java files may produce.
Make a folder called 'bin' if one doesn't already exist in your private server files folder.
This might be a little confusing, so I'll refer to the folders in a relative folder format, eg: \serverfiles\bin and \serverfiles
Now, back in \serverfiles\ right-click -> go New -> Text Document.
Call it "thecompiler" if recognized file extensions are hidden. If however, you see a ".txt" on the end, call it "thecompiler.bat".
Open it up in Notepad and stick this in:
Code:
@echo off
title Compiler
"C:\Program Files\Java\jdk1.6.0_03\bin\javac" -source 1.5 -target 1.5 -classpath . -d bin *.java -g -Xlint:deprecation
pause
If you're using a different JDK, change the folder path; also do this if you get a "File/Folder path not found" error in the console/command prompt.
If this file is a '.txt', go "Save as", change the type to "All files and folders" and then in the text-box above it (where you enter the filename), type 'thecompiler.bat'.
Otherwise, just go save and exit.
Run the compiler.
Ignore any warnings that may appear. Warnings are fine; errors are not.
Step 3: Running the server
What we aim to achieve in this step: Being able to run the server without any nasty errors, so users can login.
All private servers have a "runserver.bat" file. Simply run it and note what your server's console displays. If no nasty errors pop up, congratulate yourself; if they do, post them here. =]
Have fun guys and girls. ;D