-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Maple2 wiki!
- IDE of your choice (Rider, VSCode, Visual Studio)
- .NET 7.0
- EF Core CLI
-
MySQL
- Make note of your
user
andpassword
which will be needed for the connection string.
- Make note of your
- MapleStory2 Client
- If running via CLI, export `ENV` variables, you can add these to your `.bashrc` or equivalent for future use.
- If running via IDE, these can be set in your Run configurations.
export MS2_ROOT="C:/Nexon/Library/maplestory2/"
export DATA_DB_CONNECTION="Server=localhost;Database=maple-data;User=root;Password=maplestory;oldguids=true"
export DATA_DB_CONNECTION="Server=localhost;Database=maple-data;User=root;Password=maplestory;oldguids=true"
export GAME_DB_CONNECTION="Server=localhost;Database=game-server;User=root;Password=maplestory;oldguids=true"
# Only needed if hosting for external access
export GAME_IP=<GAME_SERVER_IP>
export LOGIN_IP=<LOGIN_SERVER_IP>
export DATA_DB_CONNECTION="Server=localhost;Database=maple-data;User=root;Password=maplestory;oldguids=true"
export GAME_DB_CONNECTION="Server=localhost;Database=game-server;User=root;Password=maplestory;oldguids=true"
# Only needed if hosting for external access
export LOGIN_IP=<LOGIN_SERVER_IP>
export DATA_DB_CONNECTION="Server=localhost;Database=maple-data;User=root;Password=maplestory;oldguids=true"
export GAME_DB_CONNECTION="Server=localhost;Database=game-server;User=root;Password=maplestory;oldguids=true"
# Only needed if hosting for external access
export GAME_IP=<GAME_SERVER_IP>
export GAME_CHANNEL=<GAME_CHANNEL>
export GAME_PORT=<GAME_SERVER_PORT>
export GRPC_CHANNEL_PORT=<GAME_GRPC_CHANNEL_PORT>
- Environment variables should be set as documented above.
-
dotnet run --project Maple2.File.Ingest
or equivalent
If a new table is added, you will need to drop the database and run the ingest tool again.
Before running any dotnet ef
commands, you will need to be in the Maple2.Server.World
directory and setup your environment variables:
$env:GAME_DB_CONNECTION="Server=localhost;Database=game-server;User=root;Password=maplestory;oldguids=true"
$env:DATA_DB_CONNECTION="Server=localhost;Database=maple-data;User=root;Password=maplestory;oldguids=true"
Using EF Core CLI (running in powershell):
dotnet ef database update
Run SQL queries in Maple2.Database/sql
When making changes to the schema (Maple2.Database.Model
), you will need to generate a migration to apply the changes to existing tables. This can be done by running:
dotnet ef migrations add $NAME
If you need to regenerate the migration, first remove it:
dotnet ef database update $OLD_VERSION
dotnet ef migrations remove
Note: Ensure that
Maple2.Server.World/Migrations/Ms2ContextModelSnapshot.cs
is also reverted properly. (The tool always seems to mess it up, so you might have to manually revert it through git)
To apply the latest migration, you can again just run:
dotnet ef database update
You can also specify and optional migration name to switch between older versions:
dotnet ef database update $NAME
Servers should be started in the following order:
Maple2.Server.World
Maple2.Server.Game
Maple2.Server.Login
During development, you will generally just restart the Game
server, and occasionally the World
server. Doing so should be a safe operation, and all users will be kicked to the login screen.
You can also run the server using docker compose up
, but that is not useful during development due to the need for constant restarting.