Commit Graph

699 Commits

Author SHA1 Message Date
Kamil 2f5c2a8764 Reimplement DB functions 1/2
implemented addAccount
implemented updateSelected
implemented findAccount validateCharacter isNameFree and isSlotFree
implemented getTableSize function
implemented functions for name save, character creation and finishing tutorial
2020-12-13 19:51:09 -05:00
Kamil 34ca36062c Create basic tables 2020-12-13 19:51:09 -05:00
Kamil a1062f220b Open DB from settings path 2020-12-13 19:51:09 -05:00
Kamil c2f640fd97 RIP ORM 2020-12-13 19:51:09 -05:00
actuallyamoose 143bb00ac0
Added checks to prevent buddy warping and item sending across time (#183) 2020-12-13 19:05:11 -05:00
JadeShrineMaiden b947ff65cf
Various bugfixes
- Eruption is now blocked by stun and sleep.
- Corruption should block all nano abilities.
- Buffs time out for other players
- Timed mission bugfixes (AGAIN)
- Corruption and Eruptions fire quicker.
- Heal egg ids fix
- No power nanos no longer break the system.
- Mobs should no longer restun.
- Mob ability chance calculation adjustments.
- Duration of the power's debuff is sent as iDamage instead of 0, this removes the ugly "Block" that shows up on successful hits.
- Group mob respawning bugfixes
- a bit of a cleanup
2020-12-12 17:22:22 -05:00
dongresource 1474ff10ac Slight adjustments to the poll() loop
Recheck the entry at the current index after we remove one. This isn't
strictly necessary, since the next pass will get it anyway.

Using a vector as opposed to our own realloc()'d array means indexing
beyond the size() is undefined behavior, so it's better to be safe.
2020-12-12 01:27:28 +01:00
dongresource 974941f4fa Close our end of the connection when we receive an EOF
This should/might fix the server's CPU usage spiking to 100%.
2020-12-12 01:27:13 +01:00
Gent S 2834891727 Properly output socket errors on Windows 2020-12-08 17:22:14 -05:00
dongresource ada8af0b82 Print informative error messages for socket operations
Windows implementation pending.
2020-12-08 15:23:58 -05:00
dongresource 86e0b1bc13 EINTR is not crash-worthy
This is how it should have been handled anyway. This fixes a (benign)
race condition when the server is killed, as well as gprof builds.

Also updated tdata.
2020-12-08 20:10:02 +01:00
Gent S d5409ed3f1 Replace bad continue statement with goto in monitor socket iteration 2020-12-08 14:05:34 -05:00
dongresource 811c9d4d5c Stop iterating in exitDuplicate() after having removed a player
This fixes a crash due to the invalidated iterator continuing to loop.
It should be safe to assume there's only ever one duplicate/stale player.

Also updated tdata.
2020-12-08 01:53:21 +01:00
Gent S a48fb3a8e8 Don't run nano mission logic at level 36 (fixes "Super Saiyan" bug) 2020-12-06 11:53:41 -05:00
dongresource 27f396af7e Oops, M_PI is POSIX so it isn't defined in math.h on Windows 2020-12-06 06:02:58 +01:00
dongresource 8ebabac7c0 Various bugfixes
* Fixed Nano stamina not being halved on respawn
* Reverted the default argument to terminate() change because MSVC is
undable to disambiguate the function pointer passed to sigaction()
* Fatal errors during init (like in TableData) can just call exit(1)
directly anyway (missing "OpenFusion: terminated." be damned)
* Switched to a slightly more portable syntax for getting the version
in the Makefile
* We shouldn't join the shard thread in the signal handler because the
thread the signal handler ends up running in is undefined behaviour and
we don't strictly need to join it anyway

Many of these issues were discovered on OpenBSD.
2020-12-06 05:25:23 +01:00
dongresource 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
dongresource dd6fbfb683 Tweak terminate() slightly
* Gave it a default argument, since we never actually care about it, but
it needs to have it to conform to the signal handler prototype
* Constricted the area locked by activeCrit to only the block that deals
with the connections vector, to lower the chance of a future badly
placed call to terminate() deadlocking the server instead
2020-12-06 02:20:46 +01:00
dongresource 92307063fc Integrate the monitor's listener socket into the shard's poll()
This removes the need for a separate monitor thread.
2020-12-06 01:44:37 +01:00
dongresource 53d8cb67ba Set monitor connections to non-blocking
Better to just drop monitor connections when the quality is bad than to
risk blocking the shard thread.
2020-12-05 23:16:09 +01:00
dongresource 6b257887b7 Use an std::vector for PollFDs instead of handling it manually
Lowered poll() timeout to 50, to fix (work around?) slider stutter.
2020-12-05 22:51:17 +01:00
dongresource ec7cba644c Clean up polling logic
* Extracted PollFD manipulation and nonblocking socket configuration
into helper functions
* Replaced the connections list with an unordered_map
* Dynamically grow the number of PollFD structures with realloc()

With these changes done, the server's CPU usage is completely diminished
from its old average of ~47% to ~0.07%, with occasional spikes up to ~14%.
2020-12-05 22:47:50 +01:00
dongresource 269315ca09 Support for poll() (ie. WSAPoll()) on Windows 2020-12-05 22:47:50 +01:00
dongresource 661061b4eb Switch to non-blocking sockets + poll(); prepare for Windows logic 2020-12-05 22:47:50 +01:00
dongresource 3a2b488f33 [WIP] fixed a million bugs and one potential one 2020-12-05 22:47:50 +01:00
dongresource 721b3f440f [WIP] Switched to poll(), but only on Unix 2020-12-05 22:47:50 +01:00
Gent S b04c377d7c Properly implement item types. 2020-12-04 16:42:58 -05:00
Gent S 794856a63c Clean up item loading from XDT. 2020-12-04 13:57:08 -05:00
Gent S 856a90abcf Fix nano logic in goo damage running without a nano out 2020-12-04 11:59:53 -05:00
dongresource 88d904e302 Fix FM patches not dealing damage unless invulnerable 2020-12-04 17:48:12 +01:00
dongresource 46552307cd Disable monitor by default in config file 2020-12-04 17:30:21 +01:00
dongresource 26024de866 Support the monitor interface on Windows as well
This change required sacrificing both code cleanliness and the specific
error reports from perror(). Those could have been kept with a portable
wrapper, but that's too much work. We'll do it if unforseen errors
arise.
2020-12-04 17:25:32 +01:00
Gent S 85dcdd4cc5 Added /hide command to exclude players from monitor output 2020-12-04 07:24:33 -05:00
Gent S 1ca8094628 Fix regression with disconnected player on Skyway agent. 2020-12-03 15:33:14 -05:00
Gent S 543d0a7afd Fix edge case for nano mission acquisition
This caused players to only get nano missions after exceeding the required FM instead of meeting it.
2020-12-03 00:05:14 -05:00
Gent S 4c398895aa Make /lair fit convention. 2020-12-02 18:41:09 -05:00
dongresource e899928928 Do not try to compile the monitor on windows 2020-12-03 00:15:06 +01:00
dongresource c8b011913a Make monitor parameters configurable 2020-12-02 23:42:33 +01:00
dongresource 15b63f3cbd Fix regression with a disconnect check in MobManager::combatStep() 2020-12-02 23:32:38 +01:00
dongresource ce1a5a7664 Handle partial transmissions of the buffer to the monitor 2020-12-02 20:19:34 +01:00
dongresource c6112d04da Implemented player position monitor interface 2020-12-02 20:19:34 +01:00
Gent S 73f8179836 Make aggro space spheroidal on Z
By doubling the z difference used in distance calculation, mobs above or below the player will aggro less often.
2020-12-02 09:20:33 -05:00
Gent Semaj 86f17b6525
Show announcements in server log 2020-12-01 19:59:18 -05:00
dongresource 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
dongresource fb9c4140b6 Remove redundant namespace specifiers in PlayerManager::init() 2020-12-01 22:24:18 +01:00
dongresource 657061083e Lose aggro and do not take damage if invulnerable 2020-12-01 21:37:34 +01:00
dongresource 8a86c75747 Make sure each group member is alive before healing/buffing them 2020-12-01 21:37:34 +01:00
dongresource 046e7bb6f1 Do not aggro on players with /invulnerable 2020-12-01 21:37:34 +01:00
dongresource 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
dongresource c43a3d64fb Removed the Player pointer from CNSocket
It was a leak in the abstraction that we weren't even using that much.
This is technically a de-optimization, but it's okay since it's not a
hot code path.
2020-12-01 21:37:34 +01:00
Titan 7c5d7a70cc Fix enter key sending '\n' in passwords 2020-12-01 14:29:21 -05:00
Titan c1941654b6 Basic Implementation of a lair unlock command 2020-12-01 14:19:16 -05:00
Gent S d2d6171d04 Fix gumballs only lasting 1 minute instead of 10 2020-12-01 13:47:54 -05:00
Jade 58952be47e Added silent unsummoning
- summonNano now supports an optional "silent" argument
- gumballs now last 10 minutes.
- fixed comments
2020-12-01 13:16:14 -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 c9754902b9 Instance fusion lair NPCs, remove non-mob fusions, stub non-mob paths 2020-12-01 06:07:10 -05:00
Gent S c508016ca3 Play nano mission animation for nearby players 2020-11-30 20:36:20 -05:00
Gent S 4863d29590 Fix /unsummonW crash on non-mob NPCs 2020-11-30 10:53:34 -05:00
dongresource 858fbf40be Do not strip newlines from email bodies 2020-11-29 21:31:54 +01:00
Gent S 1d7f8bd133 Mob abilities cleanup 2020-11-28 12:41:00 -05:00
Jade a9ad399bc2 Various Tweaks to Mob skill behavior
- Fixed enemy abilities playing after death
- Nerfed frequency further
- Heal on retreat correctly
- Nerfed damage and corruption skill damage
2020-11-28 11:41:32 -05:00
Jade 963205fad6 Added Nullptr check + Made mob abilities less frequent 2020-11-28 11:41:21 -05:00
Jade b836952356 Restructured Arrays to Vectors 2020-11-27 19:02:54 -05:00
Jade 6fb652f642 Corruption reflection + Extra adjustments 2020-11-27 16:33:22 -05:00
Jade 2cde3e34f6 Active skills, Corruption and Eruption 2020-11-27 16:33:18 -05:00
Jade 1371a6da77 Base Variadic MobPowers Handler 2020-11-27 16:32:59 -05:00
Jade d2e89851d6 Non-group buffs do not misbehave + Revive nano stamina fix 2020-11-27 15:40:49 -05:00
Gent S 7cc0a0fc82 Fix group recall and temporarily lift range restriction 2020-11-27 15:31:56 -05:00
Jade c343092bd5 Gumball times out for slots 2 & 3 + Tweaks 2020-11-27 12:01:28 -05:00
Gent S 36d6231da4 Nano refactor cleanup
sanity checks and int[] -> vector<int>
2020-11-27 00:07:31 -05:00
Gent S 7851866d13 Fix nanos making sound when they run out of stamina 2020-11-26 23:01:19 -05:00
Gent S c2ab5c9d02 Fix case where resplen wasn't being initialized 2020-11-26 23:01:19 -05:00
Jade 166eb5125f Group Heal Range Limit 2020-11-26 23:01:19 -05:00
Jade 26ca4d8671 New Powers, Tweaked Eggs further + Cleanup
* Scavenge and Bonus nanos work.
* Eggs now damage and heal more cleanly.
2020-11-26 23:01:19 -05:00
Jade 28276d2229 Reverting back some changes + Tweaks 2020-11-26 23:01:19 -05:00
Jade 2b25b17bd8 Gumball Handling and Bugfixes
* Gumballs now run out of timer.
* Reverted a regression, (gumballs with 0 iOpt do not get emptied).
* Nano matchups now work correctly.
2020-11-26 23:01:19 -05:00
Jade f7c0596a4c Adapted Egg Buffing to Nano powers
* Adapted eggs to nano power data.
* Tweaked nano abilities.
2020-11-26 23:01:19 -05:00
Jade fe7ec44554 Restructuring, Cleaning up and Bugfixes
* Added findTargets, a new helper function that reads out the packet for targets.
* Restructured and removed leftover redundant code.
2020-11-26 23:01:19 -05:00
Jade 299fc1b461 Refactored Nano Powers
* All nano power functions have been merged into one goliath of a function.
* Nano powers consume the correct amount of stamina.
* Bugfixed gumball issues, gumballed nanos now perform better.
* Revive powers now work correctly.
* Recall powers both self and group are functional.
* Removed nanoBuff.
* Added a new applyBuff function, this allows for quick and easy application of nano skills.
* Numerous other bugfixes.
2020-11-26 23:01:19 -05:00
Jade 2acb90f2d2 Initial tabledata implementation 2020-11-26 23:01:19 -05:00
Gent S 75d33aff3e Fix S.C.A.M.P.E.R. chunk desync... again 2020-11-26 22:58:56 -05:00
Gent S 8073c68bd5 Make /fusionmatter properly update fusion matter 2020-11-26 22:33:43 -05:00
Gent S 15dd0a2fc3 Add missing sanity checks to BuddyManager 2020-11-26 22:30:30 -05:00
Gent S 71d1212877 Fix All Characters always failing validation 2020-11-26 11:04:56 -05:00
Gent S 57060e9b6f Fix spawning in the unknown when no Resurrect 'Ems are nearby 2020-11-26 11:03:42 -05:00
Gent S faf2a0ee7d Fix freefalling after MSS DC 2020-11-26 10:01:48 -05:00
Gent S fa7b6e6145 Properly set default NPC class 2020-11-26 09:05:44 -05:00
Gent S 478bcd5338 Use vendorID instead of NPC_ID to index into vendor tables 2020-11-26 09:00:30 -05: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 e3568ea506 Fix viewableChunks memory leaks 2020-11-25 22:49:37 -05:00
CakeLancelot a9a8d96321
Fix Female Characters always failing validation 2020-11-25 20:37:24 -06:00
Gent S b0aea27418 Fix player revive packet carrying wrong values
Oops
2020-11-25 20:38:48 -05:00
Gent S 872425640d Prevent DB players from occupying same slot 2020-11-25 19:25:20 -05:00
Gent S ea5b7104be moved name checks to name save and name change packets
added a TODO

Formatting + sizeof in login server
2020-11-25 19:25:20 -05:00
Kamil d85d9d4b12 added character creation validation
added a comment
2020-11-25 19:25:20 -05:00
Kamil 7e08bc60ce added character validation for SAVE_CHAR_TUTOR and CHANGE_CHAR_NAME
fixed ugly sizeofs
2020-11-25 19:25:20 -05:00
Kamil 86e6937342 added character validation to delete packet 2020-11-25 19:25:20 -05:00
Kamil ec8abfa004 moved sending character selection fail to a helper function 2020-11-25 19:25:20 -05:00
Kamil 51a687c7db hugely simplified managing player characters in login server 2020-11-25 19:25:20 -05:00
Kamil 657306e0a1 added missing debug print outs 2020-11-25 19:25:20 -05:00
Kamil eee8aab888 refactored and cleaned up login function 2020-11-25 19:25:20 -05:00
Kamil 5c6d7d6055 added a sanity check for entering invalid characters 2020-11-25 19:25:20 -05:00
Kamil 4760d91ccd refactored giant switch to smaller functions 2020-11-25 19:25:20 -05:00
Gent S db98af9775 Fix chunk desync on revive 2020-11-25 17:50:57 -05:00
Gent S f91f9786d1 Fix chunk desync on S.C.A.M.P.E.R. warp 2020-11-25 17:46:16 -05:00
Gent S 71d9cab72e Fix chunk desync on NPC warp 2020-11-25 17:42:46 -05:00
Gent S 717e5eb78f Remove bad warning for multikills 2020-11-25 13:33:12 -05:00
Gent S e7301f46ef Properly copy mob groups to instances 2020-11-25 11:49:40 -05:00
Gent S 85113a667f Update unsummonW to handle new group gruntwork format 2020-11-25 11:45:34 -05:00
Gent S 98ae236c08 Load gruntwork group mobs hierarchically 2020-11-25 11:09:05 -05:00
Gent S 6ff762ba57 Save gruntwork group mobs hierarchically 2020-11-25 10:41:10 -05:00
Gent S 73ef5fa5ff Load mob groups hierarchically 2020-11-23 19:28:22 -05:00
Gent S 8a0d0e0e4c Restructure tdata 2020-11-23 18:45:28 -05:00
Gent S 0f1d9cdf1c Add sanity check for nano ID in nano equip handler 2020-11-23 17:03:08 -05:00
Gent S 07a1927b9f Force chunk update in sendPlayerTo 2020-11-22 19:22:33 -05:00
Gent S e0858a42b2 Fix getNearestNPC w/ uses 2020-11-22 19:14:46 -05:00
Gent S dab536cb6a Grouped mobs adjustment 2020-11-22 19:14:22 -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
Jade 883a1c17e6 Group Mobs Initial Implementation
* For now only mob.json is read for grouped mobs.
* Grouped mobs are fully functional granted the mobs.json is prepared correctly.
* Removed redundant move packet.
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 d1baa0d9f9 Replace inPopulatedChunks with player counter for NPCs 2020-11-22 16:48:29 -05:00
Gent S 71d4f331b5 Fix egg type warning message 2020-11-22 16:46:09 -05:00
Gent S 665f28313a Clean up redundant forced chunk updates for NPCs 2020-11-21 11:53:48 -05:00
Gent S c5fa397724 Fix player entering chunks twice on load 2020-11-21 11:46:56 -05:00
Gent S 95b385dee1 Reimplement chunk data caching 2020-11-19 19:16:51 -05:00
Gent S 82b505a737 Fix buddy warp causing softlock 2020-11-19 18:16:35 -05:00
Gent S dae3b24093 Reimplement chunk position caching 2020-11-19 17:37:07 -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
Gent S d2e776b672 Fix mission rewards stacking on top of each other 2020-11-19 14:07:29 -05:00
Titan b08fb52272 Implement /announce 2020-11-19 14:05:34 -05:00
Gent S 0075457f81 Temporarily remove sanity check for egg pickup distance 2020-11-17 13:51:35 -05:00
Gent S 12baece1b2 Fix opening C.R.A.T.E.S. resetting your boost counters 2020-11-17 13:48:20 -05:00
Kamil c77f99e849 moved bullets removal call 2020-11-16 21:38:49 -05:00
Kamil d17890af68 cleanup 2020-11-16 21:38:49 -05:00
Kamil 6c1d8c3527 updated comment 2020-11-16 21:38:49 -05:00
Kamil 59ab81d3c6 fixed weapon boosts being used with 0 batteryW 2020-11-16 21:38:49 -05:00
Kamil 9cee8f2c87 added cleaning up player's bullets on exit 2020-11-16 21:38:49 -05:00
Kamil a483b0fb44 fully implemented rockets and grenades 2020-11-16 21:38:49 -05:00
Gent S 8ad3f3aabd CHUNKPOS macro -> ChunkPos typedef 2020-11-16 09:59:53 -05:00
Gent S b22ba781c8 Possible fix for chunking desyncs + CHUNKPOS macro 2020-11-15 14:41:56 -05:00
Gent 4d1d77ceaf Switch to getTime() for egg and buff ticking 2020-11-11 23:50:39 -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 9087baae3c Polished reading egg json data 2020-11-11 23:19:07 -05:00
Kamil 95b5da8932 temp chunk issue fix 2020-11-11 23:19:07 -05:00
Kamil f733aa60f0 added a chunk sanity check
removed unneccesary include
2020-11-11 23:19:07 -05:00
Kamil d102fabc2f set up gruntwork 2020-11-11 23:19:07 -05:00
Kamil 6d4afd0c6a fixed goo damage not taking all flags into account 2020-11-11 23:19:07 -05:00
Kamil 8003518e18 made particles for picking up eggs work, made damage and heal eggs work 2020-11-11 23:19:07 -05:00
Kamil 859b24229a added a condition to not send mob/egg _ENTER packet when it's HP is 0 2020-11-11 23:19:07 -05:00
Kamil 674d5112f3 implemented basic eggs functionality 2020-11-11 23:19:07 -05:00
kamilprzyb de99522340 added removing buffs on player exit 2020-11-11 23:19:07 -05:00
kamilprzyb c7006b46ed EggBuffs now stores debuff timestamp instead of remaining time 2020-11-11 23:19:07 -05:00
kamilprzyb 45ed99ae35 implemented player debuff 2020-11-11 23:19:07 -05:00
kamilprzyb f2ff4c7f4d added basic player buffs implementation 2020-11-11 23:19:07 -05:00
dongresource 2744ed64e3 Fix a bug where the server would crash if Drain killed a mob. 2020-11-11 23:35:00 +01:00
Gent 90754665a0 Refactor buddy request-by-name 2020-11-11 09:06:41 -05:00
Gent 4454faffc3 Add garbage collection for non-existent players 2020-11-10 18:16:06 -05:00
Gent 34f2aef248 Fix seg fault in buddy data for deleted player 2020-11-10 18:00:34 -05:00
Gent 121c65d7ea Fix not being able to attach weapons to emails 2020-11-09 21:33:02 -05:00
Gent f53de8d521 Explicitly update buddy records in DB
this should fix the bug where removing a buddy while they're offline won't take you off their list until you disconnect
2020-11-09 05:04:06 -05:00
Gent 8a68958ed4 Fix players being able to become buddies twice 2020-11-09 04:41:20 -05:00
Gent d7a8d2d453 Sanitize email subject + body 2020-11-08 15:37:17 -05:00
darkredtitan 5293573116
Allow period and numbers in firstname/lastname regex check (#144)
* Remove unnecessary whitespace check in regex
* Allow dot characters in names (except at the beginning of a name)
* Allow numbers in names
2020-11-08 14:34:02 -06:00
Gent d505b09e98 Email bugfixes
- Fix item flag not getting updated
- Fix attachments getting written to the same slot
2020-11-08 14:58:51 -05:00
Gent 8f90fdaac4 Integrate email handlers with DB 2020-11-08 14:39:17 -05:00
Gent 3a55a9b66f Add email structs and functions to DB
Mutex locks included
2020-11-08 14:37:33 -05:00
Gent 36e9370ff4 Add email packet handlers w/ sample data 2020-11-08 14:26:03 -05:00
Gent 3f5a9c8811 Fix buddy list not syncing properly
I couldn't reproduce this on my public server, but the list would show up empty sometimes on initial login on my local server, so I threw it in for good measure.
2020-11-08 13:58:44 -05:00
Gent 30de5c1734 Sanitize buddy chat strings 2020-11-08 13:31:10 -05:00
Gent c7591c6ce2 Implement buddy warp 2020-11-08 12:54:05 -05:00
Gent 7be79010fc Buddy DB integration 2020-11-08 12:42:27 -05:00
Gent 803f1a246a Buddy code cleanup
- Get rid of buddyCnt, self-nullptr checks, and redundant playermap loops in chat handlers
- Add helper function to find available buddy slot
- Reorganize a bit
2020-11-08 00:08:43 -05:00
SengokuNadeko 262dca7dd6 Buddy rework, adjustments, and fixes
I cleaned up the code a bit (I'll clean it up more as I make more progress) and fixed a bug with buddy slots. Now buddies aren't overwritten!
A few reworks and adjustments

I reworked the buddyIDs array to store only player UIDs instead of IDs. I also reworked buddy deleting so that it deletes buddies from the array.
Code cleanup

Cleaned up some of the code. I mainly just removed useless helper methods.
2020-11-07 23:39:41 -05:00
Gent 26460c0167 Add battery caps for combat rewards & commands 2020-11-07 21:51:16 -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
dongresource 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 d21f727e9d Moved Debuff handling to Combat + Bugfixes
* Majority of mob debuff handling is moved to combatStep().
* Drain now kills the mob and does 40% overall damage.
* Bumped up active nano debuff durations, debuffs like drain linger longer but damage less.
* Debuffs are cleared upon mob death and retreating.
* Patched out vehicle off success packet spam
* Boosts and potions now cost the right amount (100 taros) and give the right quantity (100).
* Damage was tweaked slightly. At higher levels you are more likely to fall prey to rand().
* Enemies now use run animations during combat and retreating.
2020-10-31 15:55:44 +00:00
Gent S f3b9ecd791 Add missing sanity checks to quitTask and useItem 2020-10-25 18:33:02 -04:00
Gent S 609d3cdb99 Remove redundant instance deletion 2020-10-25 18:14:35 -04:00
Titan 6d97aaa1d0 Make nano skill change consume FM & power items 2020-10-24 18:31:07 -04:00
Gent 4ab686bc46 Fix abused unordered map 2020-10-24 18:30:02 -04:00
CakeLancelot 2302c28ac5
Merge pull request #141 from CakeLancelot/orm-update
Update sqlite_orm to 1.6
2020-10-24 14:31:57 -05: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
Jade 177c5f0f17
Nano Drain, Debuffs are timed
* Nano drain power works, currently does 30% damage over a period of 3 seconds.
* Stun, Sleep and Snare powers will now run out of time on mobs.
* A few other adjustments to mob mobility.
2020-10-24 14:00:00 -04:00
Jade 2782706355
Group warping & mob movement smoothing
* Warping into IZs and Fusion Lairs now will also take into account your group members.
* MobManager lerp does not confusingly divide speed by 2 anymore.
* Mobs pursue their targets more smoothly, they will avoid phasing into the player during combat.
* Nerfed retreat speed by a factor of 1.5, normal mobs retreated way too quickly however mobs like Don Doom and Bad Max do not retreat fast enough.
* Bugfixed sendPlayerTo, it did not call updatePlayerPosition leaving undesirable anomalies.
2020-10-24 14:00:00 -04:00
CakeLancelot a969988b5c Update sqlite_orm to 1.6 2020-10-24 09:47:46 -05:00
Jade cc06fdcf60 Possibly fixed all chunking desyncs
* Players/NPCs that initialize chunks now correctly pull their main chunk into their viewdata.
* Tested on the public server, seems to have solved the chunking issues.
2020-10-24 03:47:34 +01:00
dongresource 3b5af415fb Fixed the NULL Player* in PlayerManager::players bug. 2020-10-23 05:32:14 +02:00
Gent 2b650b0bed Cleaned up warp code. 2020-10-22 13:14:24 -04:00
CakeLancelot 512647974d Fix Numbuh 3's sneak and revive abilities being swapped
Also fix a small typo
2020-10-21 10:05:48 -05:00
dongresource c9f9b093f4 Bugfixes.
* Add newly created chunks to nearby players and NPCs. This fixes the
slider/static path mob pop-in problem.
* Update a player's chunks when resurrecting. This fixes a mob desync
problem.
* Use a private instance for the Time Lab
* Spawn a slider for every stop
* Fix mobs in private lairs using the template chunk mobs's current
health for their max health
* Don't call into the JSON lib in the loop in aggroCheck(). This is an
optimization found after using gprof.
* Don't print NPC deletions to console. This stops the spam when a
private instance is deleted.
* Changed default view distance to half the length of a map tile, so
chunks are aligned to map tiles
* Update tdata reference
2020-10-21 02:38:30 +02:00
Gent 49d8ed2e36 Slider path, fixes, tweaks 2020-10-20 10:40:50 -04:00
dongresource 10534886b8 Cleanup for 1.2.
Cleaned up whitespace, comments, brace style, etc.
Updated tdata reference.
2020-10-19 20:48:57 +02:00
dongresource e97b58ccaf Fixed private instance memory leaks. 2020-10-19 04:30:12 +02:00
dongresource 55be58cc24 /summonW now supports summoning non-mob NPCs.
/npcr will now rotate gruntwork NPCs in-place instead of making separate
rotation entries that wouldn't have been loaded properly anyway.
2020-10-19 03:45:58 +02:00
JadeShrineMaiden deb3e5b897
Added /minfo and /tasks (#137)
* /minfo returns your current active mission's: id, task id, task type, task objective marker id and enemy ids if applicable.
* /tasks returns all the active mission ids and task ids.
2020-10-18 23:02:51 +02:00