retep998 / Vana

Git mirror of the svn repo for Vana, a MapleStory private server written in C++.
GNU General Public License v2.0
75 stars 34 forks source link

Is this v75 source fully functional? #31

Open Z41N opened 3 years ago

Z41N commented 3 years ago

Downloaded. Obtained proper C++ libraries. Updated project settings. Tried compiling, and says "assert identifier not found".

Also, kept saying certain header files could not be opened, despite them being in the additional libraries. Had to add the path for a bunch of them.

diamondo25 commented 3 years ago

You know that we haven't touched this in 4 years, right? Anyway, this was built with Lazurbeemz Library Pack for that particular version. Maybe you can supply some info about what you updated and such, because C++ tend to be really picky on its libraries and such.

Z41N commented 3 years ago

You know that we haven't touched this in 4 years, right? Anyway, this was built with Lazurbeemz Library Pack for that particular version. Maybe you can supply some info about what you updated and such, because C++ tend to be really picky on its libraries and such.

Hey!! Wow I wasn't expecting a reply lol yea definitely aware, but recently got into C++ development and figured this would be a great project to have under my belt.

I wasn't aware that Lazurbeemz was the library pack dammit!! I was using Asio/Botan/Lua libraries. Question for you, and this is of course coming from a noob mindset, do all of the libraries need to be built first before I can do anything with them, or are they ready to use when I download them and set the correct paths in VS' additional libraries path?

Also, I found that the chat_handler seems to be how to change commands, but wanted to get a better idea of how this works. It looks like you guys use packets to do this, by first creating the packet instance, then sending the packet. Do you have any documentation that could help?

My goal is to read your source and become more familiar with it, but first want to ensure I get the game up and running. I tried Xanadu (v83 C++) and it kind of sucked - lots of issues.

Thanks again for replying so quick

diamondo25 commented 3 years ago

The Lazurbeemz Library Pack should work without modifications or building, as far as I know, because for C++ its just header files and libs, and that should get you the executable.

About chat_handler, this is the part that does most magic: https://github.com/retep998/Vana/blob/19116c07dd0082b6c570bfd6d2ea604947773c10/src/channel_server/chat_handler.cpp#L65-L66

It searches for the command in the registered commands, and if its not the end of the map, it is found (this is how C++ maps, lists are iterated).

https://github.com/retep998/Vana/blob/19116c07dd0082b6c570bfd6d2ea604947773c10/src/channel_server/chat_handler_functions.cpp#L281-L284

This is an example of how a command is added to the global command list, used in the previous snippet. The handler of the provided snippet is here: https://github.com/retep998/Vana/blob/19116c07dd0082b6c570bfd6d2ea604947773c10/src/channel_server/management_functions.cpp#L475

Note that this is C++1x (IIRC) and that the C++ people have thought of new ways to write function definitions and I'm not really fond of this format...

Z41N commented 3 years ago

Thanks

I'm at the following step:

  1. Run the Visual Studio nmake tool.
    • An example of where to find it: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake"

I'm in the botan folder, where configure.py lives (via cmd), and tried nmake but get the error stating that a makefile does not exist. I checked the botan 1.10.6 folder, and there indeed is none there. Followed the steps, but it appears there isn't a makefile to use for nmake. Thoughts?

I suspect its because the configure.py file did not run properly; although, I did run 2to3 ON the configure.py file, using

"E:\Program Files\Python33\Tools\Scripts\2to3.py" -w configure.py

while in the botan directory

Z41N commented 3 years ago

RESOLVED. Issue was due to invalid python installation.

Z41N commented 3 years ago

OK. So I'm at the final steps.

Here's what the script compilation log looks like:

MakeNSIS v3.06.1 - Copyright 1999-2020 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.

