Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[TUT] Setting up your GunZ Server on VPS or Dedicated Server.

Status
Not open for further replies.
Experienced Elementalist
Joined
Aug 10, 2009
Messages
210
Reaction score
17
// Connecting to your VPS or Dedicated Server \\
Search at your computer for : Remote Desktop
Open it and fill in the IP from your VPS or Dedicated Server.
Then hit CONNECT button, then you will see a new window where u need to login, fill there your Login and Password in.
You can find your login and password in the e-mail you received or at the control panel where u bought your VPS or Dedicated server.
Standard login = Administrator, and your password is at mine server the same as the password where I registered with on the website.

// Installing Framework \\
Before u start setting up your server be sure u install the latest verison of Framework on the VPS or Dedicated server, if you don't do this you can get problems with installing the MSSQL Server.
You can download Framework 3.5 what is needed by clicking .
Finish the hole set-up and if you are done go to the next step.

// Installing MSSQL Server \\
Okay you just finished your Framework installation and now we are gonna set up the MSSQL 2005 Server.
First you have to download SQLEXPR32_NLA.exe by clicking .
Just follow the setup, but be sure u set up a "SA" account!
If you are done with that one you have to download SQLServer2005.
You can download SQLServer2005 by clicking .
And here you have to follow the set up to.

// Server Files \\
Before you go to the next step you should upload your server files and ofcourse the .sql file what is needed for the next step.
To be sure no one can download your server files you can upload it on: because you are there allowed to upload files with passwords.
Press right click on your server files map and click on: "Add to archive" then there will come a pop-up screen.
Go to the tab 'Extensive' and then click on 'Password' fill there your password in to protect your files.
If you filled in a password click on 'OK' and again on 'OK' now he made a .rar map on the directory you choised.
Now you go to and upload your file.
And now you can go to the next step of the tutorial.

// Installing winRAR \\
You just have uploaded your server files with a password on multiupload and ofcourse you wan't to download them.
But to open .RAR files you need winRAR, downloading winRAR is kinda easy and fast.
You can download winRAR by clicking .

// Download Server Files \\
You uploaded the server files from your PC on multiupload.
Open Internet Explorer in your VPS or Dedicated Server and go to the download link from your Server Files.
Download it and save it on your desktop, if you are done with download what won't take long you have to extract the files.
Right Click on your Server Files map > Extract.
Now you have to type in your password and then click 'OK'.

// The GunZ Database \\
Open SQL Server Management Studio Express and connect to your MSSQL with the "SA" login.
Right click on the 'Databases' tab and click on 'New Database'.
You will receive a pop-up with the database name.
Fill in at 'Database name:' GunzDB and click on 'OK'.
Now you made your Gunz Database, double click on the 'Databases' tab and in there you will see 2 maps, System Databases and GunzDB.
Now you have to go to your server files and open the .sql file.
Copy all the text in there and then I will tell you now where you have to paste it.
Right click on GunzDB > New Query > Paste there in your .sql file and click on 'EXECUTE'

// Database IP \\
Okay you are still in SQL Server Management Studio Express if I'm right.
Double click on GunzDB and again double click on 'Tables'.
Now scroll down till you see 'ServerStatus' press right click on it and click on 'OPEN TABLE'.
Then fill this in:
ServerID: 1, CurrPlayer: 0, MaxPlayer: 500, Time: 9-7-2010 15:18:15, IP: VPS / Dedicated Server IP goes here, Port: 6000, ServerName: My GunZ Server, Opened: 1, Type: 4
Type 3 = Clan Server and Type 4 = Quest Server.
Now click on 'CHANGE TYPE' and click on 'UPDATE', if you did that you may close the MSSQL Server Studio Express program.

// Configrate The Server Files \\
Go to your server files and open the server.ini file.
You will see something like this (open spoiler):
[DB]
DNS="GunzDB"
USERNAME="sa"
PASSWORD="password"

