Made some requested changes
This commit is contained in:
parent
c211e5079c
commit
2d2ccade21
1 changed files with 3 additions and 10 deletions
|
@ -4,6 +4,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.OsHle.Services.Nifm
|
namespace Ryujinx.HLE.OsHle.Services.Nifm
|
||||||
{
|
{
|
||||||
|
@ -18,7 +19,6 @@ namespace Ryujinx.HLE.OsHle.Services.Nifm
|
||||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
||||||
{
|
{
|
||||||
{ 4, CreateRequest },
|
{ 4, CreateRequest },
|
||||||
{ 5, GetCurrentNetworkProfile },
|
|
||||||
{ 12, GetCurrentIpAddress }
|
{ 12, GetCurrentIpAddress }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -35,19 +35,12 @@ namespace Ryujinx.HLE.OsHle.Services.Nifm
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetCurrentNetworkProfile(ServiceCtx Context)
|
|
||||||
{
|
|
||||||
Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed.");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long GetCurrentIpAddress(ServiceCtx Context)
|
public long GetCurrentIpAddress(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
string HostName = Dns.GetHostName();
|
string HostName = Dns.GetHostName();
|
||||||
IPHostEntry HostEntry = Dns.GetHostEntry(HostName);
|
IPHostEntry HostEntry = Dns.GetHostEntry(HostName);
|
||||||
IPAddress[] Address = HostEntry.AddressList;
|
IPAddress[] Address = HostEntry.AddressList;
|
||||||
var IP = Address.Where(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).FirstOrDefault();
|
IPAddress IP = Address.Where(x => x.AddressFamily == AddressFamily.InterNetwork).FirstOrDefault();
|
||||||
uint LocalIP = BitConverter.ToUInt32(IP.GetAddressBytes());
|
uint LocalIP = BitConverter.ToUInt32(IP.GetAddressBytes());
|
||||||
Context.ResponseData.Write(LocalIP);
|
Context.ResponseData.Write(LocalIP);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue