1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-04-26 16:37:46 +00:00
Commit graph

46 commits

Author SHA1 Message Date
96bcdf1238 Fix various Clippy warnings 2025-04-11 08:32:55 -04:00
df1d0b2629 Remove disconnected clients from the client list 2025-04-01 22:24:58 -04:00
216778ea8b Add more inventory management
Instead of one single slot available in your inventory, all four pages
should be available now. Moving items around should be less buggy, and
it's now possible to discard items.

Items cannot stack still, and when given will always take up the next
free slot.
2025-04-01 21:37:41 -04:00
6d1e9d4e73 Add //gm lv command to set your current level 2025-04-01 20:39:57 -04:00
f1b674320e Send existing actors to any newly connecting client 2025-04-01 20:23:23 -04:00
268c157180 Send actual player data to other clients
Instead of a placeholder actor, you can now see the other player's
correct appearance.
2025-04-01 19:23:12 -04:00
4f8f0d1fe2 Add !spawnclone command, rename !spawnactor
Curiously the spawned clone shows up as a player, despite not using the
NPCSpawn packet. This might be a suitable workaround for the
PlayerSpawn packet being buggy from our side.
2025-04-01 19:15:08 -04:00
b1653f0808 Commit and restore inventory from the World databse 2025-04-01 18:49:42 -04:00
fed21b3617 Make various packet dumping optional, turned off by default
This creates a lot of clutter, and only really interesting to
developers.
2025-04-01 16:58:39 -04:00
822d1f5139 Add GM command to give items, support equipping from inventory
Now with this command and support for *one* inventory slot, you can
now freely equip items to your character for testing.
2025-03-31 23:23:29 -04:00
0c76d847d5 Allow unequipping items, add packet for updating equipped model ids
The unequipped item currently disappears into the aether, but this
works now!
2025-03-31 21:49:12 -04:00
eae962cc85 Multiple fixes attempting to fix packet errors
It doesn't unfortunately, there's still a bunch of errors when decoding
packets. These are all decent fixes though.
2025-03-30 21:42:46 -04:00
caf70ea469 Pass GameData into Zone, stop loading the same zone twice on login 2025-03-30 19:13:24 -04:00
e4870762eb Fix various Clippy warnings 2025-03-30 18:03:42 -04:00
ae1ca2f92d Replicate actor spawning and movement to other clients
This now works and Kawari has achieved basic multiplayer! This is of course with
a hundred caveats:
* Previously spawned players are not backfilled
* There is no range or zone detection
* They are carbuncle clones of you, not the other character's data

But it actually WORKS!
2025-03-30 18:03:42 -04:00
9cb7cd9abd Add initial stuffs for actor replication 2025-03-30 18:03:42 -04:00
ae2a75e1af Initial support for multiplayer
This is quite the architecture change, and I started working on the
first Tokio actor tutorial I could find. This actually works though,
and you can now chat between two characters on the server.

