diff --git a/README.md b/README.md
index 36aa9bf..967d81f 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +1,69 @@
# SoD-Off - School of Dragons, Offline
On 7th June, 2023, School of Dragons announced they were "sunsetting" the game, and turning the servers off on the 30th of June.
+At that time, SoD-Off was born. Currently, it is an (almost) complete implementation of the API server for SoD (and some other JS games).
+It allows you to run SoD offline as well as host private online servers.
+
+We provide also MMO server implementation for SoD (https://github.com/SoDOff-Project/sodoff-mmo).
+We recommend using it even in offline mode, as some aspects of the single-player game depend on the MMO connection.
## Discord
[](https://discord.gg/bqHtMRbhM3)
+## Licence
+
+SoD-Off is open source, distributed under [AGPL](LICENSE) license.
+This license does not cover resources obtained from the game or from responses of original api distributed with the API server, especially:
+ `missions.xml`, `items.xml`, `allranks.xml` and `store.xml` files from `src/Resources` directory and files inside `src/assets` directory.
+
+
## Getting started
-For the first time setup, run the following command:
+You need dotnet 6.0 SDK to build api server from sources. To do this (and start server) just run:
```
-dotnet restore
-```
-
-Then run the server as follows:
-
-```
-# run mitmproxy to redirect requests to the app
-mitmproxy -s mitm-redirect.py
-
-# run the server
dotnet run --project src/sodoff.csproj
```
-Then run School of Dragons.
+### Modify client
+
+To play game you need to modify game client to use `http://localhost:5001/.com/DWADragonsUnity/` instead `http://media.jumpstart.com/DWADragonsUnity/` for getting main XML config file (`DWADragonsMain.xml`).
+You can do this editing `DOMain_Data/resources.assets` in hex-editor and replace those URLs.
+
+### Server configuration
+
+Most configuration of server is set in `appsettings.json`. See `"// ..."` keys in this file for options description.
+
+#### supported clients
+
+Each version of supported client need own file `assets/DWADragonsUnity/{PLATFORM}/{VERSION}/DWADragonsMain.xml`.
+By default (can be changed in `appsettings.json`) files for version 2.5.0 and newer will be automatically encrypted (in accordance with the client's expectations).
+
+Sample file for `{PLATFORM} = WIN`, `{VERSION} = 3.31.0` is provided.
+It assumes that the server address is `localhost:5000` (for api) and `localhost:5000` (for assets). When running a public server, the addresses must be adjusted.
+
+#### asset server
+
+Multiple options of asset server can be customized. Most important of them is `ProviderURL` indicating the source of assets downloading in `partial` mode.
+By default it's set to archive.org. Please do not abuse this server (especially do not disable `UseCache` option and do not get rid of `asset-cache` dir content).
+
+#### listening address/port
+
+By default server listening on all IPv4 and IPv6 addresses on ports 5000 (api) and 5001 (assets).
+This can be changed in `appsettings.json`, but it can also requires changes in `DWADragonsMain.xml` and in clients (on change assets server address)
+
+### Server side modding
+
+Server support server side modding like adding new items, adding them to store without modification server source.
+For details see [src/mods/README-MODDING.md](src/mods/README-MODDING.md).
+
## Status
### What works
+
+Almost everything:
+
- register/login
- create profile
- list profiles
@@ -41,6 +77,14 @@ Then run School of Dragons.
- minigames
- MMO (using sodoff-mmo)
+### What doesn't work
+
+- play as Guest
+- friends
+- clans
+- in-game messaging system (Terrible Mail)
+
+
### Methods
#### Fully implemented
diff --git a/src/appsettings.Development.json b/src/appsettings.Development.json
deleted file mode 100644
index 0dd2dd4..0000000
--- a/src/appsettings.Development.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "Kestrel": {
- "EndPoints": {
- "Http": {
- "Url": "http://localhost:5000"
- }
- }
- },
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "Microsoft.AspNetCore": "Warning"
- }
- }
-}
diff --git a/src/appsettings.README.json b/src/appsettings.README.json
new file mode 100644
index 0000000..6d7ccc9
--- /dev/null
+++ b/src/appsettings.README.json
@@ -0,0 +1,37 @@
+{
+ "Kestrel": {
+ "EndPoints": {
+ "Http": {
+ "Url": "listening url for api server - allow set listening ip address and port number -> http://ip.ip.ip.ip:port/ or http://[ip::ip]:port/"
+ }
+ }
+ },
+ "AssetServer": {
+ "Enabled": true,
+ "ListenIP": ,
+ "Port": ",
+ "URLPrefix": "",
+ "Mode":
+ "ProviderURL":
+ "AutoEncryptRegexp":
+ "AutoEncryptKey": ,
+ "SubstituteMissingLocalAssets": ,
+ "UseCache":
+ },
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*"
+}
+
+ "AssetServer": {
+ "Enabled": true,
+ "Port": 881, //Only for the asset server
+ "URLPrefix": "a.com", //
+ "Mode": "partial", //
+ "ProviderURL": "https://media.sodoff.spirtix.com/", //
+ "SubstituteMissingLocalAssets": true //
+ }
diff --git a/src/appsettings.json b/src/appsettings.json
index efdfa0f..4d12606 100644
--- a/src/appsettings.json
+++ b/src/appsettings.json
@@ -2,10 +2,43 @@
"Kestrel": {
"EndPoints": {
"Http": {
- "Url": "http://localhost:5000"
+ "// Url": "listening url for api server - allow set listening ip address and port number -> http://ip.ip.ip.ip:port/ or http://[ip::ip]:port/",
+ "Url": "http://*:5000"
}
}
},
+ "AssetServer": {
+ "// Enabled": "set to false to disable builtin asset server",
+ "Enabled": true,
+
+ "// ListenIP": "listening ip address for asset server, default * -> all IPv4 and IPv6 addresses",
+ "ListenIP": "*",
+
+ "// Port": "listening port number for asset server (should be different than for serer api)",
+ "Port": 5001,
+
+ "// URLPrefix": "extra prefix in url, is omitted while getting path from requested URL ... if set to .com then request to http://localhost/.com/abc will return assets/abc file",
+ "URLPrefix": ".com",
+
+ "// Mode": "two modes: full - everything is local, partial - downloads assets from ProviderURL if not found locally",
+ "Mode": "partial",
+
+ "// ProviderURL": "proxy URL used in partial mode",
+ "ProviderURL": "https://web.archive.org/web/20230713000000id_/https://media.jumpstart.com/",
+
+ "// AutoEncryptRegexp": "regexp matched against URL local part -> if match returned file will be encrypted on fly using 3DES with AutoEncryptKey as key",
+ "AutoEncryptRegexp": "/(2\\.[5-9]|2\\.[1-9][0-9]|3\\.[0-9]+)\\.[0-9]/DWADragonsMain.xml$",
+
+ "// AutoEncryptKey": "3DES key for encrypted files",
+ "AutoEncryptKey": "C92EC1AA-54CD-4D0C-A8D5-403FCCF1C0BD",
+
+ "// SubstituteMissingLocalAssets": "when true if the game requests a High asset and you only have Low, it will return Low instead of downloading (partial mode) or error 404 (full mode)",
+ "SubstituteMissingLocalAssets": true,
+
+ "// UseCache": "when true store downloading in partial mode assets in assets-cache for use on next requests" ,
+ "UseCache": true
+ },
+
"Logging": {
"LogLevel": {
"Default": "Information",
diff --git a/src/assets/DWADragonsUnity/WIN/3.31.0/DWADragonsMain.xml b/src/assets/DWADragonsUnity/WIN/3.31.0/DWADragonsMain.xml
new file mode 100644
index 0000000..e99e6e3
--- /dev/null
+++ b/src/assets/DWADragonsUnity/WIN/3.31.0/DWADragonsMain.xml
@@ -0,0 +1,222 @@
+
+
+
+
+ http://localhost:5000/ContentWebService.asmx/
+ http://localhost:5000/V2/ContentWebService.asmx/
+ http://localhost:5000/v3/ContentWebService.asmx/
+ http://localhost:5000/V4/ContentWebService.asmx/
+ http://localhost:5000/ContentWebService.asmx/
+
+ http://localhost:5000/ItemStoreWebService.asmx/
+ http://localhost:5000/AchievementWebService.asmx/
+ http://localhost:5000/V2/AchievementWebService.asmx/
+
+ http://localhost:5000/MembershipWebService.asmx/
+ http://localhost:5000/AuthenticationWebService.asmx/
+ http://localhost:5000/v3/AuthenticationWebService.asmx/
+ http://localhost:5000/v3/RegistrationWebService.asmx/
+ http://localhost:5000/V4/RegistrationWebService.asmx/
+ http://localhost:5000/ProfileWebService.asmx/
+
+ http://localhost:5000/ConfigurationWebService.asmx/
+ http://localhost:5000/V2/Ratingwebservice.asmx/
+ http://localhost:5000/ChallengeWebService.asmx/
+ http://localhost:5000/MessagingWebService.asmx/
+
+
+ http://localhost:5000/GroupWebService.asmx/
+ http://localhost:5000/V2/GroupWebService.asmx/
+ http://localhost:5000/MessageWebService.asmx/
+ http://localhost:5000/v2/MessageWebService.asmx/
+ http://localhost:5000/v3/MessageWebService.asmx/
+ http://localhost:5000/v2/InviteFriendWebService.asmx/
+ http://localhost:5000/ChatWebService.asmx/
+
+
+ http://localhost/AnalyticsWebService.asmx/
+ http://localhost/MissionWebService.asmx/
+ http://localhost/AvatarWebService.asmx/
+ http://localhost/RatingWebService.asmx/
+ http://localhost/ScoreWebService.asmx/
+ http://localhost/MobileStoreWebService.asmx/
+ http://localhost/SubscriptionWebService.asmx/
+ http://localhost/PaymentWebService.asmx/
+ http://localhost/V2/PaymentWebService.asmx/
+ http://localhost/PrizeCodeWebService.asmx/
+ http://localhost/Common/V2/PrizeCodeWebService.asmx/
+ http://localhost/ContentServer/CalendarWebService.asmx/
+ http://localhost/RegistrationWebService.asmx/
+ http://localhost/LocaleService.asmx/
+ http://localhost/V2/LocaleWebService.asmx/
+ http://localhost/launch.aspx
+
+
+
+ localhost
+ 9933
+
+ S2X
+ 240
+ false
+ 8080
+ false
+ 500
+ 500
+ 300000
+
+
+
+ http://localhost:5003/.com/DWADragonsUnity/WIN/{Version}/Mid/
+ http://localhost:5003/.com/DWADragonsUnity/WIN/{Version}/Mid/contentdata
+ http://localhost:5003/.com/DWADragonsUnity/WIN/{Version}/Mid/data
+ http://localhost:5003/.com/DWADragonsUnity/WIN/{Version}/Mid/scene
+ http://localhost:5003/.com/DWADragonsUnity/WIN/{Version}/Mid/shareddata
+ http://localhost:5003/.com/DWADragonsUnity/WIN/{Version}/Mid/sound
+ http://localhost:5003/.com/DWADragonsUnity/WIN/{Version}/Mid/movies
+
+ .
+ ./contentdata
+ ./data
+ ./scene
+ ./shareddata
+ ./sound
+ ./movies
+
+ .
+
+
+ 127.0.0.1
+
+ 6c955c0b5efd67396e950f56542e86b6
+ 2000000000
+ dwavatar
+ false
+
+
+ Your Viking is now idle. Click on the OK button to reconnect.
+ 42286
+
+
+ You have been logged out because you have signed in from another computer or device.
+ 9000
+
+
+ Your Viking is now idle. Click on the OK button to reconnect.
+ 9001
+
+
+ Notification
+ 10674
+
+
+ Download failed, please retry! Possible invalid DES secret in client!
+ 42287
+
+
+
+
+
+
+ Mid
+ Low,Mid,High
+
+
+ High
+ Off,Low,Mid,High
+
+
+ Low
+ Off,Low,Mid,High
+
+
+ 128
+
+
+
+ en-US
+
+
+ es-MX
+ es
+ es-ES
+ es-LA
+ es-US
+ es_ES
+ es_LA
+ es_MX
+ es_US
+ spanish
+
+
+ pt-BR
+ pt
+ pt-PT
+ pt_BR
+ pt_PT
+ brazilian
+
+
+ zh-CN
+ zh
+ zh-Hans
+ zh_CN
+ zh_Hans
+ schinese
+
+
+ de-DE
+ de
+ de-CH
+ de_DE
+ de_CH
+ german
+
+
+ fr-CA
+ fr
+ fr-FR
+ fr-CH
+ fr_CA
+ fr_FR
+ fr_CH
+ french
+
+
+ ko-KR
+ ko
+ ko_KR
+ koreana
+
+
+ ru-RU
+ ru
+ ru_RU
+ russian
+
+
+ th-TH
+ th
+ th-TH
+ th_TH
+
+
+ ar-EG
+ ar
+ ar-DZ
+ ar-BH
+ ar-IQ
+ ar-JO
+ ar-KW
+ ar-LB
+ ar-LY
+ ar-MA
+ ar-OM
+ ar-QA
+ ar-SA
+ ar-SY
+ ar-TN
+ ar-AE
+ ar-YE
+
+
diff --git a/src/assets/ServerDown.xml b/src/assets/ServerDown.xml
new file mode 100644
index 0000000..9f84281
--- /dev/null
+++ b/src/assets/ServerDown.xml
@@ -0,0 +1,408 @@
+
+
+ false
+ true
+
+ 11
+ en-US
+ Update
+ For Unplanned Maintenance <-->
+
+ -->
+ For Planned Maintenance <-->
+
+
+
+
+ 9
+ en-US
+ Update
+ For Unplanned Maintenance <-->
+
+ -->
+ For Planned Maintenance <-->
+
+
+
+
+ 1
+ en-US
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 17
+ en-US
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 15
+ en-US
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 14
+ en-US
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 12
+ en-US
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 9
+ es-MX
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 9
+ pt-BR
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 9
+ zh-CN
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 9
+ fr-CA
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 9
+ de-DE
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 9
+ ko-KR
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 9
+ ru-RU
+ Update
+ For Unplanned Maintenance <-->
+
+ <-->
+ For Planned Maintenance <-->
+
+
+
+
+ 10
+ en-US
+ For Unplanned Maintenance <-->
+ Alert! We’ve encountered an unexpected weather delay! Our servers have been covered to protect them. Check back soon.<-->
+ For Planned Maintenance <-->
+ Update
+ The SoDOff server is down because the emulator is being updated. Check back in a few minutes.
+
+
+
+ 07/30/2023 11:59 PM
+ 12/31/2035 12:00 AM
+ 05/30/2023 10:48 AM
+
+ 12
+ en-US
+ NOTICE
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+ 9
+ en-US
+ NOTICE
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+
+ 9
+ de-DE
+ NOTIZ
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+
+ 9
+ es-MX
+ Apagado de Servidores
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+
+ 9
+ fr-CA
+ Arrêt des serveurs
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+
+ 9
+ ko-KR
+ 서버 셧다운
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+
+ 9
+ pt-BR
+ Desligamento dos servidores
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+ 9
+ ru-RU
+ Выключение серверов
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+ 9
+ th-TH
+ การปิดเซิร์ฟเวอร์
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+
+ 9
+ zh-CN
+ 服务器关闭
+ Welcome back dragon rider!
+
+Welcome to SoDOff Experimental Server!
+SoDOff is a School of Dragons server emulator. The emulator is in very early stages of development, many features are currently missing. Things can and WILL break!
+
+Please note that we are not associated with JumpStart or DreamWorks.
+
+- The SoDOff Team
+
+ 300
+ -1
+
+
diff --git a/src/mods/README-MODDING.md b/src/mods/README-MODDING.md
new file mode 100644
index 0000000..e5c7f60
--- /dev/null
+++ b/src/mods/README-MODDING.md
@@ -0,0 +1,92 @@
+# Server side modding
+
+## Mod installations
+
+Place mods as directory inside `src/mods`.
+The mod directory must contain `manifest.xml` file in the first directory tree level.
+For example: `src/mods/MyFirstMod/manifest.xml`
+
+## `manifest.xml` syntax
+
+Root node for `manifest.xml` is ``. It can contain child nodes:
+
+* `` - item database manipulation
+* `` - store database manipulation (not implemented yet)
+* ...
+
+### item database manipulation
+
+`` may contain may `- ` child nodes. Each of them define one item modification. Modification type can be specified by `action` attribute, supported values:
+
+* `add` - add new item
+ * default when no `action` attribute
+* `remove` - remove item
+* `replace` - replace item definition for existed item id
+
+`
- ` node may contains subnodes:
+
+* `` - specify item id
+ * if not used item id will be read from item definition in ``
+* `` - specify store id to add item to them
+ * can occur multiple times
+ * if not used item will be not added to any store
+* `` - item definition (syntax like `` node in [src/Resources/items.xml](../Resources/items.xml))
+ * can be committed in `remove` action`
+
+#### Example
+
+* remove Toothless ticket item (item id `8034`)
+* add Night Furry Egg item (item id `29999`) and add it to store (store id `92`, for store description see comment in [src/Resources/store.xml](../Resources/store.xml).
+* item id (for new items) should be unique to avoid mod collision, recommended format to use: `prefix * 10000 + private_id`, where:
+ * `prefix` must be grater than 2 to avoid collision with original game and official SoDOff items
+ * `prefix` is unique mod author prefix (see SoDOff discord for details)
+ * `private_id` is for digit number (0-9999) to free use by the this author
+ * for example for `prefix = 789` and `private_id = 13` item id will be `7890013`
+
+```
+
+
+
-
+ 8034
+
+ -
+ 92
+
+ RS_DATA/DragonEgg.unity3d/PfEggDevilishDervish
+
+ PetTypeID
+ 17
+ 29999
+
+
+ 456
+ Dragons Dragon Egg
+
+ 29999
+
+
+ 550
+ Strike Class Eggs
+
+ 29999
+
+ 0
+ 250
+ 0
+ Tame the cunning and mischievous Night Furry in your stables
+ RS_DATA/DragonEgg.unity3d/IcoEggDevilishDervish
+ -1
+ 29999
+ Night Furry Egg
+ false
+
false
+ false
+ 10
+ -1
+ 0
+ 0
+
+
+
+
+```