[Reference] PostgreSQL + Core Development #59
Open
Conversation
…oards/Notices | Added Board Comments
Added & refactored new commands from Lynx (online, goto, whodrops, heal, summon, dc, notice, noticeb, noticer, say, kill, killmap, healmap, hide, unhide) Added high level functions to CentralServerNode, User, ChannelServerNode Added storage of the full ChannelServerNodes for more appropriate high level functionality. This will make tasks such as warping players or getting all connected users much easier. Replaced all user.write(MessagePacket.system( with user.systemMessage(
Closed
Gotocommand
shop data update
- Fix itemSN duplication for PostgreSQL - Fix money duplication race condition - Fix trading room concurrency issues - Add database sequence error checking - Implement shop transaction rollback
Family
Fix 5 Critical Security Bugs (Money Duplication, Item Loss, Race Conditions)
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is currently READY FOR REFERENCE.
It's not expected for this PR to be merged (given the difference in size), but is kept open to reference changes that may end up going to this repo.
This PR is to add PostgreSQL as an officially supported database.
In addition, it also adds a new command structure.
Generalized Changes:
-> getEnv functions have been updated to also use .env files, and will not raise an exception if there is no .env file.
SRC Changes
utility/kill_ports.batbecause oh help me god if I have to manually kill processes using up the server ports again.Added a way to access the data storages functions from anywhere in the code base (I looked around for a bit, and it seemed weird that there was no way to get users by their ID unless you had access to the central server node, but there was no way to get access to the central server node). This will definitely be needed in the future, so adding it now. When creating advanced commands or events, it'll be very useful.It seems this was already added to an open PR.src/main/java/kinoko/database/types/CharacterRankData)SN Generation:
Any SNs generated when using a relational database expect the default SN of an item to be <= 0 unless it is set by the database itself. There is careful management to make sure this doesn't go out of sync. For this Postgres implementation specifically, any item will be available in item.Items regardless if it is in a player's inventory, trunk, locker, wishlist, gifted, or dropped. This introduces a flaw where cleanup is not appropriately done on item.Items, but can easily be queried. My concern was that if a player has an item dropped, it still does contain that specific SN, and the database has no information on dropped objects. Most likely will have a function that does cleanup on initialization (server launch), when we know there are no dropped items.
Bug Fix:
In Game Checklist:
Account Creation ✅
Character Creation ✅
Cash Shop Gifting ✅
Cash Shop Locker ✅
Storage Trunk ✅
Inventory Management ✅
Personal Player Shops ✅
-> Bundled Item SN carries through the player shop and shows the invetory item quantity in the player shop
-> This needs to be handled similar to player trades with the Item getting a new SN
Player Trades✅
Faming ✅
Quests ✅
-> In Progress Saves ✅
-> Completion Saves ✅
-> Works for the most part? Found a weird glitch at perion 20 stumps training quest that had reset it to 0. ⏳
Dropping and Picking up Batched & Unbatched Items on a diff char (Same ItemSN) ✅
Wild Hunter ✅
Map Transfer ❓idk how to test this, but it'll work.
Buddy List ✅
Guilds ✅
-> Creating Guilds ✅
-> Board Entries ✅
-> Loading Board Comments ✅
-> Saving Board Comments ✅
-> Board Notices ✅
-> Leaving Guild ✅
-> Joining Guild ✅
-> Disbanding Guild ✅
-> Kicking From Guild ✅
-> Editing/Saving Guild Positions/Grades ✅
-> Modifying Player Guild Grades ✅
-> Guild Main Announcement/Notice Message ✅
-> Expanding Guild ✅
-> Register Guild Emblem ✅
-> Delete Guild Emblem ✅
-> Modify Guild Emblem ✅
-> Change Guild Leader (Not possible yet?) ❌
Parties ✅
Guild Online Status ✅
Marriage Rings ✅
Friendship Rings ✅
Ability Point Stats ✅
Skill Saving✅
Available Skill Points ✅
Skill Macros ✅
Pets ✅
Multi-Pets ✅
In Game Commands for each AdminLevel ✅
In Code Checklist:
-> Ensure connections are appropriately closed ✅
-> Ensure transactions are appropriately handled to prevent dupes. ✅
!findto!searchand addedfindas an aliasNote: Family database functions need to be added for Cassandra (but are implemented for Postgresql)
Note: BanInfo needs to be implemented for Cassandra.