Commit Graph

52 Commits

Author SHA1 Message Date
CPunch 4cc1cf4f7e minor chunk refactor 2020-09-21 14:55:34 -05:00
kamilprzyb 5e0948ea93
Database saving update (#104)
* implemented saving BatteryN and BatteryW

* implemented saving mentor

* moved int64->blob parsing to a separate function

* moved parsing blob->int64 to a separate function

* added functions for parsing int32->blob and vice versa

* added functions for parsing int16->blob and vice versa

* WIP saving quest items and active tasks

* Quest items are stored in inventory table instead of blob

* added sanity check for missionId

* saving active missions works

* removed unneccesary include

* implemented saving warplocationflag, skywaylocationflag and currentmissionid in database

* INFO DB message now shows how many accounts and player characters are in the database

* fixed dbsaveinterval being in [login] instead of [shard]

* fixed mission quit:
- fixed wrong json name, causing qitems not deleting properly
- quitting mission now resets npc kill count

* adjusted saving active missions

* removed blob parsing functions that ended up being unused

* removed accidentaly added include

* removed sending PCStyle2 on Player Enter

* added a sanity check in itemMoveHandler

* removed MapNum from PCLoad, as client doesn't even read it

* set BuddyWarpCooldown to 60s on PCLoad

* fixed a bug causing EXIT DUPLICATE not working

* added creation and last login timestamps to accounts and players

* added a sanity check for P_CL2LS_REQ_PC_EXIT_DUPLICATE

* implemented web api support, toggled by new setting (off by default)

* add usewebapi to config

Co-authored-by: Gent <gentsemaj@live.com>
2020-09-21 14:43:53 -05:00
dongresource 321dca3f79 Use PC_MAXHEALTH() in the rest of the codebase.
+ minor fixups
2020-09-21 19:51:30 +02:00
Gent 5dbca0b7b1 Fix fusion matter amount not displaying on enter 2020-09-18 23:26:20 -04:00
CPunch 9f78735caa fixed socket reference bug 2020-09-17 22:44:37 -05:00
CPunch 31ef03610d temp fix and small refactor 2020-09-17 21:41:09 -05:00
CPunch 22e3e9e4de fixed 'player clone' bug 2020-09-17 18:03:23 -05:00
CPunch f4db0830ba huge refactoring, chunking added 2020-09-17 17:45:43 -05:00
dongresource 001564a257 Hotfix to stop crashing the server.
This will need to be fixed properly; probably while we implement
chunking.
2020-09-17 21:22:31 +02:00
dongresource 9cc5f3e4d5 Cleaned up comment formatting.
The incantation was: sed -i 's://\([^ ]\):// \1:' src/*.[ch]pp

Lines of code that was commented out were then manually reverted.
2020-09-14 16:07:05 +02:00
dongresource 131997f34f Cleaned up all whitespace issues.
The incantation was: sed -i 's/[ \t]*$//g' src/*.[ch]pp
2020-09-14 16:07:05 +02:00
dongresource ed86bc9160 Assorted cleanups and fixes.
* Clean up spacing/indentation
* Proper enum formatting
* Fix nano dismissal (for real this time)
* Do not copy Player struct when a pointer is right there
* Stop looking after the trade partner has been found
* Make sure we're shifting unsigned values (and 64-bit when they need to be)
* Look for JSONs in tdata/
* Add a dbsaveinterval to the example config.ini, in the login category
2020-09-14 16:07:05 +02:00
kamilprzyb c7189a5cef added saving missions 2020-09-14 16:07:02 +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
dongresource 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
dongresource 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
dongresource 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
kamilprzyb 11801c1f89 Rewrote DB to use ORM, added all remaining features to LoginServer and refactored it 2020-09-02 00:37:09 +02:00
Eperty123 b239fb9331 Add NPC barking, seeing saved characters 2020-08-29 13:14:21 +02:00
dongresource 72a811d6ab Implemented guide changing.
This means the Time Machine works as well.
2020-08-28 22:22:24 +02: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
CPunch 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
dongresource 4178945abe Decoupled player and NPC view distance. 2020-08-26 04:58:17 +02:00
dongresource 3e5101892b Populated the future with scraped mobs.
This system is temporary; meant to ease testing.
2020-08-26 04:57:59 +02:00
dongresource 16c11dada0 Fixed a use-after-free and a memory leak. 2020-08-26 00:09:31 +02:00
dongresource 3b3ddf08ef Fix github issue #38 2020-08-25 20:42:52 +02:00
dongresource 6f1a72ca0f Shut Computress up.
Setting all bits in the first use flags disables tutorial messages.
2020-08-25 03:42:52 +02:00
dongresource 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
dongresource 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
dongresource 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
Onii-chan afbf309c7e
Add player revive, vehicle mount/dismount and more (#33) 2020-08-24 16:04:56 -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
CPunch 0d27412d81 added getNearbyPlayers 2020-08-23 10:42:37 -05:00
dongresource 6129c0b4e2
Players can now see eachother's nanos. (#28) 2020-08-22 19:52:54 -05:00
CPunch 88953541ef added INITSTRUCT to zero-out data 2020-08-22 19:26:18 -05:00
CPunch 94b0dc724e major refactoring 2020-08-22 18:31:09 -05:00
CPunch cd9fb6ec25 added sanity check to exitGame() 2020-08-22 13:08:37 -05:00
Onii-chan 56bf0db20d
Added more nano features (commands, equip & unequip, powers) (#26)
* Revert "fixed window build"

This reverts commit b94f602537.

* Revert "Revert "fixed window build""

This reverts commit dac4457ed2.

* Add nano power feature

* Update CNShardServer.hpp

* Update CNShardServer.hpp

* Test: Add nano power feature

Nano powers are set to the first power in its selection by default.

* Update NanoManager.cpp

* Test: More nano features

* Update NanoManager.hpp

* Update PlayerManager.hpp

* Update PlayerManager.cpp

* Updated indentations

* Update PlayerManager.cpp

* Add DEBUGLOG()

Co-authored-by: CPunch <sethtstubbs@gmail.com>
2020-08-22 13:02:08 -05:00
Raymonf 88d08ffca7
Fix MSVC compilation by not using non-standard struct initialization (#20)
Co-authored-by: Raymonf <Raymonf@users.noreply.github.com>
2020-08-21 14:17:06 -04:00
dongresource df18f3ccd1
PROTOCOL_VERSION, test items, MOTD fix (#18)
* Cleaned up protocol selection.

* cmake now works even if protocol option is omitted
* make now supports protocol selection
* removed PACKET_VERSION/CNPROTO_VERSION* redundancy
* ubuntu appveyor script has yet to be written
* cleaned up some trailing spaces

* Add some test items.

Ironically, this change is untested.

* [bugfix] Transmit MOTD when entering the game, not when loading screen fades.

This fixes unnecessary retransmission when /warping.
2020-08-21 12:38:45 -05:00
CPunch 1425074ccb edited config.ini default back, better plr pos 2020-08-20 16:59:32 -05:00
CPunch 6857f50c30 added basic NPCManager 2020-08-20 16:43:48 -05:00
CPunch b43628a19d faster player distance check 2020-08-20 13:19:03 -05:00
CakeLancelot 14d556976d Add zipline, slide, cannon, and jump pad packets
Cannon still looks wonky from other player's PoV, something's up with the rotation - will investigate later.
2020-08-20 11:26:26 -05:00
CPunch f2059c9ce1 merged motd and exit patch by dongresource 2020-08-19 12:22:54 -05:00
CPunch 24d30a05bf added heartbeat support 2020-08-18 20:34:39 -05:00