From 51538416e6b7ca2e5ea2254130b2625e2fc42a6a Mon Sep 17 00:00:00 2001 From: Kyle Johnsen Date: Tue, 4 Jan 2022 00:27:56 -0500 Subject: [PATCH] reorganized project a bit, and added short todo in server_basics --- .../Assets/{ => VelGameServer}/NetworkObject.cs | 0 .../{ => VelGameServer}/NetworkObject.cs.meta | 0 .../{ => VelGameServer}/NetworkSyncable.cs | 0 .../{ => VelGameServer}/NetworkSyncable.cs.meta | 0 .../Assets/{ => VelGameServer}/SyncTransform.cs | 0 .../{ => VelGameServer}/SyncTransform.cs.meta | 0 .../TestNetworkedGameObject.prefab | 0 .../TestNetworkedGameObject.prefab.meta | 0 server_basics.txt | 16 +++++++++++++--- 9 files changed, 13 insertions(+), 3 deletions(-) rename TestVelGameServer/Assets/{ => VelGameServer}/NetworkObject.cs (100%) rename TestVelGameServer/Assets/{ => VelGameServer}/NetworkObject.cs.meta (100%) rename TestVelGameServer/Assets/{ => VelGameServer}/NetworkSyncable.cs (100%) rename TestVelGameServer/Assets/{ => VelGameServer}/NetworkSyncable.cs.meta (100%) rename TestVelGameServer/Assets/{ => VelGameServer}/SyncTransform.cs (100%) rename TestVelGameServer/Assets/{ => VelGameServer}/SyncTransform.cs.meta (100%) rename TestVelGameServer/Assets/{ => VelGameServer}/TestNetworkedGameObject.prefab (100%) rename TestVelGameServer/Assets/{ => VelGameServer}/TestNetworkedGameObject.prefab.meta (100%) diff --git a/TestVelGameServer/Assets/NetworkObject.cs b/TestVelGameServer/Assets/VelGameServer/NetworkObject.cs similarity index 100% rename from TestVelGameServer/Assets/NetworkObject.cs rename to TestVelGameServer/Assets/VelGameServer/NetworkObject.cs diff --git a/TestVelGameServer/Assets/NetworkObject.cs.meta b/TestVelGameServer/Assets/VelGameServer/NetworkObject.cs.meta similarity index 100% rename from TestVelGameServer/Assets/NetworkObject.cs.meta rename to TestVelGameServer/Assets/VelGameServer/NetworkObject.cs.meta diff --git a/TestVelGameServer/Assets/NetworkSyncable.cs b/TestVelGameServer/Assets/VelGameServer/NetworkSyncable.cs similarity index 100% rename from TestVelGameServer/Assets/NetworkSyncable.cs rename to TestVelGameServer/Assets/VelGameServer/NetworkSyncable.cs diff --git a/TestVelGameServer/Assets/NetworkSyncable.cs.meta b/TestVelGameServer/Assets/VelGameServer/NetworkSyncable.cs.meta similarity index 100% rename from TestVelGameServer/Assets/NetworkSyncable.cs.meta rename to TestVelGameServer/Assets/VelGameServer/NetworkSyncable.cs.meta diff --git a/TestVelGameServer/Assets/SyncTransform.cs b/TestVelGameServer/Assets/VelGameServer/SyncTransform.cs similarity index 100% rename from TestVelGameServer/Assets/SyncTransform.cs rename to TestVelGameServer/Assets/VelGameServer/SyncTransform.cs diff --git a/TestVelGameServer/Assets/SyncTransform.cs.meta b/TestVelGameServer/Assets/VelGameServer/SyncTransform.cs.meta similarity index 100% rename from TestVelGameServer/Assets/SyncTransform.cs.meta rename to TestVelGameServer/Assets/VelGameServer/SyncTransform.cs.meta diff --git a/TestVelGameServer/Assets/TestNetworkedGameObject.prefab b/TestVelGameServer/Assets/VelGameServer/TestNetworkedGameObject.prefab similarity index 100% rename from TestVelGameServer/Assets/TestNetworkedGameObject.prefab rename to TestVelGameServer/Assets/VelGameServer/TestNetworkedGameObject.prefab diff --git a/TestVelGameServer/Assets/TestNetworkedGameObject.prefab.meta b/TestVelGameServer/Assets/VelGameServer/TestNetworkedGameObject.prefab.meta similarity index 100% rename from TestVelGameServer/Assets/TestNetworkedGameObject.prefab.meta rename to TestVelGameServer/Assets/VelGameServer/TestNetworkedGameObject.prefab.meta diff --git a/server_basics.txt b/server_basics.txt index 106799f..21f1628 100644 --- a/server_basics.txt +++ b/server_basics.txt @@ -25,7 +25,7 @@ Send message - You can say "all", "others", or list specific users that should r 3:1:Message\n - all in room 3:2:Message\n - others in the room, at once, meaning order is maintained 3:3:Message\n - all in room, order maintained -3:4:u1:u2...:uN:Message\n - others +(todo) 3:4:u1:u2...:uN:Message\n - others OUTGOING MESSAGES (send by server) @@ -40,15 +40,25 @@ rooms - a list of rooms on the server, with counts 3:user_id:Message\n - message from sender user_id -4:user_id\n - You are the master client +4:user_id\n - New master client + + Unity-side. Instantiate message creates a network id, assigning that player as owner ---A network id is a simple number + the creator server id, which uniquely identifies it +--A network id is a creator_id + incrementing number, which uniquely identifies it. -1 is used for scene objects. Take ownership reassigns a player as owner. Must use the order_maintained parts above. Update network id sends a packet to specifically serialize parts of an object that have changed. A change flag indicates what parts have changed. +Todo: + +Scene objects that are destroyed need to be buffered to new clients. +No physics yet +Need to address what happens when you join a new room +Documentation + +