You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
I don't know when to start lobby, because lobby.members always returns 0 members.. And I don't get why? Can anyone help me with this?
public void CreateLobby(string LobbyName, string LobbyPassword, ulong[] Radiant, ulong[] Dire)
{
if (dota.Lobby != null)
{
UpdateStatus(DotaClientStatus.Warning, "Lobby: Creating a lobby when already in one.");
}
CMsgPracticeLobbySetDetails details = new CMsgPracticeLobbySetDetails();
details.game_name = LobbyName;
details.pass_key = LobbyPassword;
details.game_mode = (uint)DOTA_GameMode.DOTA_GAMEMODE_AP; // game mode
details.allow_cheats = true; // chitz
details.server_region = (uint)ERegionCode.USEast;
details.dota_tv_delay = LobbyDotaTVDelay.LobbyDotaTV_300;
details.game_version = DOTAGameVersion.GAME_VERSION_CURRENT;
details.visibility = DOTALobbyVisibility.DOTALobbyVisibility_Public;
dota.CreateLobby(LobbyPassword, details);
// wait for lobby to be created
while (dota.Lobby == null)
{
Thread.Sleep(10);
}
UpdateStatus(DotaClientStatus.Normal, "Lobby: Lobby Created.");
UpdateStatus(DotaClientStatus.Normal, "Lobby: Lobby Name: " + LobbyName);
UpdateStatus(DotaClientStatus.Normal, "Lobby: Lobby Password: " + LobbyPassword);
UpdateStatus(DotaClientStatus.Normal, "Lobby: Lobby ID: " + dota.Lobby.lobby_id.ToString());
Thread.Sleep(1000);
foreach (var p in Radiant)
{
dota.InviteToLobby(p);
}
foreach (var p in Dire)
{
dota.InviteToLobby(p);
}
dota.JoinCoachSlot(DOTA_GC_TEAM.DOTA_GC_TEAM_GOOD_GUYS);
dota.Lobby.allow_spectating = true;
UpdateStatus(DotaClientStatus.Normal, "Lobby: Moved bot to player pool.");
if (OnLobbyCreated != null)
{
OnLobbyCreated(dota.Lobby.lobby_id);
}
UpdateStatus(DotaClientStatus.Normal, "Lobby: Waiting for players to connect....");
List<DateTime> NotificationTimeouts = new List<DateTime>();
NotificationTimeouts.Add(DateTime.Now.AddMinutes(1));
NotificationTimeouts.Add(NotificationTimeouts.Last().AddMinutes(1));
NotificationTimeouts.Add(NotificationTimeouts.Last().AddMinutes(1));
NotificationTimeouts.Add(NotificationTimeouts.Last().AddMinutes(1));
NotificationTimeouts.Add(NotificationTimeouts.Last().AddMinutes(1));
NotificationTimeouts.Reverse();
while (true)
{
List<CDOTALobbyMember> members = dota.Lobby.members;
int count = 0;
Console.WriteLine("Count :" + dota.Lobby.members.Count);
if (count == 1)
{
break;
}
Thread.Sleep(1000);
if (NotificationTimeouts.Count == 0)
{
continue;
//TODO: cancel the match and reset bot
}
if (DateTime.Now > NotificationTimeouts[0])
{
dota.SendChannelMessage(dota.Lobby.lobby_id, "Players have " + NotificationTimeouts.Count.ToString() + " minute" + (NotificationTimeouts.Count == 1 ? "" : "s") + " to join the lobby.");
NotificationTimeouts.RemoveAt(0);
}
}
The text was updated successfully, but these errors were encountered:
I think I found the problem. CSODOTALobby -> 'members' should be named 'all_members' to be able to fetch json from dota2 api
CSODOTALobby ->
[ProtoMember(2, Name = "members", DataFormat = DataFormat.Default)]
public List members { get; }
But this class is locked for me... Can anyone help me with this please?
You likely need to update the Protobuf definitions, which define the network messages. The last update in this repo is from 2019, so any change Valve made after that aren't reflected in the last NuGet release.
I don't know when to start lobby, because lobby.members always returns 0 members.. And I don't get why? Can anyone help me with this?
public void CreateLobby(string LobbyName, string LobbyPassword, ulong[] Radiant, ulong[] Dire)
{
The text was updated successfully, but these errors were encountered: