Commit Graph

55 Commits

Author SHA1 Message Date
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
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
2f1358c124 Potential solution for the tutorial problem.
Will need to be tested on the public server.
2020-08-25 01:57:53 +02: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
e99feb03d5 Add verbosity levels. 2020-08-23 23:09:31 +02:00
51a8cc8bdf Silence -Wall warnings. 2020-08-23 19:19:12 +02:00
88953541ef added INITSTRUCT to zero-out data 2020-08-22 19:26:18 -05:00
94b0dc724e major refactoring 2020-08-22 18:31:09 -05:00
35c622d8a2 Add support for verbose logging. 2020-08-22 19:39:13 +02:00
43f2def80b Report unhandled packets in string form. 2020-08-22 19:19:46 +02:00
JadeShrineMaiden
ab6df26f92
Disabled GM mode (#22)
Temporarily disabled, players can now use item commands without GM mode.
2020-08-21 19:38:10 -05:00