Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update working directory, database default configs and docs. #75

Merged
merged 7 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Release*/
Debug*/
vendor/
assets/
[Bb]uild/
*.exe
*.lib
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

This is the official Knight Online repository containing sources for the game, server and tools.

To get started, open Command Prompt and execute the following commands:
To get started, clone this repo:
```
git clone https://github.com/stevewgr/ko.git
git clone --depth=1 https://github.com/stevewgr/ko-vendor.git ko\src\vendor
```
and then double click to the `config.cmd` script in the root directory to fetch external dependencies.

The project may be built with older Visual Studio versions, however for the sake of consistency, please install Visual Studio 2022.
You will also need to install additional MSVC, MFC and ATL components if you haven't already. The way it's done in Visual Studio 2022, is by:
You will also need to install additional MSVC, MFC and ATL components if you haven't already. The way it's done in Visual Studio 2022 is by:
- Click on `Tool` -> `Get Tools and Features...`
- In the new window switch to `Individual components` tab
- Search for `mfc` and select `C++ MFC for latest v143 build tools (x86 & x64)`
Expand All @@ -18,3 +18,18 @@ You will also need to install additional MSVC, MFC and ATL components if you hav
- Click on `Modify` to start the installation

Note that the entire project has been updated to DirectX-9. There are some runtime dlls that are needed in your system. That being said, if you don't have DirectX-9 already installed in your system and you getting error while trying to open either the game or tools similar to this: `d3dx9d_43.dll is missing`, then you need to install the redistributable runtime dlls. I zipped it from the SDK in case you having troubles: `DX9_Redist.zip` and you can download it from the Releases in GitHub. Unzip and simply run the `SETUP.exe`.

## Setting up the database

The database project is built via SQL scripts. The repository where the database is hosted can be found here: https://github.com/stevewgr/ko-db

In order to setup the database, run the `import.ps1` powershell script by right clicking it and `Run with Powershell`.

Note that if you haven't installed MSSQL with default instance, you may want to adjust the variable `$server_name` in the import script as your instance server name.

The import should run and setup the login and username, as well as permissions for `db_owner`:
- DSN: `kodb`
- UID: `kodb_user`
- PWD: `kodb_user`

Lastly you'll need to setup odbcad settings so that the server can access the database with the odbcad driver.
26 changes: 26 additions & 0 deletions config.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@REM Script for noobs that have hard time reading instructions.
@echo off

echo Configuring started...

where /q git
if ERRORLEVEL 1 (
echo ERROR: Git command line tool is not installed. Please install it: https://git-scm.com/download/win
pause
exit 1
)

rmdir /s /q src\assets 2> NUL
rmdir /s /q src\vendor 2> NUL

git clone --depth=1 https://github.com/stevewgr/ko-assets src\assets
git clone --depth=1 https://github.com/stevewgr/ko-vendor src\vendor

@REM src\All.sln

echo Configuring done.

echo If you already setup the database with odbcad settings and the import.ps1 script from: https://github.com/stevewgr/ko-assets
echo You may want to to start the src\All.sln to start developing.

pause
11 changes: 11 additions & 0 deletions src/game/KnightOnLine.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\assets\game</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\assets\game</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
11 changes: 11 additions & 0 deletions src/server/AIServer/AIServer.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..\assets\server</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..\assets\server</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/server/AIServer/MAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ BOOL MAP::LoadRoomEvent( int zone_number )
int event_num = 0, nation = 0;

CRoomEvent* pEvent = NULL;
filename.Format( ".\\MAP\\%d.evt", zone_number);
filename.Format( ".\\AIServer_MAP\\%d.evt", zone_number);

if( !pFile.Open( filename, CFile::modeRead) ) return FALSE;

Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MagicTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CMagicTableSet::CMagicTableSet(CDatabase* pdb)

CString CMagicTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMagicTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MagicType1Set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CMagicType1Set::CMagicType1Set(CDatabase* pdb)

CString CMagicType1Set::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMagicType1Set::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MagicType2Set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CMagicType2Set::CMagicType2Set(CDatabase* pdb)

CString CMagicType2Set::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMagicType2Set::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MagicType3Set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CMagicType3Set::CMagicType3Set(CDatabase* pdb)

CString CMagicType3Set::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMagicType3Set::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MagicType4Set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CMagicType4Set::CMagicType4Set(CDatabase* pdb)

CString CMagicType4Set::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMagicType4Set::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MakeDefensiveTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CMakeDefensiveTableSet::CMakeDefensiveTableSet(CDatabase* pdb)

CString CMakeDefensiveTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMakeDefensiveTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MakeGradeItemTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CMakeGradeItemTableSet::CMakeGradeItemTableSet(CDatabase* pdb)

CString CMakeGradeItemTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMakeGradeItemTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MakeItemTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CMakeItemTableSet::CMakeItemTableSet(CDatabase* pdb)

CString CMakeItemTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMakeItemTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MakeLareItemTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CMakeLareItemTableSet::CMakeLareItemTableSet(CDatabase* pdb)

CString CMakeLareItemTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMakeLareItemTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MakeWeaponTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CMakeWeaponTableSet::CMakeWeaponTableSet(CDatabase* pdb)

CString CMakeWeaponTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMakeWeaponTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MonPosSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CMonPosSet::CMonPosSet(CDatabase* pdb)

CString CMonPosSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMonPosSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/MonTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ CMonTableSet::CMonTableSet(CDatabase* pdb)

CString CMonTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CMonTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/NpcItemSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CNpcItemSet::CNpcItemSet(CDatabase* pdb)

