InitialStepsWithMarauroa

出自gamedev
於 2020年4月26日 (日) 20:46 由 imported>201706061029 所做的修訂 Create a MySQL database and user
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)
跳至導覽 跳至搜尋



好了,您已經成功編譯了Marauroa,接下來要做什麼呢?

  BUILD SUCCESSFUL
  Total time: 3 seconds

非常好! 基本上,如果你已經建立了一個Marauroa伺服器,它必須是因為你想要自己玩一下伺服器,或者因為你想運行自己的遊戲伺服器,或者因為你是一個想要開發自己遊戲的開發者。

這不是一個跑 Stendhal Server 的教程. 你不需要單獨運行marauroa來跑Stendhal Server, 請移步到 Host a Stendhal Server .

如果以上都不適用,你可能會尋找http://arianne.sourceforge.net來代替。

Configuration[編輯]

Create a MySQL database and user[編輯]

運行sql客戶機(在windows noinstall package的bin/mysql.exe)。 用所需的值替換<user>和<password>,並將以下內容粘貼到打開的提示符中:

    create database marauroa;
    grant all on marauroa.* to <user>@localhost identified by '<password>';

它應該產生類似這樣的輸出:

  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 1 to server version: 4.1.10
  
  Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
  
  mysql> create database marauroa;
  Query OK, 1 row affected (0.03 sec)
  
  mysql> grant all on marauroa.* to stendhal_user@localhost identified by 'stendhal_passwd';
  Query OK, 0 rows affected (0.00 sec)
  
  mysql>

Create server.ini file[編輯]

If you don't have a game yet, see Marauroa Tutorial for how to generate a minimum server.ini and how to write the two required classes.

To create the marauroa.ini file you need to can write it by hand, copy from another place or use your game application to generate it.
Please refer to your game documentation about how to write it.

Stendhal Documentation: VisualGuideToInstallingStendhalStep5

Running[編輯]

Once you have it configured, just run the server by executing:

  java -classpath .;mysql-connector-java-3.0.7-stable-bin.jar;log4j.jar;marauroa.jar marauroa.server.marauroad -c <server.ini>

NOTE: On Unix use : instead of ; to define the classpath.

NOTE: You may change what it is logged by default, so you need to edit the log4j.properties file. For example:

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=INFO, Console, File

# Paste all logger entries with a threshold of WARN to the console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%-4r %-5p %c %x - %m%n

log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=server.log
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

# Disabled debug messages for stendhal...some 10 thousand logs each minute is
# way too much
log4j.logger.marauroa.server.game.RPServerManager=WARN

Make sure that you have the MySQL server running too. Marauroa will build all the needed table structure for itself.

This will start Marauroa.

Now refer to game documentation about how to start the game server and how to create accounts and so on. {{#breadcrumbs: Marauroa | Using | Initial Steps}}