Processing config: C:\Program Files (x86)\NSIS\nsisconf.nsh
Processing default plugins: "C:\Program Files (x86)\NSIS\Plugins\x86-ansi\*.dll"
 + Banner::destroy
 + Banner::getWindow
 + Banner::show
 + BgImage::AddImage
 + BgImage::AddText
 + BgImage::Clear
 + BgImage::Destroy
 + BgImage::Redraw
 + BgImage::SetBg
 + BgImage::SetReturn
 + BgImage::Sound
 + Dialer::AttemptConnect
 + Dialer::AutodialHangup
 + Dialer::AutodialOnline
 + Dialer::AutodialUnattended
 + Dialer::GetConnectedState
 + EnVar::AddValue
 + EnVar::AddValueEx
 + EnVar::Check
 + EnVar::Delete
 + EnVar::DeleteValue
 + EnVar::SetHKCU
 + EnVar::SetHKLM
 + EnVar::Update
 + InstallOptions::dialog
 + InstallOptions::initDialog
 + InstallOptions::show
 + LangDLL::LangDialog
 + Math::Script
 + StartMenu::Init
 + StartMenu::Select
 + StartMenu::Show
 + System::Alloc
 + System::Call
 + System::Copy
 + System::Free
 + System::Get
 + System::Int64Op
 + System::Store
 + System::StrAlloc
 + TypeLib::GetLibVersion
 + TypeLib::Register
 + TypeLib::UnRegister
 + UserInfo::GetAccountType
 + UserInfo::GetName
 + UserInfo::GetOriginalAccountType
 + VPatch::GetFileCRC32
 + VPatch::GetFileMD5
 + VPatch::vpatchfile
 + advsplash::show
 + nsDialogs::Create
 + nsDialogs::CreateControl
 + nsDialogs::CreateItem
 + nsDialogs::CreateTimer
 + nsDialogs::GetUserData
 + nsDialogs::KillTimer
 + nsDialogs::OnBack
 + nsDialogs::OnChange
 + nsDialogs::OnClick
 + nsDialogs::OnNotify
 + nsDialogs::SelectFileDialog
 + nsDialogs::SelectFolderDialog
 + nsDialogs::SetRTL
 + nsDialogs::SetUserData
 + nsDialogs::Show
 + nsExec::Exec
 + nsExec::ExecToLog
 + nsExec::ExecToStack
 + nsisdl::download
 + nsisdl::download_quiet
 + splash::show

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "C:\LazurBeemz"

Processing script file: "C:\LazurBeemz\lazurbeemz.nsi" (ACP)
!include: "C:\Program Files (x86)\NSIS\Include\MUI2.nsh" (ACP)
!include: "C:\Program Files (x86)\NSIS\Contrib\Modern UI 2\MUI2.nsh" (ACP)
NSIS Modern User Interface version 2.1 - Copyright 2002-2020 Joost Verburg (C:\Program Files (x86)\NSIS\Contrib\Modern UI 2\MUI2.nsh:14)
!include: closed: "C:\Program Files (x86)\NSIS\Contrib\Modern UI 2\MUI2.nsh"
!include: closed: "C:\Program Files (x86)\NSIS\Include\MUI2.nsh"
!include: "C:\Program Files (x86)\NSIS\Include\InstallOptions.nsh" (ACP)
!define: "___NSIS__INSTALL_OPTIONS__NSH___"=""
!include: "C:\Program Files (x86)\NSIS\Include\LogicLib.nsh" (ACP)
!include: closed: "C:\Program Files (x86)\NSIS\Include\LogicLib.nsh"
!include: closed: "C:\Program Files (x86)\NSIS\Include\InstallOptions.nsh"
!include: "C:\Program Files (x86)\NSIS\Include\WinMessages.nsh" (ACP)
!include: closed: "C:\Program Files (x86)\NSIS\Include\WinMessages.nsh"
!include: "C:\Program Files (x86)\NSIS\Include\EnvVarUpdate.nsh" (ACP)
!define: "ENVVARUPDATE_FUNCTION"=""
Error: unterminated string parsing line at macro:_IncludeStrFunction:7
Error in macro _IncludeStrFunction on macroline 7
!include: error in script: "C:\Program Files (x86)\NSIS\Include\EnvVarUpdate.nsh" on line 49
Error in script "C:\LazurBeemz\lazurbeemz.nsi" on line 4 -- aborting creation process

Line 4 is just the inclusion of the EnvVarUpdate.nsh, which I have thrown into the include folder of NSIS. Not sure whats going on here..

Z41N commented 3 years ago

Found the answer lmao https://stackoverflow.com/questions/62081765/how-to-debug-nsis-script-3-05-2-gives-error-error-unterminated-string-parsing

