Coder Social home page Coder Social logo

mana / manaserv Goto Github PK

View Code? Open in Web Editor NEW
111.0 111.0 40.0 7.24 MB

A flexible 2D MMORPG server, Moved to: https://gitlab.com/manasource/manaserv

Home Page: http://manasource.org/

License: GNU General Public License v2.0

CMake 1.61% Lua 4.56% C 13.87% C++ 78.08% Shell 0.03% PLpgSQL 1.80% Batchfile 0.01% GDB 0.01% QMake 0.01% Dockerfile 0.03%

manaserv's Introduction

THE MANA CLIENT

With the Mana client you can play The Mana World and related games. The Mana World is a free 2D open source MMORPG. This client supports games hosted by either tmwAthena or manaserv.

The Mana client is written in C++ and builds upon:

  • SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, SDL2_net (Media framework)
  • Guichan (GUI framework)
  • libxml2 (XML parsing and writing)
  • PhysicsFS (Data files)
  • ENet (UDP networking library)
  • libcurl (HTTP downloads)
  • zlib (Archives)

See the AUTHORS file for the list of developers.

Account Creation

To create an account you can usually press the "Register" button after choosing your server. When this doesn't work, visit the website of the server you'd like to register on, since they may be using an online registration form instead.

Keyboard and Mouse Input

Use arrow keys to move around. Other keys:

- Ctrl               attack
- F1                 toggle the online help
- F2                 toggle profile window
- F3                 toggle inventory window
- F4                 toggle equipment window
- F5                 toggle skills window
- F6                 toggle minimap
- F7                 toggle chat window
- F8                 toggle shortcut window
- F9                 show setup window
- F10                toggle debug window
- Alt + 0-9          show emotions / usuable at skill level 2.
- Alt + S            sit down / stand up / usuable at skill level 3.
- Alt + F            toggle debug pathfinding feature
- Alt + P            take screenshot
- Alt + T            turns on anti-trade function / usuable at skill level 1.
- A                  target nearest monster
- H                  hide all non-sticky windows
- G or Z             pick up item
- Enter              focus chat window / send message

Left click to execute default action: walk, pick up an item, attack a monster and talk to NPCs. Right click to open a context menu. Holding left Shift prevents walking when attacking.

Chat Commands

Certain server interaction requires the use of slash-commands in the chat window. Here's a list of common commands:

- /help              Displays the list of commands
- /clear             clears the chat window
- /where             displays the map name your currently on
- /whisper           send a private msg to another player
                        (format: /whisper <charname> <message>)
                     If the <nick> has spaces in it, enclose it in double
                        quotes e.g. /whisper "char name" <message>
- /record            Records the Chat output
                     (format: /record <filename to write to> starts the record
                        session /record again
                      stops the session)
- /party             <command> <params>: Party commands
 - /party new         creates a new party /party new <party name>
 - /party create      creates a new party /party create <party name>
 - /party prefix      This commands sets the party prefix character
                         /party prefix <prefix-char>
                      "/party prefix" reports the current party prefix
                         character
 - /party leave       This command causes the player to leave the party.
Type /help party <option> for further help.
- /present           This command gets a list of players within hearing
- /toggle            make the chatlog lose focus on a blank line or after
                       message. (format: /toggle <option>, where option can be
                       '1', 'y' or 't' to make the chatlog lose focus on a
                       blank line, and '0', 'n' or 'f' to make the chatlog lose
                       focus after every message.  /toggle displays the status)

For more information, type /help <command>.

Support

If you're having issues with this client, feel free to report them to us. There is a bug tracker at https://github.com/mana/mana/issues and you can find us on IRC on irc.libera.chat in the #mana channel.

If you have feedback about a specific game that uses the Mana client, be sure to contact the developers of the game instead.

Compiling the Client

Installing the dependencies on Ubuntu:

