Commit Graph

176 Commits

Author SHA1 Message Date
in1tiate
5de07f2eb6
Check for doubleposts per client, not per area (#338)
* Check for doubleposts per client, not per area

* Don't count testimony commands as doubleposts

* noooo the heckin indenterinos

* change func name for clarity

* *tiktok voice* Drowning myself in the skibidi toilet!
2024-03-08 11:11:06 -06:00
AwesomeAim
2720d909f6 change ban checks to return full BanInfo and reorder db_manager to allow for it 2023-05-05 10:04:24 -07:00
Salanto
021aefb78c Fix music load order
* Fixes empty-songlist due to incorrect loading order in the MusicManager
2022-07-24 14:59:23 +02:00
scatterflower
ca84b54597
Replace packet handler with templates (#300)
* Replace packet handler with templates

* Move all packet functions into classes

* Liberal use of Q_UNSUED

* Add correct argument count to packets

* Fix windows build issues

* Partially implement argument type validation
* Where applicable.
* Checking if we can convert from a string to a string would be useless

* Fix unit tests for AOPacket

Co-authored-by: scatterflower <marisa@scatterflower.online>
Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
2022-07-07 10:33:41 -05:00
cow-face
9bba94fc93
Added dice notation to help command (#308)
* added dice notation to roll and rollp commands
2022-07-06 10:59:07 -05:00
Salanto
45b37e3fc8
Merge branch 'master' into unittest-ConfigManager 2022-06-30 13:18:01 -07:00
Salanto
ce629a3103 This may look stupid
* But you feel even more stupid when it could've been avoided by good config loading.
2022-06-30 22:17:31 +02:00
scatterflower
aece875362
Add more secure password hashing support (#293)
* Separate crypto operations into new class

* Implement PBKDF2 backend

* Add auto-update to stronger hashes

* clang-format pass

* documentation and cleanup

* Add unit tests for CryptoHelper

Co-authored-by: scatterflower <marisa@scatterflower.online>
2022-06-30 22:13:22 +02:00
Salanto
22cfee962b
Add regression test to ACL ini handler (#281)
* Add QTest for issue validation

* Add file-existence check for test

* Update acl_roles_handler.cpp

* Appease clang

* Only look for unittest files

* Where art thou?

* Change root directory when running test

* Fix pathing on Windows CI

* Windows please just accept this path

* Too many CDs

* Bash is evil.

* Wildcard moment

* I swear to god Bill Gates why does your OS suck so much?

* Add cache, use working-directory

* Maybe? Maybe not? Who the fuck cares at this point

* Fix library path

Holy shit these tests almost work on Windows.

* FUCKING HELL

* Where art thou? 2nd Edition

* Edited wrong one

* Re-add execution code

* Remove Linux stuff

* Do it in batch

Bash is evil.

* Set to CMD

* I am now expected

* Missing libs

Should be good enough 🤷

* Powershell my beloved, save me

* Adjust pathing (again)

* Add some debug info

* Powershell syntax shenanigans

* I distrust Github Actions now

* I swear my windows is licensed, please work

* More debug info

* More debug

* For the love of all that is holy why the fuck do you not work

* Cheap path hack

* Upload test folder for debug

* Set Execution Policy<

Apparently tests on the Windows CI never worked???

* Remove debug information

* Does this even work? If not, fuck

* Try older Windows runner

* Comment out non-functional Windows QTest action

* Note that Linux is still functional, so QTest for Windows has to be conducted trough QtCreator till a solution is found.

* Unbreak-test

* Use latest runner version

Co-authored-by: TrickyLeifa <date.epoch@gmail.com>
2022-06-27 17:00:45 -05:00
Salanto
cf009718c2 Fix new connected client not being a spectator 2022-06-23 18:52:21 +02:00
Salanto
97528e641c Expand kick_other to consider the hwid 2022-06-17 22:49:24 -05:00
Salanto
883ac90511 Fix segfault due to insufficient jukebox state validation. 2022-06-15 17:52:27 -05:00
Salanto
5cea6674c9 Add jukebox skip command
* Prevents the jukebox being locked up by long playing songs without any way to skip it
2022-06-15 17:52:27 -05:00
Salanto
6d848682f6 Remove unused include in AOClient 2022-06-15 17:52:27 -05:00
Salanto
164a1789d0 Add /kick_other command
* closes #239
2022-06-15 17:52:27 -05:00
Salanto
d39f93926f Enable websocket port overwrite in advertiser
*Advertises port 80 if the AO Server is behind a reverse proxy, like cloudflare tunnels.
2022-06-15 17:52:27 -05:00
Salanto
bbd55263df Update configuration DB
This prevents a lockout scenario where the root user may be left without permissions if the DB was created prior to this PR.
2022-06-15 17:52:27 -05:00
Salanto
a2c769f173 Finish desturctor, fix localhost lookup 2022-06-15 17:52:27 -05:00
Salanto
16955e9c16 Apply suggestion
* Put QSettings check in helper function
* Removed stray QDebug()
* Fixed wording on command message.
*Update commandhelp
2022-06-15 17:52:27 -05:00
Salanto
d0c22ee879 Missed one
Co-authored-by: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com>
2022-06-15 17:52:27 -05:00
Salanto
9090d150b0 Batch commit spelling corrections
Co-authored-by: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com>
2022-06-15 17:52:27 -05:00
Salanto
c9818a137f Websockets refactor (#26)
* Implement NetworkSocket Thin-Proxy

Removes the need for the overengineered WS-Proxy
2022-06-15 17:52:27 -05:00
Salanto
c26319701e Rework AOPacket (#24) 2022-06-15 17:52:27 -05:00
Salanto
70b5212640 Add per area wtce and shout disable options (#22) 2022-06-15 17:52:27 -05:00
Salanto
d82e6b8e59 Disable music change for spectator (#21)
* Disable music change for spectator

* Appease clang-format

* Properly handle this bullshit.
2022-06-15 17:52:27 -05:00
Leifa♥
f307f728c9 Added command extension system (#12)
* Added command extension system

Resolve #10

* Added akashi definitions

* Updated headers to comply to the standard

* Added full definition to argument

* Clang-format pass

* Missing header for GCC

* Missing header for GCC

* Move method implementation to source file
2022-06-15 17:52:27 -05:00
Leifa♥
e01f0e1c57 Changed message_floodguard logic and introduced global_message_floodguard (#8)
* Changed message_floodguard logic, ...

Resolve #3

The client individual client timer was ignored in favor of the area timer as it wouldn't make a lot of sense to have 3 different timers for game messages.

* Changed message_floodguard to only affect the area in which the message was sent rather than globally. The default value is 250ms.
* Added global_message_floodguard, this restores the previous functionality of message_floodguard. The default value is 0ms.
2022-06-15 17:52:27 -05:00
Leifa♥
657a47b029 Added flexible ACL roles (#7)
Resolve #4
2022-06-15 17:52:27 -05:00
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
b38a6e7ee9 Add ability to read forwarded-for header
This helps when the websockets are behind a proxyserver, like Cloudflare
2022-03-21 01:30:03 +01:00
AwesomeAim
aa0e14b789
Re-add /getarea
I should probably read what's going on in the files rather than a quick glance.
2022-03-12 22:09:31 -08:00
Rosemary Witchaven
9f6acefdef
Merge pull request #241 from Salanto/QoL/alias-getarea
Alias getarea, getareas and roll
2022-03-12 23:28:24 -06:00
Salanto
675a6faee1 Alias roll too 2022-03-12 17:44:00 +01:00
Salanto
52a48f263e Send currentply playing song to client joining the area 2022-03-12 17:26:12 +01:00
Salanto
c7ce9e8aa1 Alias getarea and getareas
GAS GAS GAS, I'M GONNA STEP ON THE GAS!
2022-03-12 15:00:43 +01:00
Salanto
3193e8e7f4 Switch queue with stack
Adds a bias towards lower user ids.
This change is purely aesthetic to bring Akashi closer to a tsu-like userid assignment.
2022-02-07 22:29:50 +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
Rosemary Witchaven
d6a4e64070
Merge pull request #224 from Salanto/addClientIDtoArea
Change broadcast to area to use userIDs instead of iterating over all joined clients.
2022-01-24 13:49:54 -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
8c3ea52f94 Allow songs to be aliased.
Allows you to alias songs by providing the main name as a "Friendly name", while the actual song name can be an URL or a different name.

Solves the ancient issue of "but MOM, it's called [Insert Japanese Weaboo name here" and allows servers without dedicated WebAO repository to have their music be streams.
2022-01-09 04:17:21 +01:00
Rosemary Witchaven
0b35f11763
Merge pull request #222 from Salanto/purge-ms2-take2
Take 2 : Purge ms2 advertiser and change naming
2022-01-07 16:38:06 -06:00
Rosemary Witchaven
d26912a1f8
Merge pull request #221 from Salanto/change-userID-shenanigans
Simplify code for user id assignment
2022-01-07 16:37:56 -06:00
Salanto
68270f69cb Purge ms2 advertiser and streamline naming 2022-01-07 23:18:54 +01:00
Salanto
5989ed2851 Simplify code to determine user id 2021-12-30 11:22:46 +01:00
Salanto
659d53f0a3 Fix incorrect playercount when advertising
+ Some design changes because they are better imo. Fight me.
2021-12-20 01:07:10 +01:00
Salanto
57dc4ee9ec
Merge pull request #218 from Salanto/area_message
Add Area Messages
2021-12-17 21:24:40 +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
de3680eb87 Add backwards compatability with older config folders
Prevents an oopsie where logs are non-functional when the config folder was not updated yet.
Also, it's reloadable. How neat is that?
2021-12-17 02:42:54 +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
Rosemary Witchaven
48dc849b32
Merge pull request #201 from PresJoeBiden/Keeping-People-Out-With-an-IP-Subnet-Ban,-man!
Executive Order 14042 : Implement IPRange Ban
2021-12-13 19:30:42 -06:00