[SERVER]
MAXUSER=500
SERVERID=1
SERVERNAME="My GunZ Server Name"
FREELOGINIP="VPS or Dedicated IP Adress"
KEEPERIP="VPS or Dedicated IP Adress"
MONITORIP="127.0.0.1"
MONITORPORT=9000
MODE="test"
COUNTRY="INTERNATIONAL"
LANGUAGE="INTERNATIONAL"
USETICKET="0"

[LANGUAGE]
LANG_TYPE="eng"

[LOCALE]
DBAgentPort=5100
DBAgentIP=127.0.0.1

[FILTER]
USE="0"
ACCEPT_INVALID_IP="1"

[ENVIRONMENT]
USE_HSHIELD="0"
USE_XTRAP="0"
USE_EVENT="0"
USE_FILECRC="0"
USE_MD5="0"
Please don't edit the 127.0.0.1 because if you edit them people can have AE's (Agent Error's) or people can't see your server.
Be sure you edit the 'password' with your MSSQL Server password or the server can't connect to your database.
Then fill in at the SERVERNAME="my server" your server name, replace my server with your own server name.
Then you should change the FreeLoginIP and KeeperIP to your VPS or Dedicated Server IP Adress.
If you all did this you can SAVE the file.
Now open LOCATOR.INI and that should look something like this (open spoiler):
[DB]
DNS="GunzDB"
USERNAME="sa"
PASSWORD="password"

[NETWORK]
IP="127.0.0.1"
PORT="8900"

[ENV]
ID="1"
LOCATOR_UID_HIGH="5"
LOCATOR_UID_LOW="0"
MAX_ELAPSED_UPDATE_SERVER_STATUS_TIME="1000"
UDP_LIVE_TIME="10000000"
MAX_FREE_RECV_COUNT_PER_LIVE_TIME="9"
BLOCK_TIME="0"
UPDATE_UDP_MANAGER_ELAPSED_TIME="3"
MARGIN_OF_ERROR_MIN="500000"
USE_COUNTRY_CODE_FILTER="no"
GMT_DIFF="-3"
ELAPSED_TIME_UPDATE_LOCATOR_LOG="3600000"
ELAPSED_TIME_UPDATE_LOCATOR_LOG="10000"
ELAPSED_TIME_UPDATE_COUNTRYCODEFILTER_LOG="10000"
UPDATE_COUNTRY_CODE="66 89 69 77 73 83 65 78 68"
TEST_SERVER="0"
There you only have to edit your MSSQL Server password and then you can save the file.
The last part of the configration is the AgentConfig.xml.
Right click on AgentConfig.xml then go to: Open With > Notepad.
AgentConfix.xml shoud look something like this (open spoiler):
<?xml version="1.0" encoding="euc-kr"?>
<XML>
<AGENTCONFIG>
<NAME>My GunZ Server Name</NAME>
<MAXCLIENT>500</MAXCLIENT>
<MATCHSERVERADDRESS ip="127.0.0.1" tcpport="6000"/>
<ADDRESS ip="Dedicated or VPS IP goes here." tcpport="7777" udpport="5100"/>
</AGENTCONFIG>
</XML>
Now change My GunZ Server Name to your gunz name and change the Dedicated or VPS IP goes here to the real IP from your Dedicated or VPS Server.
Now save the file and you can close the server files for now.

// Installing XAMPP \\
To set up your GunZ Website is XAMPP recruited.
You can download XAMPP by clicking .
Just follow the instructions, if you are done with your download you open the XAMPP Control Panel and u see like 5 things that are stopped at that moment.
Enable the 'APACHE' by clicking on 'START'.

// Setting Up The GunZ Website \\
Okay your 'APACHE' server is running if you did it good and now we gonna set up an easy registration page.
Go to: My Computer > Local Disk (C:\) > XAMPP > htdocs.
There u see a couple of files, you can delete them all.
Now make a new file in there named by: index.php and open it.
Now open the spoiler and copy & paste that text into the index.php.
<title>Beyond GunZ - Registration</title>
<center><style type="text/css">
.registro{font: Georgia, "Times New Roman", Times, serif; color: #777; font-size: 14px;}
.registroinput{font: Georgia, "Times New Roman", Times, serif; color: #777; font-size: 14px; border: #000 1px solid; background: #C90;}
</style>


<script language=JavaScript>
<!--
var message='Right click is Disabled!';

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function('alert(message);return false')
// -->
</script>


<?php

$servername = "Beyond GunZ";
$accounttable = "Account";
$logintable = "Login";

$host = "MSSQL Hostname";
$user = "sa";
$pass = "MSSQL Password";
$dbname = "GunzDB";

$connect = odbc_connect("Driver={SQL Server};Server={$host}; Database={$dbname}", $user, $pass) or die("Can't connect the MSSQL server.");

function antisql($sql) {
$sql = preg_replace(sql_regcase("(select|union|0x|cast|exec|varchar|insert into|delete from|update account|update login|update character|ugradeid|drop table|show tables)"),"",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
}

function gtfo($wut) {
echo "<center><table width='400' cellpadding='5' cellspacing='0' border='0' class='registro'>
<tr>
<td width='100%'><b>Beyond GunZ - Registration</b></td>
</tr>
<tr>
<td width='100%'><center>$wut</center></td>
</tr>
</table>";
die();
}

function checkemail($address) {
list($local, $host) = explode("@", $address);
$pattern_local = "^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?)\.([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$";
$pattern_host = "^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?)\.([-]?)[0-9a-z]*([-]?[0-9a-z]+)+)*\.[a-z]{2,4}$";
$match_local = eregi($pattern_local, $local);
$match_host = eregi($pattern_host, $host);
if($match_local && $match_host) {
return 1;
}
else {
return 0;
}
}

function num_rows(&$rid) {

//We can try it at least, right?
$num= odbc_num_rows($rid);
if ($num >= 0) {
return $num;
}

if (!odbc_fetch_row($rid, 1)) {
odbc_fetch_row($rid, 0);
return 0;
}

if (!odbc_fetch_row($rid, 2)) {
odbc_fetch_row($rid, 0);
return 1;
}

$lo= 2;
$hi= 8192000;

while ($lo < ($hi - 1)) {
$mid= (int)(($hi + $lo) / 2);
if (odbc_fetch_row($rid, $mid)) {
$lo= $mid;
} else {
$hi= $mid;
}
}
$num= $lo;
odbc_fetch_row($rid, 0);
return $num;
}
?>
<?php
$ip = antisql($_SERVER['REMOTE_ADDR']);

/*
An extra feature. This is NOT enabled before you remove this + the comment thingy's.

To ban 1 IP it will be:
if ($ip == "xxxxxx")
{
gtfo("Your IP is blacklisted.");
}

For multiple IP's, use this way:
if ($ip == "xxxxxx" OR $ip == "xxxxxx")
{
gtfo("Your IP is blacklisted.");
}
*/

$query1 = odbc_exec($connect,"SELECT AID FROM $logintable WHERE LastIP = '$ip'");

$i=1;
while (odbc_fetch_row($query1, $i)){
$aid = odbc_result($query1, 'AID');

$query2 = odbc_exec($connect,"SELECT UGradeID FROM $accounttable WHERE AID = '$aid'");
odbc_fetch_row($query2);
$ugradeid = odbc_result($query2, 1);

if ($ugradeid == "253")
{

gtfo("Your account has been banned, and you can not create a new account.");
}

$i++;
}

if (isset($_GET['act']) AND $_GET['act'] == "doreg")
{

if (!is_numeric($_POST['age']) OR !checkemail($_POST['email']) OR empty($_POST['username']) OR empty($_POST['password']) OR empty($_POST['email']) OR empty($_POST['name']) OR empty($_POST['age']))
{
gtfo("Failed.");
}

$query1 = odbc_exec($connect, "SELECT AID FROM $accounttable WHERE UserID = '" . antisql($_POST['username']) . "'");
$count1 = num_rows($query1);

if ($count1 >= 1)
{
gtfo("Username in Use.");
}

$query2 = odbc_exec($connect, "SELECT AID FROM $accounttable WHERE Email = '" . antisql($_POST['email']) . "'");
$count2 = num_rows($query2);

if ($count2 >= 1)
{
gtfo("E-Mail in Use.");
}

date_default_timezone_set('UTC');
$regdate = date("Y-m-d H:i:s");

$query3 = odbc_exec($connect, "INSERT INTO $accounttable (UserID, UGradeID, PGradeID, RegDate, Email, Age, Name) VALUES ('".antisql($_POST['username'])."', '0', '0', getdate(), '".antisql($_POST['email'])."', '".antisql($_POST['age'])."', '".antisql($_POST['name'])."')");

$query4 = odbc_exec($connect, "SELECT AID FROM $accounttable WHERE UserID = '" . antisql($_POST['username']) . "'");
odbc_fetch_row($query4);
$aid = odbc_result($query4, 1);

if (!$aid)
{
gtfo("Registration failed please report it on the forums!");
}

odbc_exec($connect, "INSERT INTO $logintable (UserID, AID, Password) VALUES ('".antisql($_POST['username'])."', '$aid', '".antisql($_POST['password'])."')");


gtfo("Your account has been created successfully.<br><br>
Username: $_POST[username]<br>
Password: $_POST[password]<br><br>
You are now allowed to play with your account on Beyond GunZ.");
}


echo "<table width='350' class='registro'>
<form action='" . $_SERVER['PHP_SELF'] . "?act=doreg' method='POST'>
<b class='registro'>Beyond GunZ - Registration</b><br><br>
<tr>
<td width='50%'><b>Username:</b></td>
<td width='50%'><input type='text' name='username'></td>
</tr>
<tr>
<td width='50%'><b>Password:</b></td>
<td width='50%'><input type='password' name='password'></td>
</tr>
<tr>
<td width='50%'><b>E-mail:</b></td>
<td width='50%'><input type='text' name='email'></td>
</tr>
<tr>
<td width='50%'><b>Name:</b></td>
<td width='50%'><input type='text' name='name'></td>
</tr>
<tr>
<td width='50%'><b>Age:</b></td>
<td width='50%'><input type='text' name='age'></td>
</tr>
<tr>
<td width='50%'><b></b></td>
<td width='50%'><input type='submit' value='Register!' class='registroinput'></td>
</tr>
</table>";
?>
Uhmm you see a lot of things there but just copy and paste it into your own index.php.
You have to edit the $host and $pass to your MSSQL server host & password or your registration page won't work.
This is just a simple registration page that I use atm for my server called: Beyond GunZ.
You can edit the Beyond GunZ name with what your server name is.
Then you save it and go to: ex. as it good is you will see a working registration page like here in the spoiler (open it):
ElternalFire - [TUT] Setting up your GunZ Server on VPS or Dedicated Server. - RaGEZONE Forums

// I Need More Help \\
You can always reply on this topic but you can contact me by my MSN to: RicKno@Live.nl
I can help you by Teamview or if you have error what u can't fix by yourself.


I hope this Tutorial helped you guys to set up your GunZ Private Server on a VPS or Dedicated Server.

Don't forget to press the 'THANKS' button if I helped you!

Thanks for Reading,

Rick
 
Last edited:
Initiate Mage
Joined
Jul 8, 2010
Messages
56
Reaction score
1
Just to let you know . Make your video title in a different language, like Chinese, or Nhn Corp., will have them removed.
 
Experienced Elementalist
Joined
Aug 10, 2009
Messages
210
Reaction score
17
Yeah or just no language =D
I don't talk in it ^^
I talk in it but not with voice ^^
and NHN sux ^^
 
Last edited:
Skilled Illusionist
Joined
Dec 25, 2009
Messages
370
Reaction score
234
Do you not need to install the odbc driver?
 
Status
Not open for further replies.
Back
Top