diff --git a/README.md b/README.md
index 36aa9bf..3608912 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +1,64 @@
-# SoD-Off - School of Dragons, Offline
+# SoDOff - 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.
+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, SoDOff was born. Currently, it is an almost complete implementation of the School of Dragons API server (and some other JS games).
+It allows you to run SoD offline as well as host private online servers.
-## Discord
-[](https://discord.gg/bqHtMRbhM3)
+We also provide MMO server implementation for SoD (https://github.com/SoDOff-Project/sodoff-mmo).
+It is recommended to use the MMO server even when offline, as some aspects of the single player game depend on MMO.
+
+## License
+
+SoDOff is open source, distributed under the [AGPL](LICENSE) license.
+This license does not cover resources obtained from the game or from responses of the original API distributed with the API server, especially:
+ `missions.xml`, `items.xml`, `allranks.xml` and `store.xml` files from the `src/Resources` directory and files inside the `src/assets` directory.
## Getting started
-For the first time setup, run the following command:
+To build the API server from sources, you'll need the dotnet 6.0 SDK. Simply run the following command to build and start the server:
```
-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.
+### Modifying the Client
+
+To play the game you need to modify the game client to use `http://localhost:5001/.com/DWADragonsUnity/` instead of `http://media.jumpstart.com/DWADragonsUnity/`.
+You can do this by editing `DOMain_Data/resources.assets` in a hex-editor and swapping the URLs.
+
+### Server Configuration
+
+Most of the server configuration is stored in `appsettings.json`. Check out the "// ..." keys in there for descriptions of different options.
+
+#### Supported Clients
+
+For each supported client version, there must be a corresponding file located at `assets/DWADragonsUnity/{PLATFORM}/{VERSION}/DWADragonsMain.xml`.
+By default (modifiable in appsettings.json), files for version 2.5.0 and newer will be automatically encrypted to meet the client's requirements.
+
+A sample file is provided for `{PLATFORM} = WIN`, `{VERSION} = 3.31.0`.
+It assumes that the server address are `localhost:5000` (API) and `localhost:5001` (assets).
+
+#### Asset Server
+
+Various settings for the asset server are customizable, with the key one being `ProviderURL`, which specifies the source for downloading assets in `partial` mode. By default, it's configured to use archive.org
+Please do not abuse the archive.org server, do not disable the `UseCache` option and do not delete the contents of the `asset-cache` directory.
+
+#### Listening address/port
+
+By default, the server listens on all IPv4 and IPv6 addresses on ports 5000 (API) and 5001 (assets).
+You can tweak this in `appsettings.json`, but it might also mean adjusting `DWADragonsMain.xml` and updating clients to reflect the changes in the asset server address.
+
+### Server Side Modding
+
+The server supports server side modifications, which includes adding new items and putting them in the store without having to modify the server source code.
+For more information, check out [src/mods/README-MODDING.md](src/mods/README-MODDING.md).
## Status
### What works
+
+Almost everything:
+
- register/login
- create profile
- list profiles
@@ -41,6 +72,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..2f7d53b
--- /dev/null
+++ b/src/appsettings.README.json
@@ -0,0 +1,37 @@
+{
+ "Kestrel": {
+ "EndPoints": {
+ "Http": {
+ "Url": "Listening URL for the API server - allows setting the 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..ab4b67c 100644
--- a/src/appsettings.json
+++ b/src/appsettings.json
@@ -2,10 +2,43 @@
"Kestrel": {
"EndPoints": {
"Http": {
- "Url": "http://localhost:5000"
+ "// Url": "Listening URL for the API server - allows setting the 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 the built-in asset server",
+ "Enabled": true,
+
+ "// ListenIP": "Listening IP address for the asset server, default is '*' which represents all IPv4 and IPv6 addresses",
+ "ListenIP": "*",
+
+ "// Port": "Listening port number for the asset server. Should be different than for the server API",
+ "Port": 5001,
+
+ "// URLPrefix": "Extra prefix in the URL; omitted while retrieving the path from the requested URL. For example, if set to '.com', then a request to http://localhost/.com/abc will return the 'abc' file from the assets folder",
+ "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": "Regular expression matched against the URL local part. If there's a match, the returned file will be encrypted on-the-fly using 3DES with AutoEncryptKey as the 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 only Low is available, it will return Low instead of downloading (partial mode) or error 404 (full mode)",
+ "SubstituteMissingLocalAssets": true,
+
+ "// UseCache": "When true, downloading assets in partial mode will be stored in assets-cache for use in subsequent 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..fa60723
--- /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:5001/.com/DWADragonsUnity/WIN/{Version}/Mid/
+ http://localhost:5001/.com/DWADragonsUnity/WIN/{Version}/Mid/contentdata
+ http://localhost:5001/.com/DWADragonsUnity/WIN/{Version}/Mid/data
+ http://localhost:5001/.com/DWADragonsUnity/WIN/{Version}/Mid/scene
+ http://localhost:5001/.com/DWADragonsUnity/WIN/{Version}/Mid/shareddata
+ http://localhost:5001/.com/DWADragonsUnity/WIN/{Version}/Mid/sound
+ http://localhost:5001/.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..c8ecd95
--- /dev/null
+++ b/src/mods/README-MODDING.md
@@ -0,0 +1,92 @@
+# Server Side Modding
+
+## Mod Installation
+
+Place mods as individual directories inside `src/mods`.
+Each mod folder must contain a `manifest.xml` file at its top directory level.
+For example: `src/mods/MyFirstMod/manifest.xml`
+
+## `manifest.xml` syntax
+
+The root node in `manifest.xml` is ``. It can include the following child nodes:
+
+* `` - item database manipulation
+* `` - store database manipulation (not implemented yet)
+* ...
+
+### Item Database Manipulation
+
+`` may contain `- ` child nodes. Each of them defines one item modification. The modification type can be specified by the `action` attribute. The supported values are:
+
+* `add` - add new item
+ * default if the `action` attribute is not present
+* `remove` - remove item
+* `replace` - replace item definition for an existed item ID
+
+`
- ` may contain the following subnodes:
+
+* `` - item ID
+ * if not used, the item ID will be retrieved from the item definition within ``
+* `` - specifies the store ID to which the item will be added
+ * can be used multiple times
+ * if not used, the item will not be added to any store
+* `` - item definition (syntax like the `` node in [src/Resources/items.xml](../Resources/items.xml))
+ * can be omitted in the `remove` action
+
+#### Example
+
+* remove the Toothless ticket item (item ID `8034`)
+* add a Night Furry Egg item (item ID `99999`) and add it to store (store ID `92`, for store description see comment in [src/Resources/store.xml](../Resources/store.xml))
+* The item ID for new items should be unique to prevent mod collisions. The recommended format is: `prefix * 100000 + private_id`, where:
+ * `prefix` must be grater than 0 to avoid collision with the original game and official SoDOff items
+ * `prefix` is a unique mod author prefix
+ * `private_id` ranges from 0 to 99999 and is available for unrestricted use by the author
+ * for instance, if `prefix = 789` and `private_id = 123`, the item ID would be `78900123`
+
+```
+
+
+
-
+ 8034
+
+ -
+ 92
+
+ RS_DATA/DragonEgg.unity3d/PfEggDevilishDervish
+
+ PetTypeID
+ 17
+ 99999
+
+
+ 456
+ Dragons Dragon Egg
+
+ 99999
+
+
+ 550
+ Strike Class Eggs
+
+ 99999
+
+ 0
+ 250
+ 0
+ Tame the cunning and mischievous Night Furry in your stables
+ RS_DATA/DragonEgg.unity3d/IcoEggDevilishDervish
+ -1
+ 99999
+ Night Furry Egg
+ false
+
false
+ false
+ 10
+ -1
+ 0
+ 0
+
+
+
+
+```