Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename PunPun to Log and refactor SaveSystem & TileSystem #1229

Merged
merged 10 commits into from
Sep 29, 2023

Conversation

joaoburatto
Copy link
Contributor

Summary

This PR refactors the SaveSystem and TileSystem to be more error-safe with logs to what is going on. This aims to enable future work on Tilemaps. Also renames the Punpun class to Log to be clearer. Changes where the tile stuff is saved to ensure consistency.

Nothing changed runtime, but the code behind it has. You can test this by seeing if the tile system is loading and saving correctly after the adjustments.

@cosmiccoincidence
Copy link
Member

@joaoburatto this pr needs some conflicts resolved.

@joaoburatto joaoburatto force-pushed the feature/add-tilemaps-content branch 2 times, most recently from ce1d75a to e09fc13 Compare September 3, 2023 00:20
@stilnat
Copy link
Contributor

stilnat commented Sep 4, 2023

@joaoburatto some tests are failing

@singulocity
Copy link
Contributor

I clicked on Boot up in the top left. Started the game, hit ready, started the round, and I am presented with no tiles. It looks like they failed to load.

I have two errors and three potentially relevant warnings.

The referenced script (Unknown) on this Behaviour is missing!

The referenced script on this Behaviour (Game Object '<null>') is missing!

DirectoryNotFoundException: Could not find a part of the path 'C:\Users\jblac\Documents\Github\SS3D\Builds\Game\Data\Tilemaps'.
System.IO.Enumeration.FileSystemEnumerator`1[TResult].CreateDirectoryHandle (System.String path, System.Boolean ignoreNotFound) (at <d6232873609549b8a045fa15811a5bd3>:0)
System.IO.Enumeration.FileSystemEnumerator`1[TResult]..ctor (System.String directory, System.IO.EnumerationOptions options) (at <d6232873609549b8a045fa15811a5bd3>:0)
System.IO.Enumeration.FileSystemEnumerable`1+DelegateEnumerator[TResult]..ctor (System.IO.Enumeration.FileSystemEnumerable`1[TResult] enumerable) (at <d6232873609549b8a045fa15811a5bd3>:0)
System.IO.Enumeration.FileSystemEnumerable`1[TResult]..ctor (System.String directory, System.IO.Enumeration.FileSystemEnumerable`1+FindTransform[TResult] transform, System.IO.EnumerationOptions options) (at <d6232873609549b8a045fa15811a5bd3>:0)
System.IO.Enumeration.FileSystemEnumerableFactory.FileInfos (System.String directory, System.String expression, System.IO.EnumerationOptions options) (at <d6232873609549b8a045fa15811a5bd3>:0)
System.IO.DirectoryInfo.InternalEnumerateInfos (System.String path, System.String searchPattern, System.IO.SearchTarget searchTarget, System.IO.EnumerationOptions options) (at <d6232873609549b8a045fa15811a5bd3>:0)
System.IO.DirectoryInfo.GetFiles (System.String searchPattern, System.IO.EnumerationOptions enumerationOptions) (at <d6232873609549b8a045fa15811a5bd3>:0)
System.IO.DirectoryInfo.GetFiles (System.String searchPattern) (at <d6232873609549b8a045fa15811a5bd3>:0)
(wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFiles(string)
SS3D.Data.Management.SaveSystem.TryLoadMostRecentFile (System.String path, System.String& file) (at Assets/Scripts/SS3D/Data/Management/SaveSystem.cs:92)
SS3D.Data.Management.SaveSystem.LoadMostRecentObject[TSaveObject] (System.String path) (at Assets/Scripts/SS3D/Data/Management/SaveSystem.cs:147)
SS3D.Systems.Tile.TileSystem.Load () (at Assets/Scripts/SS3D/Systems/Tile/TileSystem.cs:148)
SS3D.Systems.Tile.TileSystem.WaitForResourcesLoad () (at Assets/Scripts/SS3D/Systems/Tile/TileSystem.cs:40)
Cysharp.Threading.Tasks.UniTaskCompletionSourceCore`1[TResult].GetResult (System.Int16 token) (at Library/PackageCache/com.cysharp.unitask@9e2163616b/Runtime/UniTaskCompletionSource.cs:244)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`1[TStateMachine].GetResult (System.Int16 token) (at Library/PackageCache/com.cysharp.unitask@9e2163616b/Runtime/CompilerServices/StateMachineRunner.cs:218)
Cysharp.Threading.Tasks.UniTask+Awaiter.GetResult () (at Library/PackageCache/com.cysharp.unitask@9e2163616b/Runtime/UniTask.cs:312)
SS3D.Systems.Tile.TileSystem.Setup () (at Assets/Scripts/SS3D/Systems/Tile/TileSystem.cs:56)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <d6232873609549b8a045fa15811a5bd3>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <685c48cf8f0b48abb797275c046dda6a>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <685c48cf8f0b48abb797275c046dda6a>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <685c48cf8f0b48abb797275c046dda6a>:0)

