Skip to content

Commit 9d78610

Browse files
committed
add ReJoin method on Client.
1 parent 113dcd0 commit 9d78610

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Assets/Plugins/Colyseus/Client.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,19 @@ public Room Join (string roomName, Dictionary<string, object> options = null)
112112
return room;
113113
}
114114

115+
/// <summary>
116+
/// Request <see cref="Client"/> to rejoin a <see cref="Room"/>.
117+
/// </summary>
118+
/// <param name="roomName">The name of the Room to rejoin.</param>
119+
/// <param name="sessionId">sessionId of client's previous connection</param>
120+
public Room ReJoin (string roomName, string sessionId)
121+
{
122+
Dictionary<string, object> options = new Dictionary<string, object> ();
123+
options.Add ("sessionId", sessionId);
124+
125+
return this.Join(roomName, options);
126+
}
127+
115128
// /// <summary>
116129
// /// Request <see cref="Client"/> to join in a <see cref="Room"/>.
117130
// /// </summary>

0 commit comments

Comments
 (0)