Incapatability issue with the one !define un.${StrFuncName} was working.

Working on compiling vana, but first got to update the directory paths

Jeez... way too many errors.. followed everything to the T and I'm seeing links failing and multiple errors

retep998 commented 3 years ago

I'm so glad I'm using Rust for my own projects nowadays and not C++, so I don't have to deal with this dependency building hell.

Z41N commented 3 years ago

I'm so glad I'm using Rust for my own projects nowadays and not C++, so I don't have to deal with this dependency building hell.

Hey! Just wanted to say thank you, and I appreciate you and your team for the effort you guys have put into this. NO EASY TASK!!!!

Are you guys currently using C++ at all in your professional lives? I'm attending a engineering retreat, and all I'm seeing is Python, JS, and a little rust.

Also, currently re-doing this to get it up and running lol MUST add to portfolioioo

Z41N commented 3 years ago

WAHHH after allll of this, all 4 debug builds failed:

1>------ Build started: Project: Common, Configuration: Debug Win32 ------
1>precompiled_header.cpp
1>client_ip.cpp
1>connection_listener.cpp
1>encrypted_packet_transformer.cpp
1>exit_code.cpp
1>external_ip.cpp
1>external_ip_resolver.cpp
1>file_time.cpp
1>hash_utilities.cpp
1>ip.cpp
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(44,14): error C2039: 'get_io_service': is not a member of 'asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>'
1>C:\Program Files (x86)\LazurBeemz Library Pack\142\asio-1.18.0\include\asio\ip\tcp.hpp(85): message : see declaration of 'asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>'
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(43,21): error C2672: 'make_ref_ptr': no matching overloaded function found
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(48,29): error C3536: 'new_session': cannot be used before it is initialized
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(48,29): error C2664: 'void vana::connection_manager::start(std::shared_ptr<_Ty>)': cannot convert argument 1 from 'int' to 'std::shared_ptr<_Ty>'
1>        with
1>        [
1>            _Ty=vana::session
1>        ]
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(48,29): message : No constructor could take the source type, or constructor overload resolution was ambiguous
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_manager.hpp(50,8): message : see declaration of 'vana::connection_manager::start' (compiling source file src\common\connection_listener.cpp)
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(78,1): error C2664: 'void vana::connection_manager::stop(std::shared_ptr<_Ty>)': cannot convert argument 1 from 'int' to 'std::shared_ptr<_Ty>'
1>        with
1>        [
1>            _Ty=vana::session
1>        ]
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(78,1): message : No constructor could take the source type, or constructor overload resolution was ambiguous
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_manager.hpp(49,8): message : see declaration of 'vana::connection_manager::stop' (compiling source file src\common\connection_listener.cpp)
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(49,12): error C2672: 'asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept': no matching overloaded function found
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(80,3): error C2780: 'auto asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept(ExecutionContext &,asio::ip::basic_endpoint<asio::ip::tcp> &,MoveAcceptHandler &&,enable_if<std::is_convertible<ExecutionContext&,asio::execution_context&>::value,void>::type *)': expects 4 arguments - 2 provided
1>C:\Program Files (x86)\LazurBeemz Library Pack\142\asio-1.18.0\include\asio\basic_socket_acceptor.hpp(2360): message : see declaration of 'asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept'
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(80,3): error C2780: 'auto asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept(const Executor1 &,asio::ip::basic_endpoint<asio::ip::tcp> &,MoveAcceptHandler &&,enable_if<asio::is_executor<Executor1>::value||asio::execution::is_executor<T>::value,void>::type *)': expects 4 arguments - 2 provided
1>C:\Program Files (x86)\LazurBeemz Library Pack\142\asio-1.18.0\include\asio\basic_socket_acceptor.hpp(2284): message : see declaration of 'asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept'
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(80,3): error C2780: 'auto asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept(MoveAcceptHandler &&)': expects 1 arguments - 2 provided
1>C:\Program Files (x86)\LazurBeemz Library Pack\142\asio-1.18.0\include\asio\basic_socket_acceptor.hpp(1582): message : see declaration of 'asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept'
1>C:\Users\Z41N\Documents\Private Servers\v75\repack v75\src\common\connection_listener.cpp(80,3): error C2780: 'auto asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept(asio::basic_socket<asio::ip::tcp,Executor1> &,asio::ip::basic_endpoint<asio::ip::tcp> &,AcceptHandler &&)': expects 3 arguments - 2 provided
1>C:\Program Files (x86)\LazurBeemz Library Pack\142\asio-1.18.0\include\asio\basic_socket_acceptor.hpp(1456): message : see declaration of 'asio::basic_socket_acceptor<asio::ip::tcp,asio::any_io_executor>::async_accept'
1>item.cpp
1>block_cipher_iv.cpp
1>line.cpp
1>packet_builder.cpp
1>packet_handler.cpp
1>packet_transformer.cpp
1>common_packet.cpp
1>point.cpp
1>quest.cpp
1>ratio.cpp
1>rect.cpp
1>server_accepted_session.cpp
1>session.cpp
1>packet_reader.cpp
1>authentication_packet.cpp
1>connection_manager.cpp
1>abstract_server.cpp
1>vana_main.cpp
1>variables.cpp
1>Done building project "Common.vcxproj" -- FAILED.
2>------ Build started: Project: ChannelServer, Configuration: Debug Win32 ------
3>------ Build started: Project: LoginServer, Configuration: Debug Win32 ------
4>------ Build started: Project: WorldServer, Configuration: Debug Win32 ------
2>precompiled_header.cpp
4>precompiled_header.cpp
3>precompiled_header.cpp
4>channel.cpp
2>custom_functions.cpp
4>main_world.cpp
4>player_data_provider.cpp
4>channels.cpp
3>main_login.cpp
2>login_server_session.cpp
2>login_server_session_handler.cpp
3>characters.cpp
2>move_path.cpp
3>login.cpp
3>login_server.cpp
2>mystic_door.cpp
4>sync_handler.cpp
3>ranking_calculator.cpp
4>sync_packet.cpp
2>effect_packet.cpp
3>sync_packet.cpp
3>user.cpp
3>world.cpp
4>world_server.cpp
4>login_server_session.cpp
3>worlds.cpp
4>login_server_connect_packet.cpp
2>info_functions.cpp
4>world_server_accepted_session.cpp
2>inventory_packet_helper.cpp
2>main_channel.cpp
3>login_packet.cpp
2>management_functions.cpp
3>login_packet_helper.cpp
3>login_server_accepted_session.cpp
3>login_server_accept_packet.cpp
4>world_server_accept_packet.cpp
4>login_server_connect_handler.cpp
2>map_functions.cpp
3>login_server_accept_handler.cpp
3>LINK : fatal error LNK1104: cannot open file 'common.lib'
4>LINK : fatal error LNK1104: cannot open file 'common.lib'
4>Done building project "WorldServer.vcxproj" -- FAILED.
3>Done building project "LoginServer.vcxproj" -- FAILED.
2>maple_tv_packet.cpp
2>message_functions.cpp
2>party_handler.cpp
2>party_packet.cpp
2>pet.cpp
2>pet_handler.cpp
2>player_data_provider.cpp
2>player_mod_functions.cpp
2>buffs.cpp
2>channel_server.cpp
2>drop.cpp
2>fame.cpp
2>inventory.cpp
2>key_maps.cpp
2>map.cpp
2>maple_tvs.cpp
2>maps.cpp
2>mist.cpp
2>mob.cpp
2>npc.cpp
2>party.cpp
2>quests.cpp
2>reactor.cpp
2>reactor_handler.cpp
2>skill_macros.cpp
2>skills.cpp
2>status_info.cpp
2>summon_handler.cpp
2>summon.cpp
2>sync_handler.cpp
2>sync_packet.cpp
2>trade.cpp
2>trades.cpp
2>buddy_list_packet.cpp
2>buffs_packet.cpp
2>drops_packet.cpp
2>fame_packet.cpp
2>gm_packet.cpp
2>inventory_packet.cpp
2>levels_packet.cpp
2>map_packet.cpp
2>mobs_packet.cpp
2>monster_book_packet.cpp
2>npc_packet.cpp
2>pets_packet.cpp
2>player_packet.cpp
2>players_packet.cpp
2>quests_packet.cpp
2>reactor_packet.cpp
2>server_packet.cpp
2>skills_packet.cpp
2>storage_packet.cpp
2>summons_packet.cpp
2>trades_packet.cpp
2>buffs_packet_helper.cpp
2>player_packet_helper.cpp
2>map_factory.cpp
2>world_server_session.cpp
2>world_server_packet.cpp
2>world_server_session_handler.cpp
2>player.cpp
2>player_active_buffs.cpp
2>player_buddy_list.cpp
2>player_inventory.cpp
2>player_monster_book.cpp
2>player_mounts.cpp
2>player_pets.cpp
2>player_quests.cpp
2>player_skills.cpp
2>player_stats.cpp
2>player_storage.cpp
2>player_summons.cpp
2>player_variables.cpp
2>event_data_provider.cpp
2>instance.cpp
2>instances.cpp
2>buddy_list_handler.cpp
2>chat_handler.cpp
2>command_handler.cpp
2>drop_handler.cpp
2>inventory_handler.cpp
2>mob_handler.cpp
2>npc_handler.cpp
2>player_handler.cpp
2>trade_handler.cpp
2>chat_handler_functions.cpp
2>lua_instance.cpp
2>lua_npc.cpp
2>lua_portal.cpp
2>lua_reactor.cpp
2>lua_scriptable.cpp
2>LINK : fatal error LNK1104: cannot open file 'common.lib'
2>Done building project "ChannelServer.vcxproj" -- FAILED.
========== Build: 0 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========

SOS~!@!@#

diamondo25 commented 3 years ago

I have used C for embedded, but I am not touching C++ lol. Mainly Golang tbhOp 20 aug. 2020 03:30 schreef Zain notifications@github.com:

I'm so glad I'm using Rust for my own projects nowadays and not C++, so I don't have to deal with this dependency building hell.

Hey! Just wanted to say thank you, and I appreciate you and your team for the effort you guys have put into this. NO EASY TASK!!!! Are you guys currently using C++ at all in your professional lives? I'm attending a engineering retreat, and all I'm seeing is Python, JS, and a little rust. Also, currently re-doing this to get it up and running lol MUST add to portfolioioo

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

Z41N commented 3 years ago

ALRIGHT. Was finally able to get the build to complete successfully on all 4 projects.

After running loginserver without debugging, I get "Wrong version of database, please run loginserver to update" Unsure how to deal with that.

This is what my database.lua file looks like:

-- Database configuration takes the form of a table
-- Required keys:
-- host: the host of the database service
-- port: the port of the database service
-- username: the username to connect to the database service with
-- database: the schema in the database service that holds the appropriate tables
-- Optional keys:
-- password: the password to connect to the database service with
-- table_prefix: the prefix on tables within the schema

-- Character Database
chardb = {
    ["host"] = "localhost",
    ["username"] = "root",
    ["password"] = "",
    ["table_prefix"] = "",
    ["database"] = "vana",
    ["port"] = 3306,
};

