In questo articolo, installeremo un server online Ragnarok su Ubuntu 14.04 x64. È possibile accedere come root o come utente con privilegi di superutente. È più sicuro configurarlo come utente non root con sudo. In questo tutorial, useremo i file del server rAthena.
Se stai usando Windows e hai Ubuntu Server (VPS o Dedicated), avrai bisogno dei seguenti programmi.
- FileZilla
- PuTTY
- Editor di testo (consigliato Sublime o Notepad ++)
Requisiti
- apache2 - Se hai intenzione di utilizzare phpMyAdmin per l'accesso remoto a mysql e la configurazione del tuo sito web.
- php5 - Per web e phpMyAdmin.
- phpmyadmin - Accesso remoto a MySQL tramite un browser web.
- mysql-server - il nostro database per il server di gioco.
- mysql-client
- idiota
- rendere
- gcc
- libmysqlclient-dev
- zlib1g-dev
- libpcre3-dev - Opzionale, per supporto PCRE.
- libssl-dev - Richiesto, per compilare con MySQL 5.5.
È possibile fare riferimento a questa guida per quanto riguarda l'installazione di Apache, MySQL e PHP.
Installazione dei pacchetti richiesti
Esegui questi comandi su SSH.
-
Utente root:
apt-get install php5 phpmyadmin mysql-server mysql-client git make gcc libmysqlclient-dev zlib1g-dev libpcre3-dev
-
Non root con privilegi sudo:
sudo apt-get install php5 phpmyadmin mysql-server mysql-client git make gcc libmysqlclient-dev zlib1g-dev libpcre3-dev
Dopo aver installato correttamente i requisiti del server, procediamo con l'installazione e la configurazione dei file del server.
Download dei file del server
Ora otterremo gli ultimi aggiornamenti dei file del server rAthena. Questi sono i file richiesti per l'esecuzione di un server Ragnarok Online. Esistono altri file server che possono essere utilizzati, come Hercules ed eAthena, ma in questo tutorial stiamo usando rAthena. Eseguire il comando seguente per scaricare i file.
git clone https://github.com/rathena/rathena.git ~/rAthena
Ciò inserirà tutti i file all'interno rAthenadella directory corrente nel terminale.
Per aggiornare i file del server all'ultima revisione, eseguire questo comando.
cd rAthena
git pull
Configurazione di MySQL
In questa parte, stiamo configurando MySQL per il database del nostro server. Innanzitutto, controlla se il tuo server MySQL è in esecuzione.
service mysql status
Se non è in esecuzione, immettere questo comando.
service mysqld start
Dopo aver eseguito i comandi sopra, apri la console MySQL.
mysql -u root -p
Ti verrà chiesta la password di root. Dopo aver effettuato l'accesso, digitare i seguenti comandi per creare il database per il nostro server.
CREA DATABASE (il nome del tuo database ragnarok); - Lo chiameremo "ragnarok".
mysql> CREATE DATABASE ragnarok;
Quindi, creare un nuovo utente per il DB Ragnarok e il DB di registro.
CONCEDERE TUTTO SU ragnarok. * A yourdatabaseusername @ localhost IDENTIFICATO DA "yourdesiredpassword"; - Creeremo un nuovo utente chiamato admin con una password di 123456 .
mysql> GRANT ALL ON ragnarok.* TO admin@localhost IDENTIFIED BY "123456";
È possibile sostituire localhost con un indirizzo IP se si desidera che l'utente sia in grado di accedere al server MySQL da remoto.
Crea un database di log per i log di gioco di Ragnarok.
CREA DATABASE (il nome del tuo database di registro): lo chiameremo "registro".
mysql> CREATE DATABASE log;
Imposta le autorizzazioni per l'utente che abbiamo creato in precedenza denominato admin .
mysql> GRANT ALL ON log.* TO admin@localhost;
Ripristina le tabelle richieste nel tuo database Ragnarok e log. Aggiorna la tua password dopo di -pconseguenza.
mysql> quit;
mysql -u admin -p123456 ragnarok < /path/to/your/rathena folder/sql-files/main.sql
mysql -u admin -p123456 log < /path/to/your/rathena folder/sql-files/logs.sql
Creazione di un account di gioco
Stiamo usando phpMyAdmin che abbiamo installato in precedenza per accedere al database. Accedi a phpMyAdmin tramite il tuo browser web.
Seleziona il ragnarokdatabase e scegli la logintabella. Possiamo vedere che c'è un record in quella tabella. Non cancellarlo / modificarlo ancora. Viene utilizzato dal server. Per creare un account di gioco, fai clic sulla scheda SQL nella logintabella per aprire l'editor delle query. Esegui la seguente query.
INSERT INTO `ragnarok`.`login` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`, `pincode`, `pincode_change`, `vip_time`, `old_group`) VALUES ('2000000', 'admin', 'password123', 'M', '[email protected]', '99', '0', '0', '0', '0', '0000-00-00 00:00:00', '', '0000-00-00', '9', '', '0', '0', '0');
Abbiamo inserito un nuovo utente nella tabella di accesso con le seguenti informazioni.
- account_id = 2000000 (Inizia sempre con 2000000, quindi 2000001 ...)
- userid = admin (il tuo nome utente in-game)
- user_pass = password123 (la password per il tuo account)
- sex = M (M o F, non usare S perché è solo per il server)
- email = [email protected] (l'email del tuo account, utilizzata per eliminare gli slot dei personaggi nel gioco)
- group_id = 99 (fare riferimento
/rathena/conf/groups.confe controllare le righe ID. Per ora, 99 per renderlo un account GM per l'utilizzo del comando speciale in gioco.)
- character_slots = 9 (Numero di caratteri che possono essere creati per account)
Lascia gli altri valori così come sono. Congratulazioni. Hai creato correttamente il tuo account per il gioco.
Configurazione dei file del server
Innanzitutto, devi conoscere l'indirizzo IP del tuo server. Potresti già saperlo poiché era già incluso nelle informazioni sul server del tuo VPS Vultr. Se vuoi controllarlo, digita:
ifconfig
Cerca la parte di eth0 inet addr: xxx.xxx.xxx.xxx . xxx.xxx.xxx.xxx sarà l'indirizzo IP del tuo server. Se hai installato Apache, puoi accedervi per verificare se il tuo server web è in esecuzione.
In FileZilla, accedi al tuo VPS con le credenziali del tuo server e accedi alla /rAthena/confcartella.
Modifica char_athena.confe map_athena.confcon il tuo editor di testo preferito.
Modifica char_athena.confda:
// Login Server IP
// The character server connects to the login server using this IP address.
// NOTE: This is useful when you are running behind a firewall or are on
// a machine with multiple interfaces.
//login_ip: 127.0.0.1
// The character server listens on the interface with this IP address.
// NOTE: This allows you to run multiple servers on multiple interfaces
// while using the same ports for each server.
//bind_ip: 127.0.0.1
// Login Server Port
login_port: 6900
// Character Server IP
// The IP address which clients will use to connect.
// Set this to what your server's public IP address is.
//char_ip: 127.0.0.1
Per:
// Login Server IP
// The character server connects to the login server using this IP address.
// NOTE: This is useful when you are running behind a firewall or are on
// a machine with multiple interfaces.
login_ip: xxx.xxx.xxx.xxx
// The character server listens on the interface with this IP address.
// NOTE: This allows you to run multiple servers on multiple interfaces
// while using the same ports for each server.
//bind_ip: 127.0.0.1
// Login Server Port
login_port: 6900
// Character Server IP
// The IP address which clients will use to connect.
// Set this to what your server's public IP address is.
char_ip: xxx.xxx.xxx.xxx
Dov'è xxx.xxx.xxx.xxxl'indirizzo IP del tuo server.
Nel inter_athena.txtfile, apporta queste modifiche:
// Global SQL settings
// overridden by local settings when the hostname is defined there
// (currently only the login-server reads/obeys these settings)
// MySQL Login server
login_server_ip: 127.0.0.1 // <- either 127.0.0.1 or your server's ip, we'll use 127.0.0.1 since it listens to own mySQL server, change it to IP if your mySQL Server is in different server.
login_server_port: 3306
login_server_id: ragnarok // <- change this to your mySQL User your created earlier
login_server_pw: ragnarok // <- its password
login_server_db: ragnarok // <- change this if your ragnarok db you set is different
login_codepage:
login_case_sensitive: no
ipban_db_ip: 127.0.0.1 // <- either 127.0.0.1 or your server's ip, we'll use 127.0.0.1 since it listens to own mySQL server, change it to IP if your mySQL Server is in different server.
ipban_db_port: 3306
ipban_db_id: ragnarok // <- change this to your mySQL User your created earlier
ipban_db_pw: ragnarok // <- its password
ipban_db_db: ragnarok // <- change this if your ragnarok db you set is different
ipban_codepage:
// MySQL Character server
char_server_ip: 127.0.0.1 // <- either 127.0.0.1 or your server's ip, we'll use 127.0.0.1 since it listens to own mySQL server, change it to IP if your mySQL Server is in different server.
char_server_port: 3306
char_server_id: ragnarok // <- change this to your mySQL User your created earlier
char_server_pw: ragnarok // <- its password
char_server_db: ragnarok // <- change this if your ragnarok db you set is different
// MySQL Map Server
map_server_ip: 127.0.0.1 // <- either 127.0.0.1 or your server's ip, we'll use 127.0.0.1 since it listens to own mySQL server, change it to IP if your mySQL Server is in different server.
map_server_port: 3306
map_server_id: ragnarok // <- change this to your mySQL User your created earlier
map_server_pw: ragnarok // <- its password
map_server_db: ragnarok // <- change this if your ragnarok db you set is different
// MySQL Log Database
log_db_ip: 127.0.0.1 // <- either 127.0.0.1 or your server's ip, we'll use 127.0.0.1 since it listens to own mySQL server, change it to IP if your mySQL Server is in different server.
log_db_port: 3306
log_db_id: ragnarok // <- change this to your mySQL User your created earlier
log_db_pw: ragnarok // <- its password
log_db_db: log // <- change this if your log db you set is different
log_codepage:
log_login_db: loginlog
Nel map_athena.txtfile, apporta queste modifiche:
// Character Server IP
// The map server connects to the character server using this IP address.
// NOTE: This is useful when you are running behind a firewall or are on
// a machine with multiple interfaces.
char_ip: x.x.x.x
// The map server listens on the interface with this IP address.
// NOTE: This allows you to run multiple servers on multiple interfaces
// while using the same ports for each server.
//bind_ip: 127.0.0.1
// Character Server Port
char_port: 6121
// Map Server IP
// The IP address which clients will use to connect.
// Set this to what your server's public IP address is.
map_ip: x.x.x.x
// Map Server Port
map_port: 5121
Dov'è xxx.xxx.xxx.xxxl'indirizzo IP del tuo server.
Apri subnet_athena.txte imposta l'indirizzo IP.
subnet: 255.0.0.0:x.x.x.x:x.x.x.x
E abbiamo finito di configurare il server.
Compilazione del server rAthena
Ora è il momento di compilare il server! In questa parte, devi sapere quale versione client Ragnarok Online utilizzerai per connetterti al server. Per l'installazione del client, visitare questa pagina .
Dopo aver deciso quale client utilizzare, modifichiamo alcuni file. Diciamo solo, abbiamo scelto di utilizzare il 08072013client poiché si tratta del client di rinnovo stabile.
Esegui questo comando sul terminale:
./configure --enable-packetver=YYYYMMDD
Sostituisci YYYYMMDDcon la data del cliente (riformattata).
./configure --enable-packetver=20130807
Lo script di configurazione eseguirà i test necessari e genererà i makefile per il nostro server.
Successivamente, compila il codice sorgente immettendo questi comandi:
make server
chmod a+x login-server && chmod a+x char-server && chmod a+x map-server
... e aspetta che finisca. Se si apportano modifiche ai file all'interno della /rAthena/srccartella, sarà necessario ricompilarlo.
make clean
make server
Configurazione della versione del pacchetto per le connessioni client
In FileZilla, punta alla /rAthena/dbcartella e modifica packet_db.txt.
Trova questa linea e modifica:
//
//packet_db_ver: 46
packet_db_ver: default
packet_keys_use: default
Dal momento che stiamo usando il 2013-08-07Ragexeclient, trova il client specificato di seguito e cerca i suoi packet_ver e packet_keys .
//2013-08-07Ragexe
packet_ver: 45
packet_keys: 0x7E241DE0,0x5E805580,0x3D807D80 // [Shakto]
Sostituire il valore predefinito di packet_db_vere packet_keys_usenei valori client specificati.
//
//packet_db_ver: 46
packet_db_ver: 45
packet_keys_use: 0x7E241DE0,0x5E805580,0x3D807D80
E risparmia. Questo serve a specificare quale client deve essere utilizzato dai giocatori. Non vogliamo che siano in grado di utilizzare la loro versione preferita.
Avvio del server
Dopo aver compilato i file del server, utilizzare questi comandi per avviare il server.
Iniziare:
./athena-start start
Fermare:
./athena-start stop
Ricominciare:
./athena-start restart
Se hai riscontrato un errore come questo:
-bash: ./athena-start: /bin/sh^M: bad interpreter
... quindi devi installare dos2unix per convertire lo script.
apt-get install dos2unix
dos2unix athena-start
chmod a+x athena-start
Dopo aver eseguito questi comandi, riavviare il server.
Ora che abbiamo finito con la configurazione del server, devi solo impostare il tuo client Ragnarok in modo che punti al tuo server VPS. Divertiti giocando sul tuo nuovo server!
Riferimenti