Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ebbafd0
feat: Add InRoomInviteSelectorPanel for inviting online players
Davetsa Apr 7, 2026
dc20b93
feat: Refactor game start transition logic for improved clarity and r…
Davetsa Apr 7, 2026
6b7863c
feat: Rename InRoom_ to FriendLobby for consistency across matchmakin…
Davetsa Apr 7, 2026
2727758
Refactor InviteDecisionPanel and InRoomInviteSelectorPanel
Davetsa Apr 8, 2026
2113ed0
Merge branch 'Photon/matchmaking/refactor/Random2v2' into Photon/matc…
Davetsa Apr 8, 2026
52f9824
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa Apr 8, 2026
80aa738
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa Apr 9, 2026
962234d
feat: Add InviteSelectorRow prefab and integrate into Battle Popup
Davetsa Apr 10, 2026
acf1f11
feat: Enhance InviteDecisionPopupHandler with improved parent resolut…
Davetsa Apr 13, 2026
d3d6595
fix(lobby): harden queue matchmaking flow and preserve duo team blocks
Davetsa Apr 13, 2026
219b47f
fix(matchmaking): harden queue handoff and start flow for Random2v2/C…
Davetsa Apr 14, 2026
915ffa4
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa Apr 15, 2026
96feaa1
Merge branch 'Photon/matchmaking/refactor/Random2v2' into Photon/matc…
Davetsa Apr 15, 2026
ed1fcd7
feat(lobby): implement battle start checks and UI readiness notificat…
Davetsa Apr 16, 2026
8c6ee20
Matchmaking: improve queue handling, premade reservations and diagnos…
Davetsa Apr 20, 2026
57afcdd
fix(matchmaking): prevent pairing of lone solo players when duos are …
Davetsa Apr 21, 2026
0ff3b89
feat(matchmaking): enhance room switching logic to handle game type c…
Davetsa Apr 21, 2026
7771f37
feat(matchmaking): enhance logging for queue selection and handling o…
Davetsa Apr 21, 2026
769c615
feat(matchmaking): implement solo selection caps and improve duo pair…
Davetsa Apr 23, 2026
23a3646
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa Apr 23, 2026
4594acf
feat(matchmaking): update game type references and improve mode selec…
Davetsa Apr 23, 2026
1abc52a
feat(matchmaking): enhance duo handling and prevent mixed pairings du…
Davetsa Apr 24, 2026
7a659f5
feat(matchmaking): implement grace period for recent joins to avoid s…
Davetsa Apr 27, 2026
0fbd0a7
feat(matchmaking): add diagnostic logging for queue selection state c…
Davetsa Apr 27, 2026
bf5b6f3
feat(matchmaking): enhance queue botfill selection logic and logging …
Davetsa Apr 27, 2026
91cf8cc
feat(matchmaking): clear stale premade metadata and stop holder corou…
Davetsa Apr 28, 2026
bbf4d94
feat(matchmaking): enhance duo handling by adding solo players when r…
Davetsa Apr 28, 2026
11e4626
feat(matchmaking): disable bot-fill reconciliation and shared room co…
Davetsa Apr 29, 2026
dbf47fc
feat(matchmaking): implement join attempt tracking with diagnostics f…
Davetsa Apr 29, 2026
bf7acaf
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa Apr 29, 2026
0ed0698
feat(matchmaking): add invite button functionality and logic for send…
Davetsa Apr 30, 2026
50428f8
fix(battle-popup): disable sorting override and reset sorting order f…
Davetsa Apr 30, 2026
0848dc2
feat(matchmaking): implement unique room naming with sequence for con…
Davetsa May 1, 2026
c431ecb
feat(matchmaking): increase grace period for queued duos and enhance …
Davetsa May 1, 2026
687d52b
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa May 1, 2026
8bfce4f
feat(matchmaking): implement queue-authoritative matchmaking flow and…
Davetsa May 1, 2026
c95a469
feat(matchmaking): remove premade target mode selector and update inv…
Davetsa May 1, 2026
a62c261
feat(matchmaking): refactor premade invite handling and improve butto…
Davetsa May 1, 2026
395bfe8
feat(matchmaking): enhance room creation flow and manage join failure…
Davetsa May 4, 2026
a111dff
refactor(matchmaking): clean up teammate queueing logic and improve c…
Davetsa May 4, 2026
25c9953
feat(matchmaking): implement JoinAttemptTracker for managing join att…
Davetsa May 4, 2026
37897cd
feat(matchmaking): enhance teammate resolution logic for premade matc…
Davetsa May 4, 2026
6f9406c
feat(matchmaking): implement custom room timeout monitoring and handling
Davetsa May 5, 2026
e63a9f3
refactor(matchmaking): simplify leader and expected user queue handli…
Davetsa May 5, 2026
b2667e4
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa May 5, 2026
11146e2
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa May 5, 2026
ed89a9f
Refactor premade invite timestamp handling to use milliseconds instea…
Davetsa May 7, 2026
ff5e58b
Implement duo partner checks and matchmaking stop handling in LobbyMa…
Davetsa May 7, 2026
ae9afb0
Merge branch 'main' into Photon/matchmaking/implement/PremadeMatchmaking
Davetsa May 11, 2026
fccce45
Updated GameTypeReference asset icons and added background; improved …
Davetsa May 11, 2026
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
1 change: 1 addition & 0 deletions Assets/Altzone/Scripts/Photon/GameTypeEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public enum GameType
Custom = 0,
Random2v2 = 1,
Clan2v2 = 2,
FriendLobby = 3,
}
}

