1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 19:57:46 +00:00
Commit graph

210 commits

Author SHA1 Message Date
2762407585 Rename EventReturnHandler to EventYieldHandler, make generic
This also makes EventScene generic for use in the future.
2025-06-28 15:57:45 -04:00
670d25a980 Disable sending exp again 2025-06-28 15:27:53 -04:00
fd4436db01 Fix a few more fields in PlayerStatus
Class is determined correctly now, and we now set the expansion
level too.
2025-06-28 15:23:56 -04:00
ff3a7d6835 Remove more leftover debugging code 2025-06-28 15:10:57 -04:00
f46b62ad9e Store classjob EXP
This isn't sent in the PlayerStatus packet *yet*, only on
UpdateClassInfo. For some reason, passing it makes the client freak
out and I'm not sure why yet.
2025-06-28 14:57:21 -04:00
9a3652fb42 When equipping items, network that to other players
See #50
2025-06-28 11:13:11 -04:00
dfac7702fa Expose a zone's intended use ID in the Lua API 2025-06-28 10:27:56 -04:00
e6536da9dd Split up the command arguments on the Rust side
This removes some boilerplate code we need in every command to do
this ourselves.

See #65
2025-06-28 10:27:56 -04:00
ed1263d587 Pass all four arguments to GM command scripts
No GM command we have implemented currently uses these, but just
a little bit of future-proofing.
2025-06-28 10:27:56 -04:00
6951f9448d Port GM commands to Lua
This removes a ton of implementation overlap between the two
command systems. For example, we had two different implementations
of unlocking aetherytes which is just unnecessary.

On the flipside, this makes implementing new GM commands just as
easy as writing debug ones. I moved the existing debug Lua
implementations into their GM counterparts and updated the USAGE
accordingly.
2025-06-28 10:27:56 -04:00
6ecdae840c Continue parsing when encountering unknown packets
This reads the unknown packet data, just throwing it in a byte
buffer. This allows us to read the rest of the segmenets in
the packet, and fixes parsing.

Note that this still log spams with "wrong size" as we can't
determine the size of the unknown packet ahead of time. This is
easy to fix, but it's not a high priority yet.

Fixes #73
2025-06-28 08:48:59 -04:00
db2ee114a9 Fix the size of the aetheryte unlock bitmask
This should really be calculated instead of guessed, because I already
made a mistake. I didn't do that, only added a TODO for it.

Fixes #74
2025-06-28 08:22:01 -04:00
d3647a4b3b Fix unlocking all aetherytes
I also made it possible to toggle them off properly, that should be
saved now too.
2025-06-28 00:07:56 -04:00
5272439bca Store aetherytes in the database
This requires yet another database wipe, but this is worth it as you no
longer have to aetheryte unlock spam on login.
2025-06-27 23:28:56 -04:00
0b470dc28b Make unlocks persistent, fix player name in chat
The PlayerStatus struct shifted around recently, so I fixed the offsets
yet again. Unlocks should be persistent now, but this as usual requires
a database wipe, sorry!

I also included some refactors of the !unlock debug command that still
had references to the old unlock_action API.
2025-06-27 23:28:56 -04:00
05f909497c More unknown IPC handling fixes 2025-06-26 21:06:54 -04:00
4f364ae330 Don't make packet parsing async
This doesn't need to be marked as async, the code isn't.
2025-06-26 19:09:13 -04:00
The Dax
94e13fa281 Remove commented testing log output 2025-06-26 07:47:05 -04:00
The Dax
385672d797 Add support on the Rust side for resetting the command identifier.
-sender was also renamed to command_sender in case we'd like to reserve the word "sender" in the future.
2025-06-26 07:47:05 -04:00
d292e1d676 Fix signedness of scene yield params
According to the decompiled Lua code, they sometimes can return
negative numbers (like -1, to indicate an error.) I also improved
the debug display of these in the server log a bit.
2025-06-25 23:28:12 -04:00
96aece36cf Implement more back and forth packets for events
I figured out a few of these while figuring out the crystal bell
event, although their purpose is still generally unknown. It doesn't
really affect anything functionally as the event still works as
well as it did before.