sudo apt install build-essential cmake \
                 libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev \
                 libsdl2-net-dev libsdl2-ttf-dev \
                 libcurl4-openssl-dev libphysfs-dev libxml2-dev \
                 libguichan-dev libpng-dev gettext

Installing the dependencies on macOS (with Homebrew):

brew install sdl2 sdl2_image sdl2_mixer sdl2_net sdl2_ttf \
             physfs curl

Installing the dependencies on Fedora:

sudo dnf install gcc-c++ cmake physfs-devel libcurl-devel guichan-devel \
                 SDL2_image-devel SDL2_mixer-devel SDL2_net-devel \
                 SDL2_ttf-devel

Installing the dependencies on Windows (using MSYS2 UCRT64):

pacman -S mingw-w64-ucrt-x86_64-gcc \
          mingw-w64-ucrt-x86_64-cmake \
          mingw-w64-ucrt-x86_64-physfs \
          mingw-w64-ucrt-x86_64-curl-winssl \
          mingw-w64-ucrt-x86_64-SDL2_image \
          mingw-w64-ucrt-x86_64-SDL2_mixer \
          mingw-w64-ucrt-x86_64-SDL2_net \
          mingw-w64-ucrt-x86_64-SDL2_ttf \
          mingw-w64-ucrt-x86_64-libxml2

Once the dependencies are installed, use CMake:

cmake -B build .
cmake --build build

This produces an executable in build/src/mana. If running it without installing, be sure to run it from the repository root so that it can find its data files.

See README.cmake for additional information.

manaserv's People

Contributors

ablu avatar ambiwlans avatar atheros avatar bjorn avatar blue112 avatar dotdash avatar exceptionfault avatar iceslice avatar jaxad0127 avatar jurkan avatar kagejittai avatar ko2fan avatar mashu avatar nymacro avatar philipp-s avatar postremus avatar rogierpolak avatar silene avatar stefanbeller avatar turmfalke2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

manaserv's Issues

combatcomponent.cpp logic error.

64 for (std::vector<Attack *>::const_iterator it = attacksReady.begin(),
65 it_end = attacksReady.end(); it != it_end; ++it)
66 {
67 const Point &attackerPosition =
68 entity.getComponent()->getPosition();
69 const Point &targetPosition =
70 mTarget->getComponent()->getPosition();
71
72 // check if target is in range using the pythagorean theorem
73 int distx = attackerPosition.x - targetPosition.x;
74 int disty = attackerPosition.y - targetPosition.y;
75 int distSquare = (distx * distx + disty * disty);
76 AttackInfo _info = (_it)->getAttackInfo();
77 int maxDist = info->getDamage().range +
78 entity.getComponent()->getSize();
79
80 if (distSquare <= maxDist * maxDist &&
81 (!highestPriorityAttack ||
82 highestPriorityAttack->getAttackInfo()->getPriority()
83 < info->getPriority()))
84 {
85 highestPriorityAttack = *it;
86 }
87 }

i think there is a logical error in line 85. after line 85, we need break the block of for loop;

Crash to investigate

Crash from SoT server.

server commit: 71afa59

bt full:

(gdb) bt full
#0  0x0000000000546309 in ObjectBucket::isAllocated (this=0x2000000020, i=-120)
    at /home/tzork/tales/manaserv/src/game-server/mapcomposite.cpp:131
No locals.
#1  0x0000000000546fb3 in MapContent::findEntityById (this=0x8ac1e0, 
    publicId=-26232)
    at /home/tzork/tales/manaserv/src/game-server/mapcomposite.cpp:408
        bucketIndex = -120
        b = 0x2000000020
#2  0x000000000054890e in MapComposite::findEntityById (this=0x8014c0, 
    publicId=-26232)
    at /home/tzork/tales/manaserv/src/game-server/mapcomposite.cpp:745
No locals.
#3  0x000000000052fb85 in findActorNear (p=0xec7350, id=-26232)
    at /home/tzork/tales/manaserv/src/game-server/gamehandler.cpp:143
        e = 0x7fffffffe670
        map = 0x8014c0