The next steps are to clean up my mess, and send actors over the wire.
2025-03-30 18:03:42 -04:00
7efbc5fd02 Move StatusEffects struct to it's own module 2025-03-30 10:51:36 -04:00
fe318cbc65 Move some more connection tasks into ZoneConnection
Notably part of the initialization and actor control self calls.
2025-03-30 10:49:33 -04:00
88c7d2ee77 Fix sending status effects setting the player HP/MP to 0
For some reason we send some of the player's stats in this packet, and
we can't keep them as 0 because the client will just kill the player.
2025-03-29 14:52:27 -04:00
1ef4078ec1 Fixes and workarounds for battling 2025-03-29 14:38:40 -04:00
d54b4c945e Start informing the player of the consequences of their actions
This doesn't work 100% reliably yet, but I do see the action appear in
my battle log.
2025-03-29 14:15:01 -04:00
ff3313a0f9 Add UpdateHpMpTp packet, make sprint take away debug monster health
This is just for debugging, I want to make attack actions do this
instead.
2025-03-29 12:25:22 -04:00
5b7e07642a Commit dynamic character values back to the database
This now saves the current zone id, position and the rotation of your
character to the database when you log out. This isn't restored yet
though.
2025-03-29 00:15:29 -04:00
65747b0632 Add scripting function to change a player's territory 2025-03-28 23:43:27 -04:00
c4b9ad060b Add basic Event scripting capaibilities
This implements the first event script, going from the first Ul'dah opening
cutscene to the next.
2025-03-28 23:00:32 -04:00
cb740a2a93 Move LuaPlayer to it's own module 2025-03-28 23:00:32 -04:00
bbbe426617 Improve how the status effect list is sent and created
There is now a dedicated StatusEffects struct that provides a nicer API
to work with these. The list is also sent when needed and only when a
status effect changes, as the client handles the ticking down of
durations itself.
2025-03-28 23:00:32 -04:00
c5e04ba33f Begin wiring status effect Lua API 2025-03-28 23:00:32 -04:00
652beadaa4 Send the welcome server message in the onBeginLogin Lua function
I finally got a proof-of-concept working, and am somewhat happy with how I can
start building this API now.
2025-03-28 23:00:32 -04:00
a99b0e7c17 Pass PlayerData to onBeginLogin function 2025-03-28 23:00:32 -04:00
4142143bc8 Move Zone IPC over to the new JSON opcodes file 2025-03-26 19:23:14 -04:00
c29f8ad7df Run Clippy auto-fix, disable large enum size warning 2025-03-23 18:14:14 -04:00
8a03c82480 Create Inventory struct, move inventory filling logic to ZoneConnection
This still uses hardcoded item ids, but this should much more extensible.
2025-03-23 17:43:06 -04:00
9111ef6a82 Add debug command to spawn a monster (Tiny Mandragora), various fixes
This fixes various problems in CommonSpawn, adds a test for an enemy NPC spawn,
and an unkwon packet I get when entering some zones.
2025-03-23 10:33:49 -04:00
1acf73c484 Move Position struct to common module 2025-03-22 22:01:32 -04:00
4b740068d4 Remove hardcoded initial zone, derive it from selected City-State
This currently might spawn you in the ground in Ul'dah and probably Limsa too,
until I determine the correct spawn location.
2025-03-22 18:53:53 -04:00
0900d0b94e Implement basic character persistence, World <-> Lobby server communication
This is unfortunately lumped into one big commit, and is very hacky and WIP but
does indeed work! Since the Lobby and World server are two separate servers, it
uses it's own custom IPC packets (reusing the same packet structures as regular
game ones.)

The characters you create in the Lobby server are now saved in the World server,
but this is not yet reflected in the Lobby screen.
2025-03-21 19:56:16 -04:00
788cbf114a Add support for the GM command to change the weather
You can now change the weather with `//gm weather <id>`.
2025-03-18 23:48:00 -04:00
1f2283af14 Specify a connection type when sending packets 2025-03-18 20:33:12 -04:00
ee1b79ee56 Document what LobbyConnection and ZoneConnection is 2025-03-17 17:03:10 -04:00
f5d75301b2 Re-organize the IPC structures so they live in their own server-specific module
My old setup of throwing *all* of the IPC types and opcodes into *one* enum was
becoming unbearable. Now that we have multiple things using the same opcodes
(because they can overlap) I think it's time to repay this technical debt.

This overhauls the structure of the project to move IPC structs into their own
modules, and separate the opcode data/lists into separate ones depending on if
it's clientbound and serverbound.

Nothing has changed functionall, but this is going to make it way easier to add
more IPC in the future.
2025-03-16 17:43:29 -04:00
3bbf345cd6 Run Clippy auto-fix 2025-03-16 14:09:12 -04:00
51f6ad6744 Grab bag of various fixes
I have unsuccessfully tried to spawn another actor, the game recieves it (and
adds it to the object table) but they are marked invisible. Besises, this also
contains various field improvements and initial support for social lists.
2025-03-16 14:07:56 -04:00
3aaa8ae3eb Move zone changing into ZoneConnection's purview
I suspect that we have to rigidly control the fade in/out or whatever
PrepareZoning is, and it's just a good idea in general.
2025-03-15 20:49:07 -04:00
f372f3173d Create dedicated Connection implementations to handle future server work
The current situation of throw-every-piece-of-logic-into-one-file for each
server isn't working out. So now there is a new ZoneConnection/LobbyConnection
struct that will be delegating tasks to their own Handlers (for example, there
could be a ChatHandler.)

I'm not sure how well this architecture will scale, but it's better than what
we have right now.
2025-03-15 20:38:10 -04:00