UnauthorizedPlayer(Clone) was spawned but it's recommended to not spawn objects for connections until they have loaded start scenes. You can be notified when a connection loads start scenes by using connection.OnLoadedStartScenes on the connection, or SceneManager.OnClientLoadStartScenes.
UnityEngine.Debug:LogWarning (object)
FishNet.Managing.Logging.LevelLoggingConfiguration:LogWarning (string) (at Assets/FishNet/Runtime/Managing/Logging/LevelLoggingConfiguration.cs:118)
FishNet.Managing.NetworkManager:LogWarning (string) (at Assets/FishNet/Runtime/Managing/NetworkManager.Logging.cs:102)
FishNet.Managing.Server.ServerObjects:Spawn (FishNet.Object.NetworkObject,FishNet.Connection.NetworkConnection) (at Assets/FishNet/Runtime/Managing/Server/Object/ServerObjects.cs:471)
FishNet.Managing.Server.ServerManager:Spawn (FishNet.Object.NetworkObject,FishNet.Connection.NetworkConnection) (at Assets/FishNet/Runtime/Managing/Server/ServerManager.QOL.cs:114)
SS3D.Systems.PlayerControl.PlayerSystem:ProcessPlayerJoin (FishNet.Connection.NetworkConnection) (at Assets/Scripts/SS3D/Systems/PlayerControl/PlayerSystem.cs:150)
SS3D.Systems.PlayerControl.PlayerSystem:HandleClientLoadedStartScenes (FishNet.Connection.NetworkConnection,bool) (at Assets/Scripts/SS3D/Systems/PlayerControl/PlayerSystem.cs:72)
FishNet.Managing.Scened.SceneManager:TryInvokeLoadedStartScenes (FishNet.Connection.NetworkConnection,bool) (at Assets/FishNet/Runtime/Managing/Scened/SceneManager.cs:318)
FishNet.Managing.Scened.SceneManager/<__LoadScenes>d__107:MoveNext () (at Assets/FishNet/Runtime/Managing/Scened/SceneManager.cs:1316)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

