private MobileParty GetPlayerParty(RailServerPeer peer) { if (Coop.IsClient && Coop.IsServer) { return(MobileParty.MainParty); } return(null); }
private void OnClientRemoved(RailServerPeer peer) { lock (m_Lock) { foreach (RailEntityServer controlledEntity in m_Room .Entities.Where( e => e.Controller == peer) .Select(e => e as RailEntityServer)) { peer.RevokeControl(controlledEntity); OnPlayerControlledEntityOrphaned?.Invoke(peer, controlledEntity); } } }
private void OnClientAdded(RailServerPeer peer) { if (IsArbiter(peer)) { m_Arbiter = peer; } MobileParty party = GetPlayerParty(peer); if (party == null || !m_Parties.ContainsKey(party)) { Logger.Warn("Player party not found."); return; } peer.GrantControl(m_Parties[party]); Logger.Info($"{party} control granted to {peer}."); }
private void OnClientAdded(RailServerPeer peer) { if (IsArbiter(peer)) { m_Arbiter = peer; } MobileParty party = GetPlayerParty(peer); lock (m_Lock) { if (party == null || !m_Parties.ContainsKey(party)) { Logger.Warn("Player party not found."); } if (m_Parties[party].Controller == null) { // TODO: Currently only the hosting player gets to control the main party. In a future version, every player gets their own party. peer.GrantControl(m_Parties[party]); Logger.Info("{party} control granted to {peer}.", party, peer); } } }
private bool IsArbiter(RailServerPeer peer) { // TODO: Implement return(true); }
private void OnClientRemoved(RailServerPeer peer) { // TODO: Remove control }