Commit Graph

31 Commits

Author SHA1 Message Date
Leifa♥
b0555207d6 Privatization rework (#2)
* Add clang-format

* Multiple privatization changes

"Participation handshake" this refers to the moment that the user's client sends the `askchaa` packet.

* Server::m_clients is now private. Get a copy with Server::getClients()
* Server::m_player_count is now private. Get a copy with Server::getPlayerCount() (Additional logic was added to handle the player count.)
* AOClient::m_joined is now private. Get a copy with AOClient::hasJoined()
* Added signal AOClient::joined(); will be emitted when the client first complete the participation handshake.
* Renamed Server::updatePlayerCount to Server::playerCountUpdated

* Privatized Server

* Made Server members private: m_characters, m_areas, m_area_names
* Added Server methods: getCharacters(), getAreas(), getAreaById(f_area_id), getAreaByName(f_area_name), getAreaNames(), getAreaName(f_area_id), getMusicList
* Added Server helper methods: getCharacterCount(), getAreaCount()
- This reduce code repetition of the following example: server->getCharacters().length(), server->getAreas().size()

* Solved other merge conflicts

* Added Server methods, various fixes

* Added Server methods: getCharacterById(f_chr_id)
* Various optimizations

* More Server privatization changes

* Made Server members private: db_manager, next_message_timer, can_send_ic_messages
* Renamed Server members:
  * next_message_timer -> m_message_floodguard_timer
  * can_send_ic_message -> m_can_send_ic_message
Added Server methods: getDatabaseManager, isMessageAllowed, startMessageFloodguard(f_duration)
Made Server methods private: allowMessage

* Added new fields to load for AreaData

* Added fields: `area_message` (default: empty string) and `send_area_message_on_join` (default: false)

* Added Server::clearAreaMessage

* Cleaned up headers include (AOPacket excluded)

* Removed most project file includes, moved to source file (cpp)
  * AOPacket was excluded because some methods modify the copy

* Fix compile error when using MingW compiler

* Appease clang by using proper or and putting it in parentheses
* Remove extra semicolon
2022-06-15 17:52:27 -05:00
Salanto
52a48f263e Send currentply playing song to client joining the area 2022-03-12 17:26:12 +01:00
in1tiate
83c41c05f7 Squashed commit of the following:
commit e946bf124602f224ce0e371ba1374f0355b537eb
Merge: d6a4e64 4505909
Author: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com>
Date:   Fri Jan 28 19:43:36 2022 -0600

    Merge pull request #225 from Salanto/Dynamic-Area-Musiclist-Take2

    Allow users to add custom songs to the music list on a per-area basis

commit 45059092d2888b60912f721e43a380910d10ccd8
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Mon Jan 24 22:05:27 2022 +0100

    TIL what a typedef is

commit 02584db9640fff0a1969a7f516c4bccfae9b5388
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Mon Jan 24 21:39:17 2022 +0100

    Not all OR are equal. Explain weird command splitting

    Remove hardcoded URLs

commit d00ebd5692296cd0c29dd377113b53fe0e7b99c0
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Mon Jan 24 21:28:08 2022 +0100

    Salanto PR Language Update by in1tiate

    As usual, my English is absolutely unreadable.

    Co-authored-by: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com>

commit d3842106e06350dc02d8864bb28232fdc5643f00
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Mon Jan 24 20:35:32 2022 +0100

    Add missing config file + document commands for help

commit ac64360e1c1741023b01052977de77a7d5ea4f8c
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Mon Jan 24 19:52:13 2022 +0100

    Minor improvements to command usage and addition of clear command

commit c614578e78ce9afa0c8e22aa36bdf46a70a97169
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sun Jan 23 22:19:54 2022 +0100

    Purge last traces of old songInformation system

commit 07618761f044a13d75587b28a9c994342a5980e2
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sun Jan 23 22:10:54 2022 +0100

    Working version, needs some refinement and debugging in AOClient

commit 33c0358c98c0fd2de805356a9aa3ac7bbed204e1
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sun Jan 23 21:48:05 2022 +0100

    Almost functional implementation

    Now only need to determine why I can't play the customs yet

commit b0acbace78b3f16f2fe4f3c6f65a422e3343f992
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sun Jan 23 15:26:42 2022 +0100

    Fix build error, expand validation test slightly

commit a48c4f503998ce8e42f0bb409c5a3c7dc5e40329
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sun Jan 23 01:03:27 2022 +0100

    Add commands

commit 88ab0b473953873166e291e5009b97df31547b3f
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sat Jan 22 15:10:26 2022 +0100

    Float sucks, int has to be good enough

    + add retrival of song information

commit e924e1340be1a0909eba84072f1646fe9770bd02
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Thu Jan 20 22:28:35 2022 +0100

    Fix removing moving

    Add necessary tests

commit 3df088f8d07ce7e0d8fe08b6a97608a623e6ef97
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Wed Jan 19 19:34:16 2022 +0100

    Start work on adding this shit into commands

commit c293ecfa99d1b2bd1e0b34cb8752d69b2eca057c
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Tue Jan 18 19:07:11 2022 +0100

    Fix typo and add singal for incremental upgrades

commit 10a42322e1e23af5795278a40b2ac59f3ab952ef
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Tue Jan 18 06:17:51 2022 +0100

    Hookup packet sending to music manager

    This might sound like a bad idea on first glance, but otherwise it breaks the AreaData tests and I am NOT gonna try to fix those without even understanding why they break.

commit 319836296374162b0b847432e8a626778317b869
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Tue Jan 18 06:17:51 2022 +0100

    Enraged comments, make area send FM packet

    Revert "Enraged comments, make area send FM packet"

    This reverts commit ec7a1a25646b2c2acc8a3a748b853851cc47d205.

commit 224a0d7efe989a5f336167c3f716061813f93ee3
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Tue Jan 18 05:10:18 2022 +0100

    Change packet communication from area to client

    First steps to hookup the custom musiclist.

commit 65aa8f7855a36f2c668b1399a5ed22fefeaf186d
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Mon Jan 17 00:48:38 2022 +0100

    Add test for custom list sanitisation.

    + Fix intentionally broken tests

commit 7c00ab437a6ff12033742d029ce49037f5bb1ebe
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Mon Jan 17 00:29:51 2022 +0100

    Sanitise the custom list opposed to deleting it

    This will fail tests intentionally to test the CI.

commit 80ad401267068e75707b2517a0bf836763141f8b
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sun Jan 16 17:17:12 2022 +0100

    Add custom category capabilities

commit 08d8f5f8f683816ceba532f9c47cd0d5ab34389a
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sun Jan 16 03:58:18 2022 +0100

    Fix music addition and move relevant tests

commit 6ebf0d03b5da61a9c287115009d28038710ba7af
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sat Jan 15 08:08:20 2022 +0100

    Hookup music_manager into server, change default musiclist source for new clients

    + More tests 🆒

commit bd50c62376f131e2508ecdd3e272209894ecaec1
Author: Salanto <62221668+Salanto@users.noreply.github.com>
Date:   Sat Jan 15 03:13:42 2022 +0100

    Add central song validator for other classes

    Also added applicable test cases to ensure proper operation.
2022-01-28 19:51:30 -06:00
Salanto
7e8ea8b35c Keep record of joined userIds in area.
Adds the server-assigned clientid to the area, allowing the server to exclusively broadcast to this area without checking each clients area, instead pulling a list of them from the area itself and sending exclusively to them.

Tests have been adjusted to account that area leaving and joining can now be identified by userid.
2022-01-14 04:45:38 +01:00
Salanto
dabc7c1abe Apply suggestion batch that fixes bad english
Co-Authored-By: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com>
2021-12-17 21:19:15 +01:00
Salanto
9d9cbdb4e2 Implement an area specific message
This feature improves RP/Casing slightly by allowing an automatic message to be send when they enter the area.
2021-12-17 02:31:52 +01:00
Salanto
df237bbe3a Improve error handling and messaging to user 2021-09-13 18:13:48 +02:00
Salanto
8bdfe1e045 Ensure that no stale songs are in the jukebox queue when its disabled
Housekeeping and fix /currentmusic not returning a song
2021-09-12 23:20:09 +02:00
Salanto
f9dcaa2aa5 Implement a basic and functional jukebox implementation 2021-09-12 22:32:10 +02:00
Salanto
f24d16eb68 Remove old log definitions from area_data.h
Apparently I completely forgot about those.
2021-09-10 18:39:02 +02:00
Salanto
0cfaf25f66 Fix Webhook Buffer, Fix QStringLiteral Arg missing 2021-08-25 06:34:46 +02:00
Salanto
401f98b23e Set the background in area data.
Currently, Akashi does not save the changed background in the area, meaning clients will default to the configs background.

This commit addresses the issue by saving the new background in the area data, meaning it is persistent between people moving in and out of the area.
2021-08-07 22:21:53 +02:00
MangosArentLiterature
d728a9e676 Fix evidence and config issues
- Load auth and log values in uppercase.
- Move evidencemod to an enum class.
- Fix LE packet being incorrectly encoded.
2021-06-24 11:09:39 -05:00
MangosArentLiterature
ef3103a87f Replace all std::pair with QPair 2021-06-21 22:14:37 -05:00
scatterflower
78a644e592
Merge pull request #137 from AttorneyOnline/ignore-bglist
Add the ability to ignore the BG list per area
2021-06-21 21:50:26 -05:00
scatterflower
4f4b64e662
Merge pull request #140 from AttorneyOnline/fix-logging
Log commands and OOC messages separately
2021-06-21 21:46:29 -05:00
MangosArentLiterature
c4db245bec Rewrite ConfigManager and server configs
- Rewrites ConfigManager
- Adds DataTypes
- Changes "auth" and "logging" to use new AuthType and LogType types.
- ConfigManager now handles all config loading
- Remove AreaData and Server config.ini and command config loading.
2021-06-18 18:06:32 -05:00
MangosArentLiterature
bfe5c8c733 fix documentation
def. didn't forget to do this
2021-06-12 12:13:26 -05:00
MangosArentLiterature
8416232ff9 Log commands and OOC messages separately
Now every OOC message won't be treated as if it were a command, only commands will be sent to the command logger.
Also, much needed .gitignore update
2021-06-12 12:05:47 -05:00
MangosArentLiterature
dc497a55f6 Add the ability to ignore the BG list per area
- Adds the "ignore_bglist" option to areas, which toggles whether the BG list is enforced or ignored in an area.
- Adds a moderator permission "IGNORE_BGLIST" to give moderators the permission to toggle this setting.
- Adds a moderator command `/ignorebglist` to toggle this for an area.
2021-06-08 09:12:04 -05:00
Cerapter
de085461d9 Fix testimony problems, simplify statement hops, add tests for testimony 2021-05-09 18:02:50 +02:00
Cerapter
f12567cd07 Document remaining AreaData functions 2021-05-09 14:25:30 +02:00
Cerapter
e435470952 Fix Doxygen looking in nonexisting directory, add more documentation 2021-05-05 23:07:43 +02:00
Cerapter
9423b25bf5 Fix remaining clazy-writing-to-temporary issues 2021-05-04 22:38:39 +02:00
Cerapter
a42281c2c7 Fix clazy-writing-to-temporary issues
TODO still:
- Evidence
- Judgelog
2021-05-02 18:32:39 +02:00
Cerapter
68b4174a40 Merge remote-tracking branch 'refs/remotes/scatter/master'
Conflicts:
	akashi.pro
	core/include/logger.h
	core/src/commands/area.cpp
	core/src/packets.cpp
	include/logger.h
	src/commands/area.cpp
	src/packets.cpp
2021-05-01 23:33:00 +02:00
Cerapter
0a87f30287 Corrected every error in the build
TODO: Documentation, test writing still.
2021-05-01 22:51:51 +02:00
Cerapter
08fd5896ba More work on AreaData rework 2021-05-01 17:45:59 +02:00
Cerapter
85cc9af73a Change all accesses to getters 2021-05-01 16:05:50 +02:00
Cerapter
5a0c291825 AreaData acccess rework, from direct to through getters
Literal hell.
2021-05-01 15:29:58 +02:00
Cerapter
f5cc137b40 Rename lib to core.
On Linux, the resulting shared library would have been called `liblib`, which is just dumb.
2021-04-26 21:14:25 +02:00