-- MCDB
datadb = {
    ["host"] = "localhost",
    ["username"] = "root",
    ["password"] = "",
    ["table_prefix"] = "",
    ["database"] = "mcdb",
    ["port"] = 3306,
};

I thought maybe I could change my host name to vana (naive), and got "Vana database is currently inaccessible", so I doubt that was it.

Checked to ensure the mysql login information/host/port are correct. Hm

diamondo25 commented 3 years ago

The database version its complaining about is MCDB. You need to have the v.75 MCDB: https://mega.nz/#!G98mBJyT!D4isK2Rd2Dmzc2qQOC3dUkqZMie36DGhx3Hiqrzn6Dk (from https://github.com/VanaDev/MCDB-Releases )

diamondo25 commented 3 years ago

Oh and yes you need to start the loginserver first to update I guess

diamondo25 commented 3 years ago

?

Z41N commented 3 years ago

I installed mariadb , loaded the sql file into a database connection called maplestory, edited that in constants, along with the proper password, and still giving me the same issue

On Wed, Aug 26, 2020 at 10:59 AM Erwin Oegema notifications@github.com wrote:

?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/retep998/Vana/issues/31#issuecomment-680933962, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4ZKOYWD77MSKWBMTJMP7TSCUPLJANCNFSM4QEJOCLQ .