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

Session rework #401

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
65c163f
Initial version of the sessions rework. Won't compile, as some things…
SokyranTheDragon Sep 30, 2023
7ac64b3
Merge branch 'master' of github.com:SokyranTheDragon/Multiplayer into…
SokyranTheDragon Oct 31, 2023
2bfbf44
First compiling version. Still WIP and needs cleaning.
SokyranTheDragon Nov 2, 2023
2598273
Turn pause locks into a session
SokyranTheDragon Nov 3, 2023
cd03e8c
Some minor cleanup related to trade sessions
SokyranTheDragon Nov 3, 2023
9561360
MpTradeSession.TryCreate now uses session manager
SokyranTheDragon Nov 4, 2023
9814dd0
Use `WorldComp.trading` instead of `WorldComp.sessionManager`
SokyranTheDragon Nov 4, 2023
23b6a96
Minor cleanup and error logging
SokyranTheDragon Nov 4, 2023
d4f363c
Fixed reading world data in `SemiPersistent:ReadSemiPersistent`
SokyranTheDragon Nov 4, 2023
8800453
TickMapTrading -> TickMapSessions
SokyranTheDragon Nov 4, 2023
54d201f
Remove the unnecessary "cleanup" of trading sessions
SokyranTheDragon Nov 5, 2023
e22f085
Fix ritual session not opening the dialog when started
SokyranTheDragon Nov 5, 2023
31750e0
Fix trading session transferables, put all drawn session changes into…
SokyranTheDragon Nov 5, 2023
21cc449
Rename `DrawnThingFilter` to `DrawnSessionWithTransferables`
SokyranTheDragon Nov 5, 2023
5acf4fe
Remove unnecessary commented-out code
SokyranTheDragon Nov 5, 2023
6b660ab
Call `ISession:PostRemoveSession` from `SessionManager:ExposeSessions…
SokyranTheDragon Nov 5, 2023
c2c11d9
Rename WindowSession back to Session
SokyranTheDragon Nov 5, 2023
237678d
Make session manager sync semi persistent session ID
SokyranTheDragon Nov 6, 2023
4f7f2ad
Stop sessions from self-assigning IDs, let session manager handle it
SokyranTheDragon Nov 6, 2023
5320d3f
Added XML documentation to most session interfaces
SokyranTheDragon Nov 6, 2023
a3438f8
ISemiPersistentSession Write/Read -> Sync, make rituals use it
SokyranTheDragon Nov 6, 2023
d1d5810
Slightly change how pause lock session works
SokyranTheDragon Nov 6, 2023
ceb1a83
Added ISessionManagerAPI
SokyranTheDragon Nov 6, 2023
d12a6cf
Expose `MultiplayerGameComp.nextSessionId`
SokyranTheDragon Nov 6, 2023
bc5d2e2
Rename `ISessionManagerAPI` to `ISessionManager`
SokyranTheDragon Nov 10, 2023
78bee79
Rename ISessionManager file
SokyranTheDragon Nov 10, 2023
e238082
Remove 3 session interfaces in favor of abstract classes
SokyranTheDragon Nov 10, 2023
f85c6b4
Added methods to `MultiplayerAPIBridge` that will (likely) end up in …
SokyranTheDragon Nov 11, 2023
ccf0b22
Fix session map syncing
SokyranTheDragon Nov 14, 2023
2a5ffe6
Merge branch 'master' of github.com:rwmt/Multiplayer into session-rework
SokyranTheDragon Nov 14, 2023
ba19d25
Added a sync dict entry for `ISessionWithTransferables`
SokyranTheDragon Nov 15, 2023
08600e8
Merge branch 'master' of github.com:SokyranTheDragon/Multiplayer into…
SokyranTheDragon Nov 20, 2023
2523da6
Merge branch 'master' of github.com:SokyranTheDragon/Multiplayer into…
SokyranTheDragon Dec 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make session manager sync semi persistent session ID
Also error for semi persistent data sync now says writing semi persistent instead of exposing
SokyranTheDragon committed Nov 6, 2023
commit 237678d942369b71669b249b691c1374aa3e0061
5 changes: 4 additions & 1 deletion Source/Client/Persistent/SessionManager.cs
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ public void WriteSemiPersistent(ByteWriter data)
allSessions.Remove(session);
var sessionType = session.GetType();
if (!tempCleanupLoggingTypes.Add(sessionType))
Log.Message($"Multiplayer session not valid after exposing data: {sessionType}");
Log.Message($"Multiplayer session not valid after writing semi persistent data: {sessionType}");
}
}
// Clear the set again to not leave behind any unneeded stuff
@@ -172,6 +172,7 @@ public void WriteSemiPersistent(ByteWriter data)
{
data.WriteUShort((ushort)ImplSerialization.sessions.FindIndex(session.GetType()));
data.WriteInt32(session.Map?.uniqueID ?? -1);
data.WriteInt32(session.SessionId);

try
{
@@ -194,6 +195,7 @@ public void ReadSemiPersistent(ByteReader data)
{
ushort typeIndex = data.ReadUShort();
int mapId = data.ReadInt32();
int sessionId = data.ReadInt32();

if (typeIndex >= ImplSerialization.sessions.Length)
{
@@ -217,6 +219,7 @@ public void ReadSemiPersistent(ByteReader data)
{
if (Activator.CreateInstance(objType, map) is ISemiPersistentSession session)
{
session.SessionId = sessionId;
session.Read(new ReadingSyncWorker(data));
semiPersistentSessions.Add(session);
allSessions.Add(session);