public override void LaunchLocalServer(Process process, ServerMode mode)
        {
            if (this._lobby.State != LobbyState.Inactive)
            {
                this._lobby.Leave();
            }
            ProcessStartInfo startInfo = process.StartInfo;
            string           str       = startInfo.Arguments + " -steam -localsteamid " + (object)(ulong)SteamUser.GetSteamID().m_SteamID;

            startInfo.Arguments = str;
            if (mode.HasFlag((Enum)ServerMode.Lobby))
            {
                this._hasLocalHost = true;
                if (mode.HasFlag((Enum)ServerMode.FriendsCanJoin))
                {
                    process.StartInfo.Arguments += " -lobby friends";
                }
                else
                {
                    process.StartInfo.Arguments += " -lobby private";
                }
                if (mode.HasFlag((Enum)ServerMode.FriendsOfFriends))
                {
                    process.StartInfo.Arguments += " -friendsoffriends";
                }
            }
            SteamFriends.SetRichPresence("status", Language.GetTextValue("Social.StatusInGame"));
            Netplay.OnDisconnect += new Action(this.OnDisconnect);
            process.Start();
        }
Example #2
0
        public override void LaunchLocalServer(Process process, ServerMode mode)
        {
            //IL_0039: Unknown result type (might be due to invalid IL or missing references)
            WeGameHelper.WriteDebugString("LaunchLocalServer");
            if (_lobby.State != 0)
            {
                _lobby.Leave();
            }
            ProcessStartInfo startInfo = process.StartInfo;

            startInfo.Arguments = startInfo.Arguments + " -steam -localsteamid " + SteamUser.GetSteamID().m_SteamID;
            if (mode.HasFlag(ServerMode.Lobby))
            {
                _hasLocalHost = true;
                if (mode.HasFlag(ServerMode.FriendsCanJoin))
                {
                    process.StartInfo.Arguments += " -lobby friends";
                }
                else
                {
                    process.StartInfo.Arguments += " -lobby private";
                }
                if (mode.HasFlag(ServerMode.FriendsOfFriends))
                {
                    process.StartInfo.Arguments += " -friendsoffriends";
                }
            }
            SteamFriends.SetRichPresence("status", Language.GetTextValue("Social.StatusInGame"));
            Netplay.OnDisconnect += OnDisconnect;
            process.Start();
        }
        public override void LaunchLocalServer(Process process, ServerMode mode)
        {
            if (_lobby.State != 0)
            {
                _lobby.Leave();
            }
            ProcessStartInfo startInfo = process.StartInfo;

            startInfo.Arguments = startInfo.Arguments + " -steam -localsteamid " + SteamUser.GetSteamID().m_SteamID;
            if (mode.HasFlag(ServerMode.Lobby))
            {
                _hasLocalHost = true;
                if (mode.HasFlag(ServerMode.FriendsCanJoin))
                {
                    process.StartInfo.Arguments += " -lobby friends";
                }
                else
                {
                    process.StartInfo.Arguments += " -lobby private";
                }
                if (mode.HasFlag(ServerMode.FriendsOfFriends))
                {
                    process.StartInfo.Arguments += " -friendsoffriends";
                }
            }
            SteamFriends.SetRichPresence("status", "Playing online.");
            Netplay.OnDisconnect += OnDisconnect;
            process.Start();
        }
		public override void LaunchLocalServer(Process process, ServerMode mode)
		{
			if (this._lobby.State != LobbyState.Inactive)
			{
				this._lobby.Leave();
			}
			ProcessStartInfo expr_1E = process.StartInfo;
			expr_1E.Arguments = expr_1E.Arguments + " -steam -localsteamid " + SteamUser.GetSteamID().m_SteamID;
			if (mode.HasFlag(ServerMode.Lobby))
			{
				this._hasLocalHost = true;
				if (mode.HasFlag(ServerMode.FriendsCanJoin))
				{
					ProcessStartInfo expr_78 = process.StartInfo;
					expr_78.Arguments += " -lobby friends";
				}
				else
				{
					ProcessStartInfo expr_95 = process.StartInfo;
					expr_95.Arguments += " -lobby private";
				}
				if (mode.HasFlag(ServerMode.FriendsOfFriends))
				{
					ProcessStartInfo expr_C3 = process.StartInfo;
					expr_C3.Arguments += " -friendsoffriends";
				}
			}
			SteamFriends.SetRichPresence("status", "Playing online.");
			Netplay.OnDisconnect += new Action(this.OnDisconnect);
			process.Start();
		}
