Commit Graph

66 Commits

Author SHA1 Message Date
Kamil
140227406c implemented custom error messages in login screen for regex fail or banned account 2020-12-19 19:15:14 -05:00
Kamil
05f4746af4 "Created" meta column + cleanup 2020-12-13 19:51:09 -05:00
Kamil
a12faac0e2 Account level changes
tied account levels to accounts instead of players. implemented account banning logic in db
2020-12-13 19:51:09 -05:00
Kamil
960f2dd10c Adjust login server logic to new DB 2020-12-13 19:51:09 -05:00
Kamil
2bad1252d3 Small DB fixes 2020-12-13 19:51:09 -05:00
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
Titan
7c5d7a70cc Fix enter key sending '\n' in passwords 2020-12-01 14:29:21 -05:00
Gent S
71d1212877 Fix All Characters always failing validation 2020-11-26 11:04:56 -05:00
CakeLancelot
a9a8d96321
Fix Female Characters always failing validation 2020-11-25 20:37:24 -06: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
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
10534886b8 Cleanup for 1.2.
Cleaned up whitespace, comments, brace style, etc.
Updated tdata reference.
2020-10-19 20:48:57 +02:00
bae834fefa The login server now sends live checks.
This should stop server providers from kicking tutorial players as
inactive TCP connections. The interval is generous for that reason.

Also snuck in a change that makes mobs retreat all the way to their
spawn points, to aid during mob gruntwork with /toggleai.
2020-10-08 01:21:48 +02:00
661070dc3a Cleaned up whitespace.
Incantation: sed -i 's/[ \t]*$//g' src/*.[ch]pp

Also switched BuddyManager from tabs to spaces using vim's :retab command.
2020-10-05 02:03:13 +02:00
755bb75306 U8toU16 now respects buffer sizes 2020-10-04 12:50:58 -05:00
062302a7aa fixed potential threading/socket issue 2020-09-27 00:12:26 -05:00
b67a0b6946 removed usewebapi 2020-09-21 14:49:08 -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
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
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
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
darkredtitan
38d5998a6e Sanity checks for creating and deleting characters.
Co-authored-by: kamilprzyb <kamilprzybspam@wp.pl>
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
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
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
5747c24479 [bugfix] Don't set iType on empty item slots.
This confuses ItemManager::findFreeSlot().
2020-09-12 02:25:45 +02:00
8887c6349b Add support for cookie-based login back in. 2020-09-11 00:08:26 +02:00
c8c4ec7d01 updated readme & small refactor 2020-09-07 12:23:00 -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
fa6b0b178c Remove unnecessary bracket in include statements 2020-09-02 21:25:09 -05: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
Eperty123
b239fb9331 Add NPC barking, seeing saved characters 2020-08-29 13:14:21 +02:00
2a258a80f0 Database.cpp refactoring 2020-08-28 19:10:26 -05: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
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