ComponentIndex of 1 is out of bounds on AtmosPipesL4 [id 0]. This may occur if you have modified your gameObject/prefab without saving it, or the scene.
UnityEngine.Debug:LogError (object)
FishNet.Managing.Logging.LevelLoggingConfiguration:LogError (string) (at Assets/FishNet/Runtime/Managing/Logging/LevelLoggingConfiguration.cs:128)
FishNet.Managing.NetworkManager:LogError (string) (at Assets/FishNet/Runtime/Managing/NetworkManager.Logging.cs:116)
FishNet.Serializing.Reader:ReadNetworkBehaviour (int&,byte&) (at Assets/FishNet/Runtime/Serializing/Reader.cs:1034)
FishNet.Serializing.Reader:ReadNetworkBehaviour () (at Assets/FishNet/Runtime/Serializing/Reader.cs:1056)
FishNet.Serializing.Generated.GeneratedReaders___Internal:Read___SS3D.Systems.Inventory.Items.ItemFishNet.Serializing.Generateds (FishNet.Serializing.Reader)
FishNet.Serializing.Generated.GeneratedReaders___Internal:Read___SS3D.Systems.Inventory.Containers.StoredItemFishNet.Serializing.Generateds (FishNet.Serializing.Reader)
FishNet.Serializing.Reader:Read<SS3D.Systems.Inventory.Containers.StoredItem> () (at Assets/FishNet/Runtime/Serializing/Reader.cs:1486)
FishNet.Object.Synchronizing.SyncList`1<SS3D.Systems.Inventory.Containers.StoredItem>:Read (FishNet.Serializing.PooledReader,bool) (at Assets/FishNet/Runtime/Object/Synchronizing/SyncList.cs:357)
FishNet.Object.NetworkBehaviour:OnSyncType (FishNet.Serializing.PooledReader,int,bool,bool) (at Assets/FishNet/Runtime/Object/NetworkBehaviour.SyncTypes.cs:198)
FishNet.Managing.Client.ClientObjectCache:Iterate () (at Assets/FishNet/Runtime/Managing/Client/Object/ObjectCaching.cs:423)
FishNet.Managing.Client.ClientObjects:IterateObjectCache () (at Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs:493)
FishNet.Managing.Client.ClientManager:ParseReader (FishNet.Serializing.PooledReader,FishNet.Transporting.Channel,bool) (at Assets/FishNet/Runtime/Managing/Client/ClientManager.cs:439)
FishNet.Managing.Client.ClientManager:ParseReceived (FishNet.Transporting.ClientReceivedDataArgs) (at Assets/FishNet/Runtime/Managing/Client/ClientManager.cs:357)
FishNet.Managing.Client.ClientManager:Transport_OnClientReceivedData (FishNet.Transporting.ClientReceivedDataArgs) (at Assets/FishNet/Runtime/Managing/Client/ClientManager.cs:321)
FishNet.Transporting.Tugboat.Tugboat:HandleClientReceivedDataArgs (FishNet.Transporting.ClientReceivedDataArgs) (at Assets/FishNet/Runtime/Transporting/Transports/Tugboat/Tugboat.cs:219)
FishNet.Transporting.Tugboat.Client.ClientSocket:IterateIncoming () (at Assets/FishNet/Runtime/Transporting/Transports/Tugboat/Core/ClientSocket.cs:287)
FishNet.Transporting.Tugboat.Tugboat:IterateIncoming (bool) (at Assets/FishNet/Runtime/Transporting/Transports/Tugboat/Tugboat.cs:192)
FishNet.Managing.Transporting.TransportManager:IterateIncoming (bool) (at Assets/FishNet/Runtime/Managing/Transporting/TransportManager.cs:561)
FishNet.Managing.Timing.TimeManager:TryIterateData (bool) (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:1049)
FishNet.Managing.Timing.TimeManager:IncreaseTick () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:708)
FishNet.Managing.Timing.TimeManager:<TickUpdate>g__MethodLogic|104_0 () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:383)
FishNet.Managing.Timing.TimeManager:TickUpdate () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:373)
FishNet.Transporting.NetworkReaderLoop:Update () (at Assets/FishNet/Runtime/Transporting/NetworkReaderLoop.cs:28)

Those warnings may be referring to the tile system? Not sure.

Copy link
Contributor

@stilnat stilnat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes yet, but a few question to answer for clarity. Also issue with building but not due to this PR, should be fixed ASAP before anything else is merged.

Assets/Scripts/SS3D/Systems/Tile/TileMap.cs Show resolved Hide resolved
Builds/Game/Data/Tilemaps/Save.json Outdated Show resolved Hide resolved
Builds/Game/Data/Tilemaps/UnnamedMap.json Outdated Show resolved Hide resolved
Assets/Scripts/SS3D/Systems/Tile/SaveSystem.cs Outdated Show resolved Hide resolved
Assets/Scripts/SS3D/Data/Paths.cs Show resolved Hide resolved
Assets/Scripts/SS3D/Data/Paths.cs Show resolved Hide resolved
Assets/Scripts/SS3D/Data/Management/SaveSystem.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@stilnat stilnat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client's build menu is broken, fix before we can merge.

Copy link
Contributor

@stilnat stilnat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working as expected

@stilnat stilnat merged commit d6d8204 into RE-SS3D:develop Sep 29, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants