internal static void SetLobbyTypeFromOnlineMode(MyOnlineModeEnum onlineMode) { MyMultiplayerLobby lobby = MyMultiplayer.Static as MyMultiplayerLobby; if (lobby == null) { Debug.Fail("Multiplayer lobby not found"); return; } LobbyTypeEnum lobbyType = LobbyTypeEnum.Private; switch (onlineMode) { case MyOnlineModeEnum.FRIENDS: lobbyType = LobbyTypeEnum.FriendsOnly; break; case MyOnlineModeEnum.PUBLIC: lobbyType = LobbyTypeEnum.Public; break; } lobby.SetLobbyType(lobbyType); }
public static MyMultiplayerHostResult HostLobby(LobbyTypeEnum lobbyType, int maxPlayers, MySyncLayer syncLayer) { System.Diagnostics.Debug.Assert(syncLayer != null); MyTrace.Send(TraceWindow.Multiplayer, "Host game"); MyMultiplayerHostResult ret = new MyMultiplayerHostResult(); #if !XB1 SteamSDK.Lobby.Create(lobbyType, maxPlayers, (lobby, result) => { if (!ret.Cancelled) { if (result == Result.OK && lobby.GetOwner() != Sync.MyId) { result = Result.Fail; lobby.Leave(); } MyTrace.Send(TraceWindow.Multiplayer, "Lobby created"); lobby.SetLobbyType(lobbyType); ret.RaiseDone(result, result == Result.OK ? MyMultiplayer.Static = new MyMultiplayerLobby(lobby, syncLayer) : null); } }); #endif return(ret); }
//RuleInfo CurrentRule { get { return m_Rules.First(r => r.Name == CurrentVariant); } } public CreateTableTabControl(string playerName, LobbyTypeEnum lobby, GameInfo game) { m_LobbyType = lobby; m_Game = game; InitializeComponent(); txtTableName.Text = playerName + Resources.CreateTableTabControl_CreateTableTabControl__Table; InitVariants(); RefreshNumbers(); grpQuickMode.Visible = lobby == LobbyTypeEnum.QuickMode; }
public Table(string tableName, GameSubTypeEnum gameSubType, int minPlayersToStart, int maxPlayers, BlindTypeEnum blindType, LobbyTypeEnum lobbyType, LimitTypeEnum limitType, Server server) { TableName = tableName; GameSubType = gameSubType; MinPlayersToStart = minPlayersToStart; MaxPlayers = maxPlayers; BlindType = blindType; LobbyType = lobbyType; LimitType = limitType; Server = server; }
public CreateTableForm(string playerName, LobbyTypeEnum lobby, IEnumerable<GameInfo> games) { Params = null; InitializeComponent(); var infos = games as GameInfo[] ?? games.ToArray(); foreach (var type in infos.Select(r => r.GameType).Distinct()) { var t = type.ToString(); var tp = new TabPage(t) { Name = "tab" + t, BackColor = Color.White }; tp.Controls.Add(new CreateTableTabControl(playerName, lobby, infos.First(r => r.GameType.ToString() == t)) { Dock = DockStyle.Fill }); tabControl1.TabPages.Add(tp); } }
protected MyOnlineModeEnum GetOnlineMode(LobbyTypeEnum lobbyType) { switch (lobbyType) { case LobbyTypeEnum.Private: return(MyOnlineModeEnum.PRIVATE); case LobbyTypeEnum.FriendsOnly: return(MyOnlineModeEnum.FRIENDS); case LobbyTypeEnum.Public: return(MyOnlineModeEnum.PUBLIC); case LobbyTypeEnum.Invisible: default: Debug.Fail("Invalid branch."); return(MyOnlineModeEnum.PUBLIC); } }
public unsafe bool SetLobbyType(LobbyTypeEnum type) { //IsUdtReturn false; //if (this.GetOwner() != num) //{ // return false; //} //ISteamMatchmaking* type2 = <Module>.SteamMatchmaking(); //CSteamID lobbyId = this.LobbyId; //bool success = calli(System.Byte modopt(System.Runtime.CompilerServices.CompilerMarshalOverride) modopt(System.Runtime.CompilerServices.CallConvCdecl)(System.IntPtr,CSteamID,ELobbyType), type2, lobbyId, type, *(*(long*)type2 + 264L)); bool success = false; if (success) { this.SetLobbyData("LobbyType", ((LobbyTypeEnum)type).ToString()); } return(success); }
public static MyMultiplayerHostResult HostLobby(LobbyTypeEnum lobbyType, int maxPlayers, MySyncLayer syncLayer) { System.Diagnostics.Debug.Assert(syncLayer != null); MyTrace.Send(TraceWindow.Multiplayer, "Host game"); MyMultiplayerHostResult ret = new MyMultiplayerHostResult(); SteamSDK.Lobby.Create(lobbyType, maxPlayers, (lobby, result) => { if (!ret.Cancelled) { if (result == Result.OK && lobby.GetOwner() != MySteam.UserId) { result = Result.Fail; lobby.Leave(); } MyTrace.Send(TraceWindow.Multiplayer, "Lobby created"); lobby.SetLobbyType(lobbyType); ret.RaiseDone(result, result == Result.OK ? MyMultiplayer.Static = new MyMultiplayerLobby(lobby, syncLayer) : null); } }); return ret; }
public CreateTableForm(string playerName, LobbyTypeEnum lobby, IEnumerable <GameInfo> games) { Params = null; InitializeComponent(); if (games == null) { games = new GameInfo[0]; } var infos = games as GameInfo[] ?? games.ToArray(); foreach (var type in infos.Select(r => r.GameType).Distinct()) { var t = type.ToString(); var tp = new TabPage(t) { Name = "tab" + t, BackColor = Color.White }; tp.Controls.Add(new CreateTableTabControl(playerName, lobby, infos.First(r => r.GameType.ToString() == t)) { Dock = DockStyle.Fill }); tabControl1.TabPages.Add(tp); } }
public override void SetLobbyType(LobbyTypeEnum type) { Lobby.SetLobbyType(type); }
// public unsafe static Result ConvertLobby(LobbyCreated_t* lobby, ref Lobby result) // { // return false; // } // public unsafe static void ConvertJoin(LobbyEnter_t* info, ref LobbyEnterInfo result) // { // } public unsafe static void Create(LobbyTypeEnum lobbyType, int maxMembers, CompletedDelegate <Lobby> callback) { }
public abstract void SetLobbyType(LobbyTypeEnum type);
protected MyOnlineModeEnum GetOnlineMode(LobbyTypeEnum lobbyType) { switch (lobbyType) { case LobbyTypeEnum.Private: return MyOnlineModeEnum.PRIVATE; case LobbyTypeEnum.FriendsOnly: return MyOnlineModeEnum.FRIENDS; case LobbyTypeEnum.Public: return MyOnlineModeEnum.PUBLIC; case LobbyTypeEnum.Invisible: default: Debug.Fail("Invalid branch."); return MyOnlineModeEnum.PUBLIC; } }
// public unsafe static Result ConvertLobby(LobbyCreated_t* lobby, ref Lobby result) // { // return false; // } // public unsafe static void ConvertJoin(LobbyEnter_t* info, ref LobbyEnterInfo result) // { // } public unsafe static void Create(LobbyTypeEnum lobbyType, int maxMembers, CompletedDelegate<Lobby> callback) { }
public unsafe bool SetLobbyType(LobbyTypeEnum type) { //IsUdtReturn false; //if (this.GetOwner() != num) //{ // return false; //} //ISteamMatchmaking* type2 = <Module>.SteamMatchmaking(); //CSteamID lobbyId = this.LobbyId; //bool success = calli(System.Byte modopt(System.Runtime.CompilerServices.CompilerMarshalOverride) modopt(System.Runtime.CompilerServices.CallConvCdecl)(System.IntPtr,CSteamID,ELobbyType), type2, lobbyId, type, *(*(long*)type2 + 264L)); bool success = false; if (success) { this.SetLobbyData("LobbyType", ((LobbyTypeEnum)type).ToString()); } return success; }