Age | Commit message (Collapse) | Author | Files | Lines |
|
Not entirely sure if this is what was happening, but if a
PAMSG_LOGIN_RNDTRGR was handled, a new pending account was always
created and appended to mPendingAccounts. However, when handling the
follow-up PAMSG_LOGIN, only the first pending account with matching
username was checked, which could result in a failed login due to
mismatching token.
Resolved this issue by unifying the client-specific random token with
the Stellar token stored on the AccountClient. This means the username
value in PAMSG_LOGIN_RNDTRGR could be removed.
Eventually it would also be nice to simplify this further such that the
token is automatically sent to the client after connecting rather than
being something that needs to be requested.
|
|
When using login with Stellar, the email address remains empty. This was
causing issues since the email is also required to be unique, in effect
only a single Stellar account could exist.
Resolved this by allowing the email column to be null, since the unique
requirement does not cover null values. An empty email will now be
stored as null value.
For non-Stellar logins, an email address is still required.
|
|
Something doesn't seem to be working right...
|
|
Fixes many memory leaks, but also made it clear that we're very often
loading all the character data only to immediately throw it away again,
even when most of the time all we really need is the database ID or the
name.
|
|
* Overall includes cleanup
* Use std::make_pair
* Make some functions const
|
|
The client needs to know the URL to open in the browser. The bare token
is still sent as well, which might allow the client to directly interact
with a Stellar wallet in the future.
|
|
|
|
* Added PAMSG_STELLAR_LOGIN / PAMSG_STELLAR_LOGIN_RESPONSE, which is
used by the client to request a login token that can be signed using a
Stellar wallet.
* Added uWebSockets dependency, used to listen for a separate server
that verifies signed tokens (the Stellar Bridge). When a token is
verified, it is sent to manaserv-account, which then sends a
APMSG_LOGIN_RESPONSE to the client matching the token.
* Added RapidJSON dependency to parse the JSON WebSocket messages.
* To keep everything in a single thread, uWebSockets is now driving the
event loop. Processing of ENet hosts, writing stats and expired bans
have been moved to uSocket timers.
* C++ standard updated to C++17, as required by uWebSockets.
When Stellar is used to login, the public key is used as the username.
It might be better to introduce an explicit field for this, especially
when we want to enable an account to feature both Stellar login as well
as login with username / password.
|
|
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
|
|
Fixed by changing account instances to be managed by std::unique_ptr, so
we don't forget to delete them somewhere, like in that function as well
as during shutdown in AccountHandler.
|
|
This makes it easier on the client to decide whether to immediately open
the Create Character page or to go to the Choose Character page.
Still supports client version 9 as well.
|
|
|
|
|
|
|
|
It was a inventory slot not equipmentslot.
|
|
|
|
Things done:
Wrote a entity:give_experience function (lua side only).
Renamed characterpoints to attributepoints (no db update. Did not want
to do one for a simple rename).
Temponary introduced a ATTR_LEVEL constant. TODO: dehardcode this.
Script binds for settings the correction and attribute points.
|
|
This removes support for skills. The plan is to allow to implement the skills
as they were implemented before via attributes. This adds a lot more
flexibility to the server creators while also removing the confusion about
skills and attributes.
So this change does:
- Remove the skillmanager with all its calls, the skill xml file, etc
- Move exp giving to the script engine:
--> Allows to implement the old behaviour (and more) in the scripts
- Remove the exp tag from the monster definition:
+ Since the server itself does not require it anymore it feels wrong to
require it for EVERY monster. TODO: Add a system to add properties to the
monsters/items.xml which allow defining things like the exp and allows to
read the value from the script engine.
+ Small drawback, but it should not be hard to implement this property
system.
- Drop the level networking and calculation.
+ level calculation will happen via the attribute system later but i would
prefer to do this in a seperate patch since this patch already got longer
than expected especially since this requires to make setting correction
points and available status points scriptable.
+ The level would be simply set as a attribute, the int number of it will be
the level, the remaining digits will be the % number till the next levelup.
- NOT remove any existing skill tables in the database update scripts.
+ There is no way to move them into the attribute table in a unified way
(there are too many different way they could have been used). So server
admins have to care about moving theirs skills to attributes themselves.
+ Keeping the old tables does not hurt for existing databases. So removing
does not give any advantage/is required anyway. The now obsolote info
about the EXP transaction is not removed for updated databases either.
(The update script basically only bumps the version number without doing
anything else.
- bump the network protocol version --> old clients won't be able to connect.
- bump the database version --> serveradmins need to update their db.
|
|
Makes cleanup automatic and ownership somewhat better recognizable.
|
|
|
|
|
|
|
|
Same thing, but shorter.
|
|
Tested-by: jurkan.
Reviewed-by: Bertram.
|
|
These were unused parameters and one return type with an ignored 'const'
qualifier.
Reviewed-by: Yohann Ferreira
|
|
The level, character points and correction points are already
initialized by the Character constructor.
The ATTR_GP attribute is either not present, or obtained default value
from mDefaultAttributes. In both cases it makes no sense to set it to 0.
Reviewed-by: Yohann Ferreira
|
|
The account server sends out a random number, which is
additionally used for hashing the password.
Reviewed by Bertram
|
|
This resolves http://bugs.manasource.org/view.php?id=321
Reviewed-by: Jaxad0127, VUT
|
|
By default XML::Document will use the ResourceManager to resolve the
file name you pass to it. There is no point in disabling that
functionality only to resolve it manually.
Reviewed-by: Jared Adams
|
|
Just seems a bit more organized to me.
|
|
A bunch of variables that were continuously requested from the
configuration are now members of the AccountHandler.
Reviewed-by: Freeyorp
|
|
* Rely on the fact that a std::string is empty by default
* Use std::string::empty() rather than comparing to ""
* Construct with std::string() rather than from ""
Reviewed-by: Bertram
|
|
Nicer as members where there is clear ownership, initialization and
scope.
Reviewed-by: Freeyorp
|
|
Easier to understand than a std::pair with its 'first' and 'second'
members, and it also provides an implicit constructor so that
AttributeValue is implicitly constructed from a double.
Reviewed-by: Freeyorp
|
|
(trivial patch)
|
|
A C++ developer should be able to recognize a constructor and a
destructor by just looking at it, so let's stop writing down the
obvious. :)
|
|
Reviewed-by: Freeyorp.
|
|
As the protocol version isn't something the maintainers should
set, I removed the net_clientVersion irrelevant option, replaced
by the corresponding define PROTOCOL_VERSION
in the manaserv_protocol.h file.
A corresponding change in the client will be made.
N.B.: Now, the Enet version is also reported in the log.
Reviewed-by: Jaxad.
|
|
It was too close from the Position class and it leads to
making the server handle one or another type through the
code. Still bugged me many times while making changes.
Reviewed-by: Jaxad.
|
|
Trivial.
|
|
Resolves: Mana-Mantis #278.
|
|
I turned the vector storing character data into a map,
keeping the character's slot.
Fixed a memleak along the way.
Reviewed-by: Crush.
|
|
Changes:
============================================================
For the account server:
------------------------------------------------------------
Old -> New
------------------------------------------------------------
net_accountServerAddress,
net_listenHost -> net_accountHost
net_accountServerPort -> net_accountListenToClientPort
net_accountServerPort +1 -> net_accountListenToGamePort
For the game server:
------------------------------------------------------------
Old -> New
------------------------------------------------------------
net_gameServerAddress -> net_gameHost
net_gameServerPort -> net_gameListenToClientPort
For the chat server:
------------------------------------------------------------
Old -> New
------------------------------------------------------------
-> net_chatHost
net_accountServerPort + 2 -> net_chatListenToClientPort
Special fallback feature, as requested by Freeyorp:
When the net_accountListenToClientPort (default to 9601)
is set, the 3 others ports will automatically offset from it,
if they're not set, following this rule:
net_accountListenToGamePort = net_accountListenToClientPort + 1
net_chatListenToClientPort = net_accountListenToClientPort + 2
net_gameListenToClientPort = net_accountListenToClientPort + 3
Resolves: Mana-Mantis #216.
Reviewed-by: Jaxad0127.
|
|
Reviewed-by: Bertram
|
|
Reviewed-by: CodyMartin.
|
|
Also added an header to the autoattack.{h,cpp} files.
Big but trivial fix.
|
|
When registering or logging, The client is hashing the password
for sending it safely. And the server is hashing it also
to store it the same way. Hence, the password ends hashed twice,
which is correct because the server can't trust the client anyway.
At unregister attempt, the server wasn't hashing the password
before comparing it.
Also while on it, I made the corresponding SQL query use the try catch
method and only delete the account in memory when it's also done
on the Db.
Reviewed-by: thorbjorn, Freeyorp.
|
|
Mainly for consistency with the client, and the general consensus was
that these numbered versions were clearer.
|
|
This is for developing/testing an experimental new resource manager that
downloads only the files it needs on demand.
Currently only used by the Mana Mobile project. Regular Mana client
ignores the setting.
Reviewed-by: Jared Adams
|
|
Also made random code format clean-ups.
Resolves: Mana-Mantis #217
Reviewed-by: Jaxad0127.
|