Commit Graph

215 Commits

Author SHA1 Message Date
darkredtitan
38d5998a6e Sanity checks for creating and deleting characters.
Co-authored-by: kamilprzyb <kamilprzybspam@wp.pl>
2020-09-14 16:07:02 +02:00
kamilprzyb
c7189a5cef added saving missions 2020-09-14 16:07:02 +02:00
kamilprzyb
de15e2004b added bank functionality, refactored itemMoveHandler
Co-authored-by: Cake Lancelot <CakeLancelot@users.noreply.github.com>
2020-09-14 16:07:02 +02:00
darkredtitan
480cca82fa Make name checking case insensitive.
Co-authored-by: kamilprzyb <kamilprzybspam@wp.pl>
2020-09-14 16:06:57 +02:00
kamilprzyb
3d83f93167 added periodic DB saves, fixed some settings 2020-09-14 01:38:27 +02:00
kamilprzyb
1d9a7139a8 deleteing player deletes inventory and nanos, minor tweaks to settings 2020-09-14 01:38:27 +02:00
kamilprzyb
2fd7a8c6fc Implemented saving inventory and nanos 2020-09-14 01:38:27 +02:00
kamilprzyb
fc57cae37d added saving character when a connection with shard is killed 2020-09-14 01:38:04 +02:00
Gent Semaj
3cfec7aab3
Implement transportation framework + full S.C.A.M.P.E.R. functionality (#86)
* Add transportation registration
* Add S.C.A.M.P.E.R. functionality

Co-authored-by: dongresource <dongresource@protonmail.com>
2020-09-13 22:26:16 +02:00
CakeLancelot
29e53117e7
Merge pull request #72 from FinnHornhoover/msys-mingw-compile-fix
Warnings and compile errors for MSYS2 MinGW64
2020-09-13 07:35:32 -05:00
c1ac2250a0 Minor changes.
This was me fixing a few bugs and finding that Gent was working on some
of the same ones, then awkwardly merging the changes together.
2020-09-12 22:43:04 +02:00
Gent
4880e4af12 Revamp revival code 2020-09-12 14:21:36 -04:00
Gent
2b1a028b3d Validate cookie data 2020-09-12 11:41:31 -04:00
be99714495 Possible fix for the login error bug. 2020-09-12 17:09:11 +02:00
4c06163b51 Properly validate vendor logic.
Also, iTimeLimit should be 0.
2020-09-12 16:10:53 +02:00
Gent
4e7352da66 Add sell functionality to vendors 2020-09-11 22:04:23 -04:00
5747c24479 [bugfix] Don't set iType on empty item slots.
This confuses ItemManager::findFreeSlot().
2020-09-12 02:25:45 +02:00
579aa9d31d Save pointer to Player struct in CNSocket.
This is an insignificant optimization now, but will be necessary when we
start switching around the the algorithms and datastructures used in
proximity detection.
2020-09-12 01:22:58 +02:00
Ariii
3865249387 Vendors, set nano skill command + serverside command issues fixed (#74)
Added basic shopkeeper functions, a player can buy the preset 3 items (cannonbolt set), all shopkeepers have the same items atm (need to check the shopkeeper tabledata), setting itemprice is something I didn't figure out.
Added set nano skill command
Implemented a switch for certain commands like health/taros/fusionmatter etc to be handled on the serverside aswell

Co-authored-by: dongresource <dongresource@protonmail.com>
2020-09-11 23:19:03 +02:00
468840c9ea Fixed gcc vs clang preprocessor tomfoolery. 2020-09-11 00:19:21 +02:00
52f02168bc Implemented quest item cleanup and fixed a few bugs. 2020-09-11 00:19:21 +02:00
ddb5f782b7 Refactored mission data and implemented quest item mob drops.
Most future missions are now playable.
Quest items aren't being properly cleaned up yet.
2020-09-11 00:19:21 +02:00
3665dc2c93 [WIP] Incremental mission save 2
This commit (and the previous one) exist to document the first approach I
took to storing mission data. It's only here for posterity. This comment
was added while rebasing.
2020-09-11 00:19:19 +02:00
ae654f996c [WIP] Incremental mission save 1
This commit (and the next one) exist to document the first approach I
took to storing mission data. It's only here for posterity. This comment
was added while rebasing.
2020-09-11 00:19:16 +02:00
e33b7f20e9 [bugfix] Preserve Taros and FM when opening Crates. 2020-09-11 00:08:26 +02:00
5b49e71de7 Implemented mission rewards.
Might need to refactor item drops, especially after implementing
task-result quest item drops.
2020-09-11 00:08:26 +02:00
3172724596 Implemented the mob kill counter in missions and fixed a bug. 2020-09-11 00:08:26 +02:00
8887c6349b Add support for cookie-based login back in. 2020-09-11 00:08:26 +02:00
JadeShrineMaiden
29cde56fb1 Levelling up added to /nano
- Using /nano levels up Player, a player cannot level down.
2020-09-10 17:51:52 +01:00
eb1ad6bb37 switched to dumped XDT & moved to a submodule 2020-09-09 12:06:22 -05:00
45a33758a5 Account for the size of packet length and ID in validation functions. 2020-09-08 03:06:55 +02:00
FinnHornhoover
266fddbffa fixed warnings and compile errors for msys2 2020-09-08 03:41:13 +03:00
e90ae10746 Summoned NPC are now visible to other players. 2020-09-07 22:12:53 +02:00
df655dfe29 added mobdata to config 2020-09-07 12:54:40 -05:00
c8c4ec7d01 updated readme & small refactor 2020-09-07 12:23:00 -05:00
458843958b
Merge pull request #69 from SengokuNadeko/master
Adjustments made to regex
2020-09-06 14:06:37 -05:00
SengokuNadeko
361c069d0c Adjustments to the regex
I made the regex a bit less restrictive. If you want, you can push this if it seems appropriate.

Username should be at least 4 characters and max 32
Password should be at least 8 characters and max 32

Usernames can be any combination of letters and numbers, with no special characters except for dash and underscore.

Passwords can use any of the alphanumeric/special characters specified in the regex.
2020-09-06 10:49:14 -05:00
SengokuNadeko
3876e0537e Small regex fix
Old regex had some problems (a bit too restrictive). If you want, you can push this to loosen up the restrictions a little.
2020-09-06 10:42:07 -05:00
CakeLancelot
8a481acdae Stub npcBarkHandler for now 2020-09-06 09:59:43 -05:00
darkredtitan
589da3f714 Fix social distancing bug (name trademarked by kamilprzyb) 2020-09-05 19:53:16 +02:00
00c5e07f4f small memory bugs fixed 2020-09-03 15:29:29 -05:00
063d302bd5
Merge pull request #62 from kamilprzyb/master
Rewrote DB and finished LoginServer
2020-09-02 22:49:08 -05:00
7e9793bf90
Merge pull request #59 from JadeShrineMaiden/additions
Colliding NPC IID quickfix
2020-09-02 22:48:09 -05:00
CakeLancelot
fa6b0b178c Remove unnecessary bracket in include statements 2020-09-02 21:25:09 -05:00
CakeLancelot
dadf1c5bcf Change sqlite3.h path in sqlite_orm.h
Should fix Appveyor compilation
2020-09-02 21:11:50 -05:00
kamilprzyb
260759c20b replaced tabs with 4 spaces 2020-09-02 17:53:39 +02:00
kamilprzyb
1ff5694960
Fix APPROVEALLNAMES setting
fixed GetInteger->GetBoolean

Co-authored-by: FinnHornhoover <30576665+FinnHornhoover@users.noreply.github.com>
2020-09-02 17:47:10 +02:00
kamilprzyb
11801c1f89 Rewrote DB to use ORM, added all remaining features to LoginServer and refactored it 2020-09-02 00:37:09 +02:00
4f6c77be4f minor cleanup 2020-08-31 17:54:49 -05:00
d7a41d40ab Replace signal() with sigaction(). 2020-08-31 22:40:33 +02:00
JadeShrineMaiden
1e344c2dd8 Small tweak 2020-08-31 01:36:29 +01:00
JadeShrineMaiden
fdd0160248 Colliding NPC IID quickfix 2020-08-30 23:29:28 +01:00
Eperty123
da293ba9b3 Add DB prefix to db stuff 2020-08-29 13:47:39 +02:00
Eperty123
437063d78a Add experimental TransportManager 2020-08-29 13:43:33 +02:00
Eperty123
b239fb9331 Add NPC barking, seeing saved characters 2020-08-29 13:14:21 +02:00
50431024c9
Merge pull request #55 from dongresource/combat1
Implemented combat, drops, crates and the guide changer
2020-08-28 19:11:56 -05:00
2a258a80f0 Database.cpp refactoring 2020-08-28 19:10:26 -05:00
a067975f27 Players can now see eachother fight monsters. 2020-08-28 22:22:24 +02:00
72a811d6ab Implemented guide changing.
This means the Time Machine works as well.
2020-08-28 22:22:24 +02:00
3b35e0017a Moved all JSON files into a dedicated data directory. 2020-08-28 22:22:24 +02:00
4df812f996 Implemented crates (dropping and opening).
Also fixed a bug in vaildOutVarPacket().
2020-08-28 22:22:24 +02:00
67d899efe6 Implemented proper validation of variable-length packets.
Also changed output buffer in pcAttackNpcs() from dynamically to
statically allocated. This in itself is temporary as I have a better
idea as to how we can allocate buffers with a bit less boilerplate.
2020-08-28 22:18:28 +02:00
64accecc30 Initial implementation of CombatManager.
Overflow detection must still be implemented.
2020-08-28 22:18:28 +02:00
c8c2f4b05f Catch SIGINT with signal(), to allow for gprof instrumentation.
Note: signal() is undefined behaviour in multithreaded programs and is
unportable for handling signals in general. This will need to be
replaced with sigaction() or something.
2020-08-28 22:18:28 +02:00
3c43dd0193 Try to transmit FF packets in one go, instead of sending the id first. 2020-08-28 22:18:28 +02:00
9e9161083d Reword some comments and correct paths in the Readme. 2020-08-28 22:18:28 +02:00
darkredtitan
5cf7225f52
Tried to manually merge kamilprzyb and main repo's code (#45)
* Merge kamilprzyb and main repo's code

* Update Makefile by FunnHornhoover

* Update Makefile by FinnHornhoover

* Add flag to Makefile by FinnHornhoover

* Remove extra line from makefile

* Remove lbcrypt from Makefile

* Fix flag to Makefile by FinnHornhoover

* Reimplement potential fix for tutorial blackscreen by Dongresources

* Update CMakeLists.txt

* Update CMakeLists.txt

* Reinsert Jade's changes

* Cosmetic Changes to Databases .h & .cpp

* Remove CMakeSettings.json

* Update Makefile by Finn Hornhoover

* More cosmetic changes to Databases.cpp

* More cosmetic changes to Databases.cpp

* Remove unnecessary line (CMakeSettings.json)

* Fix CNLoginServer.cpp

* More cosmetic Changes to Database.hpp, edit Database.cpp to use JSON library onstead of json11 library, and delete json11 library files

* Delete json11 library files

* Delete JSON library to reupload

* Reupload JSON library from main repo

* Reupload JSON library from main repo

* Fix syntax error

* Fix Makefile

* Remove commented line of code to be like master

Co-authored-by: CPunch <sethtstubbs@gmail.com>
2020-08-28 13:02:03 -05:00
JadeShrineMaiden
5c8a0069fc
Vehicle and trading bugfixes (#51)
* Sanity checks + Starting level changes

- Item movement handler checks to make sure items aren't moved from equipment slot to equipment slot.
- Item give command checks to make sure an out of bounds item is not spawned (Below iType 0 or above iType 8)
- Players now begin at level 36, consequently the item give command does not level you up now.

* Initial Trade Implementation

* Sanity Check

- Prevents out of bounds item movement by comparing it to AINVEN_COUNT.

* Taros and Trading

* Update ItemManager.cpp

* Update ItemManager.cpp

* working trading system

* Trading system code pointerified

- It works with the recent pointer changes needed.

* Vehicles and Trading bugfixes
2020-08-26 21:35:13 -05:00
64d4b1d26a
Merge pull request #50 from dongresource/bugfix
Fix crash when receiving invalid packets with very low ids.
2020-08-26 15:33:23 -05:00
9b0cb7f441 Fix crash when receiving invalid packets with very low ids.
Also fix benign NPC deallocation bug.
2020-08-26 22:22:52 +02:00
c48db0f9f9 ignore SIGPIPE 2020-08-26 14:38:09 -05:00
6db1a7baf1 removed unnecessary allocation 2020-08-26 14:23:40 -05:00
c9badae526
Merge pull request #46 from dongresource/mobs2
Populated the future with scraped mobs
2020-08-26 12:42:35 -05:00
JadeShrineMaiden
d3ca93a9b8
Trading System (#43)
* Sanity checks + Starting level changes

- Item movement handler checks to make sure items aren't moved from equipment slot to equipment slot.
- Item give command checks to make sure an out of bounds item is not spawned (Below iType 0 or above iType 8)
- Players now begin at level 36, consequently the item give command does not level you up now.

* Initial Trade Implementation

* Taros and Trading

* working trading system

* Trading system code pointerified

- It works with the recent pointer changes needed.
2020-08-26 12:40:10 -05:00
JadeShrineMaiden
6808365d48
Sanity checks fix (#41)
* Sanity checks + Starting level changes

- Item movement handler checks to make sure items aren't moved from equipment slot to equipment slot.
- Item give command checks to make sure an out of bounds item is not spawned (Below iType 0 or above iType 8)
- Players now begin at level 36, consequently the item give command does not level you up now.

* Sanity Check

- Prevents out of bounds item movement by comparing it to AINVEN_COUNT.

* Update ItemManager.cpp

* Update ItemManager.cpp
2020-08-26 12:39:49 -05:00
4178945abe Decoupled player and NPC view distance. 2020-08-26 04:58:17 +02:00
3e5101892b Populated the future with scraped mobs.
This system is temporary; meant to ease testing.
2020-08-26 04:57:59 +02:00
16c11dada0 Fixed a use-after-free and a memory leak. 2020-08-26 00:09:31 +02:00
3b3ddf08ef Fix github issue #38 2020-08-25 20:42:52 +02:00
41898bb6b7 Fix a bug where nanos aren't unsummoned when unequipped.
Thanks fabriXfinn for reporting it.
Also improved sanity checks.
2020-08-25 20:30:20 +02:00
dff710cf61 Enable vehicle spawning. 2020-08-25 19:43:46 +02:00
b79bc56b31 Implement NPC spawning.
Protected by a simplified GM system. Either everyone is a GM (local
servers) or nobody is (public servers).
2020-08-25 04:28:42 +02:00
9aa9b76826 Made the random characters level 36.
They are meant to make testing faster, after all. No point in
restricting them from fully testing items.
2020-08-25 04:17:47 +02:00
113ce0af07 Load the NPC and warp JSON files according to the config file.
NPC data was being read from the config, but ignored.
2020-08-25 03:45:04 +02:00
6f1a72ca0f Shut Computress up.
Setting all bits in the first use flags disables tutorial messages.
2020-08-25 03:42:52 +02:00
d964a83d6d Respawn points work now.
Note that some of them weren't present in clientnpc and will need to be
manually added later.
2020-08-25 03:34:53 +02:00
2f1358c124 Potential solution for the tutorial problem.
Will need to be tested on the public server.
2020-08-25 01:57:53 +02:00
c1b6ae8466 No need to unpack zero-length packet structs.
Also fixed formatting and added subheading to README.md.
2020-08-25 01:08:02 +02:00
14bc368073 Dynamically allocate the Player struct in PlayerView.
This way we're not always passing it around by value.
Note that the Player structs in CNSharedData are still
pass-by-reference. Will probably change this later.
2020-08-25 00:59:55 +02:00
6d3868349d removed debug output in keepAliveTimer 2020-08-24 16:12:49 -05:00
16bca39dae added simple timer system to CNShardServer 2020-08-24 16:11:40 -05:00
Onii-chan
afbf309c7e
Add player revive, vehicle mount/dismount and more (#33) 2020-08-24 16:04:56 -05:00
28ad1a0c25 fix windows support for sockets 2020-08-24 13:23:28 -05:00
JadeShrineMaiden
ff5f3966e3
Sanity checks + Starting level changes (#31)
* Sanity checks + Starting level changes

- Item movement handler checks to make sure items aren't moved from equipment slot to equipment slot.
- Item give command checks to make sure an out of bounds item is not spawned (Below iType 0 or above iType 8)
- Players now begin at level 36, consequently the item give command does not level you up now.

* Sanity Check

- Prevents out of bounds item movement by comparing it to AINVEN_COUNT.
2020-08-24 03:07:51 -05:00
55add82843
Merge pull request #32 from dongresource/work
-Wall, #pragma once, nanoSummonHandler() cleanup, verbosity levels
2020-08-23 16:57:58 -05:00
e99feb03d5 Add verbosity levels. 2020-08-23 23:09:31 +02:00
8105d0aa88 properly handle socket errors in recieving packets 2020-08-23 15:09:51 -05:00
756074cc62 Remove redundant initialization in nanoSummonHandler(). 2020-08-23 19:46:51 +02:00
51a8cc8bdf Silence -Wall warnings. 2020-08-23 19:19:12 +02:00
651ccba932 Replace ifdef guards with #pragma once
tl;dr this has potentially significant compilation speed benefits.
2020-08-23 19:14:54 +02:00