CString CNpcItemSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CNpcItemSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/NpcPosSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CNpcPosSet::CNpcPosSet(CDatabase* pdb)

CString CNpcPosSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CNpcPosSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/NpcTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ CNpcTableSet::CNpcTableSet(CDatabase* pdb)

CString CNpcTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CNpcTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/RNpcPosSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CRNpcPosSet::CRNpcPosSet(CDatabase* pdb)

CString CRNpcPosSet::GetDefaultConnect()
{
return _T("ODBC;DSN=kn_online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CRNpcPosSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/ServerDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ BOOL CServerDlg::MapFileLoad()
{
sZoneName = ZoneInfoSet.m_strZoneName;

szFullPath.Format(".\\MAP\\%s", sZoneName);
szFullPath.Format(".\\AIServer_MAP\\%s", sZoneName);

if (!file.Open(szFullPath, CFile::modeRead))
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/AIServer/ZoneInfoSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CZoneInfoSet::CZoneInfoSet(CDatabase* pdb)

CString CZoneInfoSet::GetDefaultConnect()
{
return _T("ODBC;DSN=KN_Online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CZoneInfoSet::GetDefaultSQL()
Expand Down
11 changes: 11 additions & 0 deletions src/server/Aujard/Aujard.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..\assets\server</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..\assets\server</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
18 changes: 9 additions & 9 deletions src/server/Aujard/AujardDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ BOOL CAujardDlg::OnInitDialog()
CString inipath;
inipath.Format( "%s\\Aujard.ini", GetProgPath() );

GetPrivateProfileString( "ODBC", "ACCOUNT_DSN", "", m_strAccountDSN, 24, inipath );
GetPrivateProfileString( "ODBC", "ACCOUNT_UID", "", m_strAccountUID, 24, inipath );
GetPrivateProfileString( "ODBC", "ACCOUNT_PWD", "", m_strAccountPWD, 24, inipath );
GetPrivateProfileString( "ODBC", "GAME_DSN", "", m_strGameDSN, 24, inipath );
GetPrivateProfileString( "ODBC", "GAME_UID", "", m_strGameUID, 24, inipath );
GetPrivateProfileString( "ODBC", "GAME_PWD", "", m_strGamePWD, 24, inipath );
GetPrivateProfileString( "ODBC", "LOG_DSN", "", m_strLogDSN, 24, inipath );
GetPrivateProfileString( "ODBC", "LOG_UID", "", m_strLogUID, 24, inipath );
GetPrivateProfileString( "ODBC", "LOG_PWD", "", m_strLogPWD, 24, inipath );
GetPrivateProfileString( "ODBC", "ACCOUNT_DSN", "kodb", m_strAccountDSN, 24, inipath );
GetPrivateProfileString( "ODBC", "ACCOUNT_UID", "kodb_user", m_strAccountUID, 24, inipath );
GetPrivateProfileString( "ODBC", "ACCOUNT_PWD", "kodb_user", m_strAccountPWD, 24, inipath );
GetPrivateProfileString( "ODBC", "GAME_DSN", "kodb", m_strGameDSN, 24, inipath );
GetPrivateProfileString( "ODBC", "GAME_UID", "kodb_user", m_strGameUID, 24, inipath );
GetPrivateProfileString( "ODBC", "GAME_PWD", "kodb_user", m_strGamePWD, 24, inipath );
GetPrivateProfileString( "ODBC", "LOG_DSN", "kodb", m_strLogDSN, 24, inipath );
GetPrivateProfileString( "ODBC", "LOG_UID", "kodb_user", m_strLogUID, 24, inipath );
GetPrivateProfileString( "ODBC", "LOG_PWD", "kodb_user", m_strLogPWD, 24, inipath );

m_nServerNo = GetPrivateProfileInt("ZONE_INFO", "GROUP_INFO", 1, inipath);
m_nZoneNo = GetPrivateProfileInt("ZONE_INFO", "ZONE_INFO", 1, inipath);
Expand Down
2 changes: 1 addition & 1 deletion src/server/Aujard/ItemTableSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ CItemTableSet::CItemTableSet(CDatabase* pdb)

CString CItemTableSet::GetDefaultConnect()
{
return _T("ODBC;DSN=KN_Online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CItemTableSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/Ebenezer/BattleSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CBattleSet::CBattleSet(CDatabase* pdb)

CString CBattleSet::GetDefaultConnect()
{
return _T("ODBC;DSN=KN_Online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CBattleSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/Ebenezer/CharacterDataSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CCharacterDataSet::CCharacterDataSet(CDatabase* pdb)

CString CCharacterDataSet::GetDefaultConnect()
{
return _T("ODBC;DSN=KN_Online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CCharacterDataSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/Ebenezer/CoefficientSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ CCoefficientSet::CCoefficientSet(CDatabase* pdb)

CString CCoefficientSet::GetDefaultConnect()
{
return _T("ODBC;DSN=KN_Online;UID=knight;PWD=knight");
return _T("ODBC;DSN=kodb;UID=kodb_user;PWD=kodb_user");
}

CString CCoefficientSet::GetDefaultSQL()
Expand Down
2 changes: 1 addition & 1 deletion src/server/Ebenezer/EVENT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ BOOL EVENT::LoadEvent(int zone)
EVENT_DATA *newData = NULL;
EVENT_DATA *eventData = NULL;

filename.Format( ".\\MAP\\%d.evt", zone);
filename.Format( ".\\Ebenezer_MAP\\%d.evt", zone);

m_Zone = zone;

Expand Down
11 changes: 11 additions & 0 deletions src/server/Ebenezer/Ebenezer.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..\assets\server</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\..\assets\server</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
Loading