#4  0x0000000000530a47 in GameHandler::handleNpc (this=0x831d30, client=..., 
    message=...)
    at /home/tzork/tales/manaserv/src/game-server/gamehandler.cpp:449
        id = -26232
        actor = 0x7fffffffe670
#5  0x000000000052ff41 in GameHandler::processMessage (this=0x831d30, 
    computer=0x9f6770, message=...)
---Type <return> to continue, or q <return> to quit---
    at /home/tzork/tales/manaserv/src/game-server/gamehandler.cpp:204
        client = @0x9f6770: {<NetComputer> = {_vptr.NetComputer = 0x594830, 
            mPeer = 0x7ffff7eda1d0}, character = 0xec7350, status = 1}
#6  0x00000000004e5ed0 in ConnectionHandler::process (this=0x831d30, timeout=0)
    at /home/tzork/tales/manaserv/src/net/connectionhandler.cpp:129
        msg = {mData = 0xedf970 "\002ร™\210", mLength = 4, mId = 707, 
          mDebugMode = false, mPos = 4}
        comp = 0x9f6770
        event = {type = ENET_EVENT_TYPE_RECEIVE, peer = 0x7ffff7eda1d0, 
          channelID = 0 '\000', data = 32767, packet = 0xedf2b0}
#7  0x00000000004ee0b3 in main (argc=1, argv=0x7fffffffe678)
    at /home/tzork/tales/manaserv/src/game-server/main-game.cpp:433
        elapsedTicks = 0
        isConnected = true
        waittime = 0
        options = {configPath = {static npos = <optimized out>, 
            _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7ffff71fb4d8 ""}}, 
          verbosity = utils::Logger::Info, verbosityChanged = false, 
          port = 9604, portChanged = false}
        debugNetwork = true
        accountServerLost = false
(gdb) 

Converity issue (Uninitialized pointer field (UNINIT_CTOR))

Hi,

Please find the latest report on new defect(s) introduced to mana/manaserv found with Coverity Scan.

1 new defect(s) introduced to mana/manaserv found with Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)

** CID 38420: Uninitialized pointer field (UNINIT_CTOR)
/usr/include/c++/4.9.2/bits/hashtable.h: 803 in std::_Hashtable<unsigned int, std::pair<const unsigned int, Entity *>, std::allocator<std::pair<const unsigned int, Entity *>>, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<(bool)0, (bool)0, (bool)1>>::_Hashtable(unsigned long, const std::hash &, const std::__detail::_Mod_range_hashing &, const std::__detail::_Default_ranged_hash &, const std::equal_to &, const std::__detail::_Select1st &, const std::allocator<std::pair<const unsigned int, Entity *>>&)()


*** CID 38420: Uninitialized pointer field (UNINIT_CTOR)
/usr/include/c++/4.9.2/bits/hashtable.h: 803 in std::_Hashtable<unsigned int, std::pair<const unsigned int, Entity *>, std::allocator<std::pair<const unsigned int, Entity *>>, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<(bool)0, (bool)0, (bool)1>>::_Hashtable(unsigned long, const std::hash &, const std::__detail::_Mod_range_hashing &, const std::__detail::_Default_ranged_hash &, const std::equal_to &, const std::__detail::_Select1st &, const std::allocator<std::pair<const unsigned int, Entity *>>&)()
797 __hashtable_alloc(__node_alloc_type(__a)),
798 _M_element_count(0),
799 _M_rehash_policy()
800 {
801 _M_bucket_count = _M_rehash_policy._M_next_bkt(__bucket_hint);
802 _M_buckets = _M_allocate_buckets(_M_bucket_count);

CID 38420:  Uninitialized pointer field  (UNINIT_CTOR)
Non-static class member "_M_single_bucket" is not initialized in this constructor nor in any functions that it calls.

803 }
804
805 template<typename _Key, typename _Value,
806 typename _Alloc, typename _ExtractKey, typename _Equal,
807 typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
808 typename _Traits>

