-
Notifications
You must be signed in to change notification settings - Fork 4
Database
These instructions need to be followed in order to setup the database correctly.
Pre-requirements: You'll need to install SSMS
You will also need to setup the SQL Server during install. Make sure you leave the default settings, or you'll have to change your connection strings within the source code. This will need to be installed on your development PC, as well as your production server.
- Create databases named (Zolian, ZolianAbilities, ZolianBoardsMail, ZolianMaps, ZolianMonsters, ZolianMundanes, ZolianPlayers, ZolianWorldMaps)
- You can do this by logging into SSMS, and right clicking "Database" then "New Database", ensure you follow the naming convention above as the code points to them specifically.
- Navigate to https://github.com/FallenDev/Zolian/tree/master/Server.Configurations/ZolianDB and run each of these scripts in a new query
These scripts were written to make it easy for new developers to get started, they come with all of the data already populated
- ZolianPlayers will need to be populated; Run: https://github.com/FallenDev/Zolian/blob/master/Server.Configurations/ZolianPlayers/PlayersDatabaseBuild.sql
This scripts contains Stored Procedures which not only keep code clean in our repo, but it also adds security as enforcing types and prevents sql injection
- Passwords need to be encrypted at rest, and the column will need to be encrypted with a local key.
- Open "ZolianPlayers", Open Tables, Right click "dbo.Players", Click Encrypt Columns.
- Click Column Selection, Click next to dbo.Players, Click Password.
- Under Encryption Type, Select "Deterministic", Click Next, leave "Master Key Configuration" as-is, Select "Proceed to finish now", Click Next.
- Click Finished, and wait until the column is encrypted. Click Close.
- If the above was done successfully, you will now be able to create a character, and login. Encryption is handled within the SQL Server, you will not need to deal with any encrypting and decrypting through the server itself.
Also, if you don't wish to encrypt passwords-at-rest, you can do that as well. Just make sure you enable it in your production environment to protect your users.
If you receive the error in your logs "The parameter "@Pass" does not have the same encryption information" upon login. It may be one of your stored procedures were created using a different encryption. Or you tried setting this up before and failed, and it has some information stored somewhere that's now stale. To alleviate this, you'll need to update each of the stored procedures that hit the password column.
- Open a new Query window and run the command:
USE [ZolianPlayers]
GO
EXEC sp_refresh_parameter_encryption [StoredProcedureName];
GO
PlayerCreation
PasswordSave
PlayerSecurity
- This will update the stored procedure to use the new Encryption key created. For further explanation, see: https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-refresh-parameter-encryption-transact-sql?view=sql-server-ver16
Server data is a folder that hosts your server's boards, maps, and quests. This is metadata that is sent to clients that connect to your server. A zip folder containing such data can be found here: https://github.com/FallenDev/Zolian/releases/ When you unzip this folder, you'll need to later update the location in ServerConfig.json. Take note of this!
This section is for anyone who wishes to learn and perhaps play with their own customization. This will walk you through the tech stacks and help you through those setups.