Skip to content

Commit 78eed02

Browse files
aleos89Lemongrass3110
authored andcommitted
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!
1 parent 757a459 commit 78eed02

32 files changed

+2109
-941
lines changed

conf/import-tmpl/inter_server.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
# Table: "<storage_table>" // (string) Name of table where storage is saved. The table stucture is the same as the default storage table.
1111
# Max: <max_amount> // (int) *optional* Maximum number of items in storage. MAX_STORAGE will be used if no value is defined.
1212
###############################################################################################################################################
13-
#Storages:
13+
Header:
14+
Type: INTER_SERVER_DB
15+
Version: 1
16+
17+
#Body:
1418
# - ID: 1
1519
# Name: "VIP Storage"
1620
# Table: "vip_storage"

conf/inter_server.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@
2828
# Table: "<storage_table>" // (string) Name of table where storage is saved. The table stucture is the same as the default storage table.
2929
# Max: <max_amount> // (int) *optional* Maximum number of items in storage. MAX_STORAGE will be used if no value is defined.
3030

31-
Storages:
32-
- ID: 0
33-
Name: "Storage"
34-
Table: "storage"
31+
Header:
32+
Type: INTER_SERVER_DB
33+
Version: 1
34+
35+
Body:
36+
- ID: 0
37+
Name: "Storage"
38+
Table: "storage"
39+
40+
Footer:
41+
Imports:
42+
- Path: conf/import/inter_server.yml

db/achievement_db.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# This file is a part of rAthena.
2+
# Copyright(C) 2017 rAthena Development Team
3+
# https://rathena.org - https://github.com/rathena
4+
#
5+
# This program is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
#
18+
###########################################################################
19+
# Renewal Achievement Database
20+
###########################################################################
21+
#
22+
# Achievement Settings
23+
#
24+
###########################################################################
25+
# ID - Unique achievement ID.
26+
###########################################################################
27+
# Group - Achievement group type. Each achievement type calls a specific
28+
# objective check.
29+
# Valid groups:
30+
# AG_ADD_FRIEND
31+
# AG_ADVENTURE
32+
# AG_BABY
33+
# AG_BATTLE
34+
# AG_CHATTING
35+
# AG_CHATTING_COUNT
36+
# AG_CHATTING_CREATE
37+
# AG_CHATTING_DYING
38+
# AG_EAT
39+
# AG_GET_ITEM
40+
# AG_GET_ZENY
41+
# AG_GOAL_ACHIEVE
42+
# AG_GOAL_LEVEL
43+
# AG_GOAL_STATUS
44+
# AG_HEAR
45+
# AG_JOB_CHANGE
46+
# AG_MARRY
47+
# AG_PARTY
48+
# AG_ENCHANT_FAIL
49+
# AG_ENCHANT_SUCCESS
50+
# AG_SEE
51+
# AG_SPEND_ZENY
52+
# AG_TAMING
53+
###########################################################################
54+
# Name - Achievement name. Used when sending rewards through RODEX.
55+
###########################################################################
56+
# Target - A list of monster ID and count values that the achievement
57+
# requires. The target count can also be used for achievements that keep
58+
# a counter while not being related to monster kills.
59+
# Capped at MAX_ACHIEVEMENT_OBJECTIVES.
60+
###########################################################################
61+
# Condition - A conditional statement that must be met for the achievement
62+
# to be considered complete.
63+
###########################################################################
64+
# Map - A map name that is used for the AG_CHATTING type which increments
65+
# the counter based on the player's map.
66+
###########################################################################
67+
# Dependent: - A list of achievement IDs that need to be completed before
68+
# this achievement is considered complete.
69+
###########################################################################
70+
# Reward - A list of rewards that are given on completion. All fields are
71+
# optional.
72+
# ItemID: Item ID
73+
# Amount: Amount of Item ID (default 1)
74+
# Script: Bonus Script
75+
# TitleID: Title ID
76+
###########################################################################
77+
# Score - Achievement points that are given on completion.
78+
###########################################################################
79+
80+
Header:
81+
Type: ACHIEVEMENT_DB
82+
Version: 1
83+
84+
Footer:
85+
Imports:
86+
- Path: db/pre-re/achievement_db.yml
87+
Mode: Prerenewal
88+
- Path: db/re/achievement_db.yml
89+
Mode: Renewal
90+
- Path: db/import/achievement_db.yml

db/attendance.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Header:
2+
Type: ATTENDANCE_DB
3+
Version: 1
4+
5+
Footer:
6+
Imports:
7+
- Path: db/pre-re/attendance.yml
8+
Mode: Prerenewal
9+
- Path: db/re/attendance.yml
10+
Mode: Renewal
11+
- Path: db/import/attendance.yml

db/import-tmpl/achievement_db.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,6 @@
7777
# Score - Achievement points that are given on completion.
7878
###########################################################################
7979

80-
Achievements:
80+
Header:
81+
Type: ACHIEVEMENT_DB
82+
Version: 1

db/import-tmpl/attendance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Header:
2-
Type: ATTENDANCE_CONF
2+
Type: ATTENDANCE_DB
33
Version: 1

0 commit comments

Comments
 (0)