# Server

# Debug Console

### Server Side Changes
Simply edit `kdxy/gamed/ptemplate.conf` and change `debug_command_mode` to either true or false. `1` is true and `0` is false.
```ini
[GENERAL]
debug_command_mode = 1
logic_level_limit = 120
no_output = 1
;allow_login_class_mask = 67108863
allow_login_class_mask = 67108863
#exp_bonus = 0
#sp_bonus = 0
#money_bonus = 0
```
### Client Changes
Launch elementclient.exe using the launch argument `console:1`. The easiest way to do this will be making a shortcut, right click -> properties, and editing the `target` box to have `console:1` outside of the quotation marks.

##### Example
`"C:\path\to\your\game\element\elementclient.exe" console:1`

# GDeliveryServer

# Extended Player Names

To allow character names longer than 8 letters simply add this line to gdeliveryd/gamesys.conf in \[GDeliveryServer\] section:   
  
Code: <span style="background-color: rgb(230, 126, 35); color: rgb(0, 0, 0);">max\_name\_len=24</span>  
*24 means 12 characters allowed.*

# Gamed

# GS.conf

Adding new maps and dungeons requires editing in this section.   
  
This is the world information for Gaap as an example:  
  
\#--------------------------------------------------------------------------------------  
\[World\_gs01\]  
<span style="background-color: rgb(241, 196, 15); color: rgb(0, 0, 0);">index = 1</span>  
<span style="background-color: rgb(241, 196, 15); color: rgb(0, 0, 0);">tag = 1</span>  
cid = 0,2,13  
<span style="background-color: rgb(241, 196, 15); color: rgb(0, 0, 0);">base\_path = x1/</span>  
max\_sight\_range = 50  
max\_flight\_height = 330  
grid = {125,125,20.5,-1280.5,-1280.5}  
local\_region = {-1024,-1024.0} , {1024.0,1024.0}  
limit = allow-root;  
player\_capacity = 4096

\[Terrain\_gs01\]  
szMapPath = map  
nAreaWidth = 512  
nAreaHeight = 512  
nNumAreas = 4  
nNumCols = 2  
nNumRows = 2  
vGridSize = 2.0f  
vHeightMin = 0.0f  
vHeightMax = 800.0f  
\#--------------------------------------------------------------------------------------  
  
Index, Tag and Base\_Path are the key identicators to link it to Gaap files.   
Base\_path = x1 directory folder in configs.

# Ptemplate.conf

```ini
[GENERAL]
; Enables or disables debug commands for all users.
; 1 = enable/true
; 2 = disabled/false
debug_command_mode = 1

; level cap
logic_level_limit = 120

; unknown
no_output = 1

; bit mask to restrict class logins
;allow_login_class_mask = 67108863  
allow_login_class_mask = 67108863  

; unknown
#exp_bonus = 0  
#sp_bonus = 0  
#money_bonus = 0  
```

# Npcgen - Triggers

**Changes that need to be made in NPCgen to activate these long lost bosses: Switch from AutoStart Delay to AutoStop delay in the NPCGen trigger list**

**Old Bosses:**

- Lady Whiteskull in Skeletal Den - 5209 and trigger 202
- Aughorn Champion and Aughorn Legend in Metallon Cavern - 10599/10598 and trigger 275
- Inari Minister in Serpentail Valley - 10600 and trigger 276
- Redchuckle Speartot in Infernal Grotto - 11394 and trigger 506
- Fugubokuh Minister in Inspiration Temple - 11395 and trigger 507
- Dracofin First Class in Palace of River God - 11393 and trigger 505
- Big Green Bull in Aughorn Cave - 13662 and trigger 508
- Nether Lutist in Harmony Hallow - 13661 and trigger 509
- Leaffan Roxaress in Leaf Fan Cavern - 19550 and trigger 676

**Modern Bosses:**

- Red-Horn Ape - 1333
- Risen Phoenix - 1386
- Shing the Demon Lord - 1450

**Classic Pokari Events**

- Astral Spirit - 551 (open)
- Pokari Feast! Drinks - 554 (open)
- City Filled With Love - 552 (open)
- Harvest Season - 550 (open)
- Purify the Water - 553 (open)

# Update Server Research

Research on Ether Saga update server implementations.

# Preliminary Notes

they will have version endpoint that returns a version file that just says the current version like `1002` for example and then it has `.inc` files per version that seem to tell you what files need to exist or not for a particular version.

note every single one of these is text files other than the patch contents itself.

So like `v-100.inc` will have a header that says:
```
# 902 1002 27033968
```
and a list of files and I havent discerned what this means but my guess is this set will let you update from 902 to 1002 and then it just has a bunch of lines that are like:
```
!78fb0446c5fee2c7116d2a238a180e8e /Y29uZmlncw==/YnVmZl9pY29uLnR4dA==
!4c8dff71d38b7ee408c41f8af06592c2 YnVmZl9zdHIudHh0
!28399910eac8b6c5f9d2c274c66ccec0 ZWxlbWVudF9jbGllbnQuY2Zn
!1a94e997ccf9ea21a25fb54d1f7bdd48 aW5zdGFuY2UudHh0
```
where theres an md5 of the file and a prefix that can be `!,+,-` and my best guess is that its a diff type thing where its like overwrite, add, remove? and then the end is a path with parts encoded as b64 to the file on the server *and* the path it belongs in the game. 

so the first line in my example is `configs/buff_icon.txt` so you would download it at `updateuri.com/update/${element || patcher || launcher}/Y29uZmlncw==/YnVmZl9pY29uLnR4dA==` and then patcher saves it as and compress it into the `configs.pck` at `configs/buff_icon.txt`

the files are zlib compressed.