Example #5
0
        public override void LaunchLocalServer(Process process, ServerMode mode)
        {
            //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
            if (_lobby.State != 0)
            {
                _lobby.Leave();
            }
            LazyCreateWeGameMsgServer();
            ProcessStartInfo startInfo = process.StartInfo;

            startInfo.Arguments = startInfo.Arguments + " -wegame -localwegameid " + ((RailComparableID)GetLocalPeer()).id_;
            if (mode.HasFlag(ServerMode.Lobby))
            {
                _hasLocalHost = true;
                if (mode.HasFlag(ServerMode.FriendsCanJoin))
                {
                    process.StartInfo.Arguments += " -lobby friends";
                }
                else
                {
                    process.StartInfo.Arguments += " -lobby private";
                }
                if (mode.HasFlag(ServerMode.FriendsOfFriends))
                {
                    process.StartInfo.Arguments += " -friendsoffriends";
                }
            }
            string str = default(string);

            rail_api.RailFactory().RailUtils().GetLaunchAppParameters((EnumRailLaunchAppType)2, ref str);
            ProcessStartInfo startInfo2 = process.StartInfo;

            startInfo2.Arguments = startInfo2.Arguments + " " + str;
            WeGameHelper.WriteDebugString("LaunchLocalServer,cmd_line:" + process.StartInfo.Arguments);
            AsyncSetMyMetaData("status", Language.GetTextValue("Social.StatusInGame"));
            Netplay.OnDisconnect += OnDisconnect;
            process.Start();
        }
Example #6
0
        public override void LaunchLocalServer(Process process, ServerMode mode)
        {
            if (this._lobby.State != LobbyState.Inactive)
            {
                this._lobby.Leave();
            }
            this.LazyCreateWeGameMsgServer();
            ProcessStartInfo startInfo1 = process.StartInfo;

            startInfo1.Arguments = startInfo1.Arguments + " -wegame -localwegameid " + (object)(ulong)((RailComparableID)this.GetLocalPeer()).id_;
            if (mode.HasFlag((Enum)ServerMode.Lobby))
            {
                this._hasLocalHost = true;
                if (mode.HasFlag((Enum)ServerMode.FriendsCanJoin))
                {
                    process.StartInfo.Arguments += " -lobby friends";
                }
                else
                {
                    process.StartInfo.Arguments += " -lobby private";
                }
                if (mode.HasFlag((Enum)ServerMode.FriendsOfFriends))
                {
                    process.StartInfo.Arguments += " -friendsoffriends";
                }
            }
            string str;

            rail_api.RailFactory().RailUtils().GetLaunchAppParameters((EnumRailLaunchAppType)2, ref str);
            ProcessStartInfo startInfo2 = process.StartInfo;

            startInfo2.Arguments = startInfo2.Arguments + " " + str;
            WeGameHelper.WriteDebugString("LaunchLocalServer,cmd_line:" + process.StartInfo.Arguments);
            this.AsyncSetMyMetaData("status", Language.GetTextValue("Social.StatusInGame"));
            Netplay.OnDisconnect += new Action(this.OnDisconnect);
            process.Start();
        }
 private void OnCreateSessionRequest(CreateSessionRequest data)
 {
     if (!_acceptingClients)
     {
         WeGameHelper.WriteDebugString(" - Ignoring connection from " + ((RailComparableID)data.remote_peer).id_ + " while _acceptionClients is false.");
         return;
     }
     if (!_mode.HasFlag(ServerMode.FriendsOfFriends) && !IsWeGameFriend(data.remote_peer))
     {
         WeGameHelper.WriteDebugString("Ignoring connection from " + ((RailComparableID)data.remote_peer).id_ + ". Friends of friends is disabled.");
         return;
     }
     WeGameHelper.WriteDebugString("pass wegame friend check");
     AcceptAnUserSession(data.local_peer, data.remote_peer);
     _connectionStateMap[data.remote_peer] = ConnectionState.Authenticating;
     if (_connectionAcceptedCallback != null)
     {
         _connectionAcceptedCallback(new SocialSocket(new WeGameAddress(data.remote_peer, "")));
     }
 }
