Skip to content
Permalink
Browse files

Updated the YAML parsing method (#3694)

Synchronized the process of loading and parsing YAML databases.
Provides more robust parse warnings/errors.
Added Header checks to validate database versions.
Adjusted root keys to a standard name of Body.
Adjusted inter-server storages, achievements, and attendance to follow the new format.

Fixes #3483

Thanks to @Lemongrass3110!
  • Loading branch information...
aleos89 authored and Lemongrass3110 committed Feb 28, 2019
1 parent 757a459 commit 78eed02273414a4332f9c088ad7e795a2903ea5f
@@ -10,7 +10,11 @@
# Table: "<storage_table>" // (string) Name of table where storage is saved. The table stucture is the same as the default storage table.
# Max: <max_amount> // (int) *optional* Maximum number of items in storage. MAX_STORAGE will be used if no value is defined.
###############################################################################################################################################
#Storages:
Header:
Type: INTER_SERVER_DB
Version: 1

#Body:
# - ID: 1
# Name: "VIP Storage"
# Table: "vip_storage"
@@ -28,7 +28,15 @@
# Table: "<storage_table>" // (string) Name of table where storage is saved. The table stucture is the same as the default storage table.
# Max: <max_amount> // (int) *optional* Maximum number of items in storage. MAX_STORAGE will be used if no value is defined.

Storages:
- ID: 0
Name: "Storage"
Table: "storage"
Header:
Type: INTER_SERVER_DB
Version: 1

Body:
- ID: 0
Name: "Storage"
Table: "storage"

Footer:
Imports:
- Path: conf/import/inter_server.yml
@@ -0,0 +1,90 @@
# This file is a part of rAthena.
# Copyright(C) 2017 rAthena Development Team
# https://rathena.org - https://github.com/rathena
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###########################################################################
# Renewal Achievement Database
###########################################################################
#
# Achievement Settings
#
###########################################################################
# ID - Unique achievement ID.
###########################################################################
# Group - Achievement group type. Each achievement type calls a specific
# objective check.
# Valid groups:
# AG_ADD_FRIEND
# AG_ADVENTURE
# AG_BABY
# AG_BATTLE
# AG_CHATTING
# AG_CHATTING_COUNT
# AG_CHATTING_CREATE
# AG_CHATTING_DYING
# AG_EAT
# AG_GET_ITEM
# AG_GET_ZENY
# AG_GOAL_ACHIEVE
# AG_GOAL_LEVEL
# AG_GOAL_STATUS
# AG_HEAR
# AG_JOB_CHANGE
# AG_MARRY
# AG_PARTY
# AG_ENCHANT_FAIL
# AG_ENCHANT_SUCCESS
# AG_SEE
# AG_SPEND_ZENY
# AG_TAMING
###########################################################################
# Name - Achievement name. Used when sending rewards through RODEX.
###########################################################################
# Target - A list of monster ID and count values that the achievement
# requires. The target count can also be used for achievements that keep
# a counter while not being related to monster kills.
# Capped at MAX_ACHIEVEMENT_OBJECTIVES.
###########################################################################
# Condition - A conditional statement that must be met for the achievement
# to be considered complete.
###########################################################################
# Map - A map name that is used for the AG_CHATTING type which increments
# the counter based on the player's map.
###########################################################################
# Dependent: - A list of achievement IDs that need to be completed before
# this achievement is considered complete.
###########################################################################
# Reward - A list of rewards that are given on completion. All fields are
# optional.
# ItemID: Item ID
# Amount: Amount of Item ID (default 1)
# Script: Bonus Script
# TitleID: Title ID
###########################################################################
# Score - Achievement points that are given on completion.
###########################################################################

Header:
Type: ACHIEVEMENT_DB
Version: 1

Footer:
Imports:
- Path: db/pre-re/achievement_db.yml
Mode: Prerenewal
- Path: db/re/achievement_db.yml
Mode: Renewal
- Path: db/import/achievement_db.yml
@@ -0,0 +1,11 @@
Header:
Type: ATTENDANCE_DB
Version: 1

Footer:
Imports:
- Path: db/pre-re/attendance.yml
Mode: Prerenewal
- Path: db/re/attendance.yml
Mode: Renewal
- Path: db/import/attendance.yml
@@ -77,4 +77,6 @@
# Score - Achievement points that are given on completion.
###########################################################################

Achievements:
Header:
Type: ACHIEVEMENT_DB
Version: 1
@@ -1,3 +1,3 @@
Header:
Type: ATTENDANCE_CONF
Type: ATTENDANCE_DB
Version: 1

0 comments on commit 78eed02

Please sign in to comment.
You can’t perform that action at this time.