I also fixed the crystal bell scenes so they don't finish the event
prematurely, although it looks weird without the hairstyle menu. But
that still isn't figured out yet.
2025-06-25 23:11:49 -04:00
58e4e89765 Support toggling displaying your weapon and other flags
This is now networked and shown both to you and other players. This
still needs to be persisted for other player spawns.
2025-06-25 21:30:14 -04:00
thedax
6d99bef66c
Refactor and reorganize numerous Lua systems: (#63)
-Global.lua is no longer a catch-all dumping ground for registering actions and events
Instead, Global.lua will actually contain useful global constants and functions

-Init.lua will take over the role of being the initial script run when doing reloads or booting the servers
-Actions.lua will take over registering all actions
-Items.lua will take over registering all items
-Commands.lua will take over registering all text commands

-Events.lua will take over registering all warps, openings/quests, aetherytes, etc.
To this end, event ids now live in organized tables to reduce error-prone copy paste clutter

If we get enough actions, items or commands, we can move those to tables too.
2025-06-25 13:25:48 -04:00
01697c8f62 Begin implementing currency, add //gm gil command and more
This doesn't work yet though , and I'm not sure why. I also fixed a bug
where new characters doesn't get their inventories initialized properly.
2025-06-24 19:16:32 -04:00
cc5d9ae7bc Return both parameters in EventHandlerReturn
This allows scripting things like Aetherytes in the future.
2025-06-24 18:30:22 -04:00
thedax
82e5021979
Implement the //gm teri_info command, and fix a typo (#56)
Implement the `//gm teri_info` command, and fix a typo. Said typo was in gamedata.rs, confusing the FingerL column for the SoulCrystal column.
2025-06-23 13:39:37 -04:00
77b6fbad7f Fix the "unknown command" message for real, now
Now it takes into account if the command exists on the Rust side,
and the message should now *only* display if no one truly handles
this command.
2025-06-22 09:28:50 -04:00
fbe6862c7b Begin implementing EXP
This doesn't actually do things like level you up, but if you use the
GM EXP command then it will update the UI.
2025-06-22 09:19:06 -04:00
d35e0830d3 Don't panic when the event file doesn't exist 2025-06-22 09:05:54 -04:00
thedax
e1b261c7d8
Implement several actors/entities (#49)
* Implement the following actors/entities:
-Inn Toy Chest actor, which simply says you haven't unlocked mini-games
-Inn Glamour Dresser actor, which simply says you haven't unlocked the GD yet
-Orchestrion, which is fully functional as long as you have songs unlocked

Accompanying the orchestrion is the GM orchestrion command, with a caveat:
-It allows you to learn one song at a time, but id 0 (aka "all) doesn't learn a single
song for some unknown reason, so I've disabled it for now.

* Run cargo fmt

* Update USAGE.md
How many times will I forget...
2025-06-22 08:46:11 -04:00
a6e270d5e3 Log, don't panic for syntax errors in event scripting
Fixes #39
2025-06-22 08:35:25 -04:00
6b0487f30f Log, don't panic for Lua commands
It will also try to fallback to a Rust command - if available.

See #39
2025-06-22 08:35:25 -04:00
cdcce88c5f Log, don't panic for syntax errors in Global.lua
See #39
2025-06-22 08:35:25 -04:00
thedax
92a5cc48eb
Apply a temporary-ish fix so that not all chat messages appear as unknown commands. (#46) 2025-06-21 21:16:31 -04:00
bdd98820e7 Stop panicking when receiving None segments from the client
This apparently happens when you send chat messages super quick, and
they seem harmless to ignore.

Fixes #40
2025-06-21 14:04:09 -04:00
6561e63fd4 Send a message in-game when trying to start a non-scripted event
This should make it more obvious than in the usually spammy server log.
2025-06-21 12:26:58 -04:00
bb2cc9e0ec Log in-game and in the server when encountering an unknown command
Instead of printing nothing and you're just left scratching your head.
2025-06-21 12:23:25 -04:00
f07d16b949 Allow reloading Global.lua with the new !reload debug command
Scripts are normally loaded when they are needed, with the exception of
Global.lua that's only loaded once at start-up. But now you can reload
it in-game with the !reload command, which should make event and command
scripting way less of a hassle.
2025-06-21 12:16:27 -04:00
d821c838cb Send your character's actual levels during setup
This fixes their display in the Character window. Sometimes the display
is a bit bugged, but there's not much I can do about that right now.
2025-06-21 11:50:09 -04:00
39beefbef3 Send action requests to global server state
This is to lay the groundwork for keeping track of cast spell timings,
and eventually networking actions to other players.

See #36
2025-06-21 10:36:44 -04:00
2a1491c8f9 Make the current classjob persistent, and your levels too
This requires another database wipe, or if you're savvy enough a few
schema edits.
2025-06-20 19:08:53 -04:00
The Dax
a24e0a5658 Overhaul the Lua permissions:
-Renamed permissions to required_rank
-Don't panic when the script author omits required_rank
-Reset state in the global table after reading it, so scripts can refresh it each time
2025-06-20 14:02:46 -04:00
The Dax
579bef8cd6 Adjust logging slightly 2025-06-20 14:02:46 -04:00
The Dax
be20b0f604 Add a basic permission system to Lua scripts to bring them in line with ingame GM commands. 2025-06-20 14:02:46 -04:00
355572d97a Remove some unknown packet spam
The "Received UnkXX" log messages are completely useless, let's get rid
of them.
2025-06-19 16:01:31 -04:00
The Dax
ae96de1ee6 Stop the world server from becoming upset when a Lua command is invoked with no arguments.
Allows commands that have a default set of arg(s) to use those when none are specified, as well as
allowing commands to act as toggles (such as a wireframe toggle, or disabling any set festivals).
2025-06-19 15:27:01 -04:00
The Dax
1edcdf3de6 Implement GM speed command, and make GM invis command actually toggle invis status 2025-06-19 10:09:07 -04:00
d216bebce9 Remove !playscene debug command
This doesn't really scale right now with the new events system, and I
don't use it anymore so let's remove it for now.
2025-06-18 20:53:07 -04:00
eb6b6409da Generate new actor IDs for debug NPCs, unify actor network paths
I don't know why I created a new message kind just for spawning NPCs
when ActorSpawn does this just fine. But what this actually means is
that the debug NPCs can now be spawned more than once.
2025-06-18 20:49:05 -04:00
3757f4e0db Make !spawnmonster put the NPC at your location again
Also included some refactoring that will help networking these better.
2025-06-18 20:28:03 -04:00