Make configuring the server easier

Having to set a world path AND the scripting entry path is somehow silly since they depend on each other for example... The game data itself should reference the script entry point IMO.

Make sure ids are always send with the same bit-length

For example the lowering an attribute message takes a 32bit int, the raising a 16bit int for the attribute id.

I think we could maybe do a sendId() function which always sends with either 16 or 32bit and make sure that one is always used. (Maybe it would make sense to introduce a type wrapper for ids so they cannot be mixed with integers anywhere (then we also kill all this unsigned <-> signed randomness)

Server crash from SOT

manaserv-game: /home/mana/manaserv/src/game-server/inventory.cpp:468: bool Inventory::equip(int): Assertion `itemIt != mPoss->inventory.end()' failed.

Backtrace:

(gdb) bt full
#0  0x00007ffff62f86f5 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00007ffff62fa2fa in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00007ffff62f0f97 in __assert_fail_base () from /lib64/libc.so.6
No symbol table info available.
#3  0x00007ffff62f1042 in __assert_fail () from /lib64/libc.so.6
No symbol table info available.
#4  0x000000000056ad16 in Inventory::equip (this=0x7fffffffda30, inventorySlot=10) at /home/mana/manaserv/src/game-server/inventory.cpp:468
        slot = 9
        itemIt = {first = 8, second = {slot = 0, itemId = 23238208, amount = 0, equipmentSlot = 0}}
        it = 9
        it_end = 7
        itemIt = {first = 10, second = {slot = 0, itemId = 45, amount = 1, equipmentSlot = 0}}
        item = @0xb83bb4: {slot = 0, itemId = 45, amount = 1, equipmentSlot = 0}
        equipReq = @0x9054a0: {equipSlotId = 5, capacityRequired = 1}
        slotsToUnequipFirst = std::set with 1 elements = {[0] = 6}
        __PRETTY_FUNCTION__ = "bool Inventory::equip(int)"
        equipMsg = {mData = 0xe69c70 "'", mPos = 11942048, mDataSize = 0, mDebugMode = 224}
#5  0x00000000005661b9 in GameHandler::handleEquip (this=0x87df60, client=..., message=...) at /home/mana/manaserv/src/game-server/gamehandler.cpp:614
        slot = 10
        msg = {mData = 0x15b2ad0 "\001#h\366\377\177", mPos = 2, mDataSize = 16, mDebugMode = false}
#6  0x00000000005649f8 in GameHandler::processMessage (this=0x87df60, computer=0x11ab0a0, message=...) at /home/mana/manaserv/src/game-server/gamehandler.cpp:224
        client = @0x11ab0a0: {<NetComputer> = {_vptr.NetComputer = 0x5cb248 <vtable for GameClient+16>, mPeer = 0x7ffff7ed4010}, character = 0x1618f70, status = 1}
#7  0x0000000000518277 in ConnectionHandler::process (this=0x87df60, timeout=0) at /home/mana/manaserv/src/net/connectionhandler.cpp:129
        msg = {mData = 0xe69c60 "\001\022", mLength = 4, mId = 274, mDebugMode = false, mPos = 4}
        comp = 0x11ab0a0
        event = {type = ENET_EVENT_TYPE_RECEIVE, peer = 0x7ffff7ed4010, channelID = 0 '\000', data = 0, packet = 0x1c65890}
#8  0x0000000000520ab2 in main (argc=3, argv=0x7fffffffe4f8) at /home/mana/manaserv/src/game-server/main-game.cpp:433
        elapsedTicks = 0
        options = {configPath = "config.xml", verbosity = utils::Logger::Warn, verbosityChanged = false, port = 9604, portChanged = false}
        debugNetwork = false
        isConnected = true
        waittime = 0
        accountServerLost = false
(gdb) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.