Can now somewhat reliably join a party

This commit is contained in:
watsonb8
2019-07-06 15:52:28 -04:00
parent 0d64c0732e
commit 2a3290defc
15 changed files with 140 additions and 125 deletions

View File

@ -22,10 +22,10 @@ namespace Aurora.RemoteImpl
//Add self to members list
_partyMembers.Add(new PartyMember
{
Username = SettingsService.Instance.Username,
UserName = SettingsService.Instance.Username,
Id = "asdf",
IpAddress = ServerService.Instance.Hostname,
Port = ServerService.Instance.Port.ToString()
Port = ServerService.Instance.Port
});
}
@ -41,10 +41,8 @@ namespace Aurora.RemoteImpl
{
_partyMembers.Add(new PartyMember()
{
Username = request.UserName,
Id = request.ClientId,
IpAddress = request.IpAddress,
Port = request.Port,
UserName = request.UserName,
IpAddress = context.Host,
});
JoinPartyResponse response = new JoinPartyResponse() { Status = PartyJoinedStatusEnum.Connected };
@ -57,5 +55,12 @@ namespace Aurora.RemoteImpl
LeavePartyResponse response = new LeavePartyResponse() { Status = PartyJoinedStatusEnum.Disconnected };
return Task.FromResult(response);
}
public override Task<MembersResponse> GetPartyMembers(Empty empty, Grpc.Core.ServerCallContext context)
{
MembersResponse response = new MembersResponse();
response.Members.AddRange(_partyMembers);
return Task.FromResult(response);
}
}
}