| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
| |
There was a small problem with how we computed the size of the
packet "header". It was unlikely to manifest tho, because it's at
the beginning of a TCP message and TCP segments aren't that small,
unless the whole message is that small.
I'm also allowing login servers to query for world information
to allow a basic form of `STATUS` to be implemented.
|
| |
|
|
|
|
|
|
|
|
|
| |
Using enums instead of hard coded numbers for error codes should
help with readability, even though they're local to the functions
that use them to avoid flooding the namespace.
Checking whether credentials are empty before login will prevent
error messages such as "account disabled" from showing up when no
account is specified, which may look weird. It'll also avoid any
database reads although this shouldn't really make a difference
torwards performance or security since it's only an edge case.
|
| |
|
|
|
|
|
| |
Prevent blocked IP addresses and accounts from returning anything
other than a blocked error message. Previously, further attempts
would first check the password which enabled brute force attacks
to use the "invalid account/password" message as an oracle.
|
| | |
|
| |
|
|
|
|
|
| |
Some distributions place libpq headers under /usr/include/postgresql
which is why it's added to the include path. And even though we don't
support it yet, the same happens with MariaDB, with headers being
placed under /usr/include/mariadb.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
This was done with the old design in mind, but with the query
thread offloading, returning false is meant to signal a failure
in completing it. A connection lost with PostgreSQL or BUSY error
with SQLite, for example.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The monotonic uptime was used exclusively with caches and having
a resolution of SECONDS allows it to be stored as an int without
risk of wrapping (~68 years). Using MILLISECONDS meant that it
would wrap after ~25 days which is totally possible and EXPECTED.
Just as an example, the small test server I ran for about 1 month
had ZERO downtime on the QueryManager except for when I manually
restarted it. It was probably very close to wrapping when I took
it down.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This also avoids conflicts with database RESULT objects that we lacked
with SQLite but show up with PostgreSQL and MySQL.
|
| | |
|
| |
|
|
|
| |
This should give us everything we need to implement all the
supported queries.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
With this change the game server is able to login again but we
still need to re-implement/re-fit the other queries for it to
properly startup.
|
| | |
|
| |
|
|
|
|
| |
This moves queries from `src/connections.cc` to `src/query.cc` and
adds a few missing details. The only thing left is to review query
processing and tie database operations to the `TDatabase` struct.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
I had just added it in the last commit but it made its use case
non-obvious. Checking whether the string is empty before trying to
parse an IP address is clearer than calling some function that has
its own concept of what an empty address is.
|
| | |
|
| |
|
|
|
|
| |
Using `sqlite_open` with `SQLITE_OPEN_READWRITE` doesn't guarantee
the database will be open with read-write permissions.
- See: https://www.sqlite.org/c3ref/open.html
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
There was a problem with concurrent writes not being visible
until after restart, due to how cached prepared statements work
with SQLite (see comment in `database.cc`).
|
| |
|
|
|
|
|
|
|
| |
- Add support for SIGINT and SIGTERM signals for graceful termination.
- Properly check premium account status with `EVICT_FREE_ACCOUNTS`
query.
- Properly check if character is already online before failing game
login with "too many characters" error.
- Overall cleanup.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|