166 changes: 166 additions & 0 deletions Assets/Altzone/Scripts/Photon/JoinAttemptTracker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;

using UnityEngine;

namespace Altzone.Scripts.Lobby
{
internal sealed class JoinAttemptTracker
{
private sealed class JoinAttemptInfo
{
public string RoomName = string.Empty;
public string[] ExpectedUsers = null;
public float StartTime = 0f;
public bool Completed = false;
public bool Success = false;
public float CompletionTime = 0f;
public short? FailureCode = null;
public string FailureMessage = null;
}

private readonly object _lock = new object();
private int _joinAttemptCounter = 0;
private int _currentJoinAttemptId = 0;
private readonly Dictionary<int, JoinAttemptInfo> _joinAttempts = new Dictionary<int, JoinAttemptInfo>();

public int CurrentJoinAttemptId
{
get
{
lock (_lock)
{
return _currentJoinAttemptId;
}
}
}

public int LastIssuedAttemptId
{
get
{
lock (_lock)
{
return _joinAttemptCounter;
}
}
}

public int BeginJoinAttempt(string roomName, string[] expectedUsers = null)
{
int id = ++_joinAttemptCounter;
JoinAttemptInfo info = new JoinAttemptInfo()
{
RoomName = roomName ?? string.Empty,
ExpectedUsers = expectedUsers,
StartTime = Time.time,
Completed = false,
Success = false
};

lock (_lock)
{
_joinAttempts[id] = info;
_currentJoinAttemptId = id;
}

Debug.Log($"JoinAttempt[{id}] BEGIN room='{info.RoomName}' teammates={expectedUsers?.Length ?? 0}");
return id;
}

public void MarkJoinAttemptSuccess(int id)
{
lock (_lock)
{
if (id == 0) id = _currentJoinAttemptId;
if (id == 0) return;

if (_joinAttempts.TryGetValue(id, out JoinAttemptInfo info))
{
info.Completed = true;
info.Success = true;
info.CompletionTime = Time.time;
Debug.Log($"JoinAttempt[{id}] SUCCESS room='{info.RoomName}'");
}

if (_currentJoinAttemptId == id) _currentJoinAttemptId = 0;
_joinAttempts.Remove(id);
}
}

public void MarkJoinAttemptFailure(int id, short returnCode, string message)
{
lock (_lock)
{
if (id == 0) id = _currentJoinAttemptId;
if (id == 0)
{
Debug.LogWarning($"JoinAttempt: failure callback with no current attempt (code={returnCode} msg={message})");
return;
}

if (_joinAttempts.TryGetValue(id, out JoinAttemptInfo info))
{
info.Completed = true;
info.Success = false;
info.FailureCode = returnCode;
info.FailureMessage = message;
info.CompletionTime = Time.time;
Debug.Log($"JoinAttempt[{id}] FAILED room='{info.RoomName}' code={returnCode} msg={message}");
}

if (_currentJoinAttemptId == id) _currentJoinAttemptId = 0;
_joinAttempts.Remove(id);
}
}

public bool IsAttemptCompleted(int id)
{
lock (_lock)
{
if (id == 0) id = _currentJoinAttemptId;
return id != 0 && _joinAttempts.TryGetValue(id, out JoinAttemptInfo info) && info.Completed;
}
}

public bool TryGetFailedJoinAttempt(int id, out string failureMessage)
{
lock (_lock)
{
if (id == 0) id = _currentJoinAttemptId;
if (id != 0 && _joinAttempts.TryGetValue(id, out JoinAttemptInfo info) && info.Completed && !info.Success)
{
failureMessage = info.FailureMessage;
return true;
}
}

failureMessage = null;
return false;
}

public int FindJoinAttemptIdForRoomName(string roomName)
{
roomName = roomName ?? string.Empty;
lock (_lock)
{
if (_currentJoinAttemptId != 0
&& _joinAttempts.TryGetValue(_currentJoinAttemptId, out JoinAttemptInfo current)
&& string.Equals(current.RoomName, roomName, StringComparison.Ordinal))
{
return _currentJoinAttemptId;
}

foreach (KeyValuePair<int, JoinAttemptInfo> kvp in _joinAttempts)
{
if (string.Equals(kvp.Value.RoomName, roomName, StringComparison.Ordinal))
{
return kvp.Key;
}
}
}

return 0;
}
}
}
11 changes: 11 additions & 0 deletions Assets/Altzone/Scripts/Photon/JoinAttemptTracker.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading