Commit Graph

93 Commits

Author SHA1 Message Date
cee09f6344 [refactor] Mark all internal functions static
All packet handlers and helper functions that are only used in the
source file they're declared in have been taken out of the namespaces in
the corresponding header files, have been marked static, and have been
reordered to avoid the need for declarations at the top of each source
file.

Each source file now contains a "using namespace" directive so that the
static functions don't need to prefix the source file's symbols with
their namespace. All redundant namespace prefixes found have been
removed.

An unused nano power resetting function in NanoManager has been removed.
2021-03-16 22:54:41 +01:00
2d7129111a [refactor] Refactor ChatManager
* Extracted all commands into CustomCommands.cpp
* Moved all chat-related packet handlers into ChatManger.cpp
* Cleaned up redundant includes
* Unified handler naming scheme
* Made all command handlers in CustomCommands.cpp static
2021-03-13 02:59:18 +01:00
c5e08b81da Implement /ban command 2021-03-07 00:38:24 +01:00
f2b1a84ef4 Fix segfault when redeeming more than four items at once 2021-03-06 02:09:21 +01:00
CakeLancelot
04a17ed862 Record claimed code items, and other misc DB fixes
* Create new table to store redeemed codes
* Check if a player already used a code when using /redeem
* Change Coordinate columns to non-plural form
* Fixed EmailItems unique constraint not being specific enough
* Bumped DB version to 3
2021-01-19 14:05:54 -06:00
CakeLancelot
9e30e55669 eggBuffPlayer now takes duration, and buff duration is read from EggType 2021-01-06 05:56:54 -06:00
deca220d43 Do not auto-register all fast travel destinations for GMs
Instead, players with access level 50 or higher can use /registerall and
/unregisterall.
2021-01-05 12:44:38 +01:00
a12acbb68f Implement most of the remaining client-side GM commands
* Muting a player's freechat
* Kicking players
* Querying info about a player
* Teleporting yourself to a player
* Teleporting a player to yourself
* Teleporting a player to another player
* Teleporting a player to arbitrary coords
* Teleporting a player to arbitrary coords in an arbitrary mapnum
* /unstick