Example #8
0
        private void OnP2PSessionRequest(P2PSessionRequest_t result)
        {
            //IL_0000: Unknown result type (might be due to invalid IL or missing references)
            //IL_0001: Unknown result type (might be due to invalid IL or missing references)
            //IL_0006: Unknown result type (might be due to invalid IL or missing references)
            //IL_000d: Unknown result type (might be due to invalid IL or missing references)
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0023: Unknown result type (might be due to invalid IL or missing references)
            //IL_004c: Unknown result type (might be due to invalid IL or missing references)
            //IL_004d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0053: Invalid comparison between Unknown and I4
            //IL_0056: Unknown result type (might be due to invalid IL or missing references)
            //IL_005d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0067: Unknown result type (might be due to invalid IL or missing references)
            //IL_0070: Unknown result type (might be due to invalid IL or missing references)
            //IL_0079: Unknown result type (might be due to invalid IL or missing references)
            //IL_0085: Unknown result type (might be due to invalid IL or missing references)
            //IL_0092: Unknown result type (might be due to invalid IL or missing references)
            CSteamID steamIDRemote = result.m_steamIDRemote;

            if (_connectionStateMap.ContainsKey(steamIDRemote) && _connectionStateMap[steamIDRemote] != 0)
            {
                SteamNetworking.AcceptP2PSessionWithUser(steamIDRemote);
            }
            else if (_acceptingClients && (_mode.HasFlag(ServerMode.FriendsOfFriends) || (int)SteamFriends.GetFriendRelationship(steamIDRemote) == 3))
            {
                SteamNetworking.AcceptP2PSessionWithUser(steamIDRemote);
                P2PSessionState_t val = default(P2PSessionState_t);
                while (SteamNetworking.GetP2PSessionState(steamIDRemote, ref val) && val.m_bConnecting == 1)
                {
                }
                if (val.m_bConnectionActive == 0)
                {
                    Close(steamIDRemote);
                }
                _connectionStateMap[steamIDRemote] = ConnectionState.Authenticating;
                _connectionAcceptedCallback(new SocialSocket(new SteamAddress(steamIDRemote)));
            }
        }
        private void OnP2PSessionRequest(P2PSessionRequest_t result)
        {
            CSteamID steamIDRemote = result.m_steamIDRemote;

            if (_connectionStateMap.ContainsKey(steamIDRemote) && _connectionStateMap[steamIDRemote] != 0)
            {
                SteamNetworking.AcceptP2PSessionWithUser(steamIDRemote);
            }
            else if (_acceptingClients && (_mode.HasFlag(ServerMode.FriendsOfFriends) || SteamFriends.GetFriendRelationship(steamIDRemote) == EFriendRelationship.k_EFriendRelationshipFriend))
            {
                SteamNetworking.AcceptP2PSessionWithUser(steamIDRemote);
                P2PSessionState_t pConnectionState;
                while (SteamNetworking.GetP2PSessionState(steamIDRemote, out pConnectionState) && pConnectionState.m_bConnecting == 1)
                {
                }
                if (pConnectionState.m_bConnectionActive == 0)
                {
                    Close(steamIDRemote);
                }
                _connectionStateMap[steamIDRemote] = ConnectionState.Authenticating;
                _connectionAcceptedCallback(new SocialSocket(new SteamAddress(steamIDRemote)));
            }
        }