Also:
* Renamed misleading setSpecialPlayer() to setValuePlayer()
* Revamped monitor logic
* Added server-side checks to account level 50 commands
* Made sure even trade chat is run through sanitizeText()
* Moved setSpecialState() closer to its calling functions
* Interpret client commands even in Buddy and Group chat (but not in
Trade chat)
2020-12-31 12:51:31 +01:00
fc45775666 Add /unwarpable command
GMs should use this before going to weird places where their non-GM
buddies might warp to them and get stuck.
2020-12-28 16:24:24 +01:00
868dc8485e Allow GMs to enter private instances 2020-12-28 16:12:57 +01:00
Gent S
52389c2c69 Make code redemption case-insensitive 2020-12-23 13:50:12 -05:00
Gent S
a1a5815f1f Fix academy nano missions not going into the 0th slot 2020-12-23 13:50:12 -05:00
Kamil
5f82658c8d adjusted item codes logic to handle multiple items per code 2020-12-23 13:50:12 -05:00
Kamil
34dbb59fb1 Implement redeem codes 2020-12-23 13:50:12 -05:00
e0808ffcbd Read the NPC ID limit from the XDT 2020-12-23 13:50:12 -05:00
a99f95d15f Initial Academy support
Support for the Academy's Nano system is complete, but they're not being
saved to the DB yet.
2020-12-23 13:50:12 -05:00
f8a359dfe9 Do not truncate emails to 127 characters
And assert that we never supply a string long enough for
sanitizeText() to truncate.
2020-12-19 05:51:06 +01:00
3359ca0c3e Moved common NPC summoning logic into a helper function 2020-12-15 23:19:29 +01:00
Gent S
d03c4f109f Add chat dump to monitor 2020-12-15 09:58:11 -05:00
Gent S
94b7864b02 Shut up warnings 2020-12-13 20:52:59 -05:00
Gent S
156e9bf902 Fix newline characters being stripped from emails 2020-12-13 20:18:36 -05:00
02c5df5c1b Ours is not to decide the value of pi.
Ours is only to live by it.
2020-12-06 02:45:20 +01:00
Gent S
85dcdd4cc5 Added /hide command to exclude players from monitor output 2020-12-04 07:24:33 -05:00
Gent S
4c398895aa Make /lair fit convention. 2020-12-02 18:41:09 -05:00
Gent Semaj
86f17b6525
Show announcements in server log 2020-12-01 19:59:18 -05:00
fed3eca378 Display area announcement to invoking player as well
Also clarified that shard- and world-level announcements will not be
implemented as they are not applicable to our single-shard server.
2020-12-01 23:32:45 +01:00
1e822f7a6c Removed redundant checks for a nullptr from PlayerManager::getPlayer()
These were written in desparation and never should have been there in
the first place.
2020-12-01 21:37:34 +01:00
Titan
c1941654b6 Basic Implementation of a lair unlock command 2020-12-01 14:19:16 -05:00
Jade
5771cd014a Various bugfixes and tweaks
- timed missions of all types should work.
- nanos now transmit an unsummon on 0 stamina.
- dying bumps your nanos down to half stamina now.
- enemies use abilities less frequently.
- group recall now works at any distance.
- passive nanos are tweaked to guzzle less stamina.
- cleared out some redundant stuff at the nanoPower handler.
2020-12-01 13:16:14 -05:00
Gent S
4863d29590 Fix /unsummonW crash on non-mob NPCs 2020-11-30 10:53:34 -05:00
858fbf40be Do not strip newlines from email bodies 2020-11-29 21:31:54 +01:00
Gent S
c7d3870a60 Add /whois command 2020-11-26 08:59:16 -05:00
Gent S
8351596763 Fix /help using accoutnId instead of accountLevel 2020-11-26 08:30:19 -05:00
Gent S
85113a667f Update unsummonW to handle new group gruntwork format 2020-11-25 11:45:34 -05:00
Gent S
6ff762ba57 Save gruntwork group mobs hierarchically 2020-11-25 10:41:10 -05:00
Gent S
e0858a42b2 Fix getNearestNPC w/ uses 2020-11-22 19:14:46 -05:00
Jade
f1d04cec01 UnsummonW Implementation + Tweaks
* UnsummonW can be used to remove the mob from existence.
* Mob groups now aggro together.
* Mobs space a little bit when chasing the player.
* Combat balance tweaked a bit, you can take out an entire boss group of scoria cephalopod with good nano usage with common tier weapons.
2020-11-22 16:53:19 -05:00
Jade
5e8b6eec6e Grouped Mobs are gruntworkable
* Using /summonGroupW
2020-11-22 16:53:03 -05:00
Gent S
e9ffbe6148 Make /refresh work again 2020-11-22 16:48:29 -05:00
Gent S
e50a4c2edd Experimental chunk refactor. 2020-11-19 17:37:02 -05:00
Gent S
5cbb8538c0 Get rid of PlayerView. For good. 2020-11-19 17:36:49 -05:00
Titan
b08fb52272 Implement /announce 2020-11-19 14:05:34 -05:00
Gent
7135767cc4 Egg checks, fixes, and cleanup
fixed not taking egg buff flag into consideration in mob manager

fixed stamina bug and improved sanity check

Egg cleanups
2020-11-11 23:19:07 -05:00
Kamil
0ecf76c5ec moved egg summoning to a custom ChatManager command 2020-11-11 23:19:07 -05:00
Kamil
d102fabc2f set up gruntwork 2020-11-11 23:19:07 -05:00
kamilprzyb
f2ff4c7f4d added basic player buffs implementation 2020-11-11 23:19:07 -05:00
Jade
83c378c9c2 Added /notify and /players admin commands
Co-authored-by: dongresource <dongresource@protonmail.com>
2020-11-03 21:07:59 +01:00
a1145aced4 Chat strings are now sanitized.
* Only plain, printable ASCII is allowed for now.
* Local chat is now printed to the server console, but group chat is
still private
* Added a helper function to print character names and IDs
2020-10-31 21:31:25 +01:00
Jade
c8497a4856
Implement two more mission types + tweaks & fixes
* Weapons will consume your batteries fully.
* Nerfed enemy damage at lower levels.
* Further reworked drain, uses a static variable as a timer (lastDrainTime)
* resendMobHP has been repurposed to drainMobHP.
* Players heal faster after a sizable cooldown.
* Nano type advantage is more noticeable during combat.

Implemented two more mission types + Tweaks

* Item delivery quests now work.
* Timed missions now work.
* All escort missions (type 6) are skipped.
* /minfo now also prints the terminator npc.
* Weapon battery consumption tweaked
* Fixed indentations.
* Heal nanos have better output (25% -> 35%)
* Damage formula had a slight tweak.
* Bugfixed weapon equipping.
* Other tweaks
2020-10-24 14:04:42 -04:00
10534886b8 Cleanup for 1.2.
Cleaned up whitespace, comments, brace style, etc.
Updated tdata reference.
2020-10-19 20:48:57 +02:00