Refactored to only having one executor per platform
This commit is contained in:
@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using Aurora.Backend.Executors;
|
||||
using Aurora.Frontend.Components.HostSelector;
|
||||
using Aurora.Backend.Services;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Aurora.Frontend.Views.Party
|
||||
@ -19,7 +20,7 @@ namespace Aurora.Frontend.Views.Party
|
||||
|
||||
private PartyState _state;
|
||||
|
||||
private BasePartyExecutor _executor;
|
||||
private BaseExecutor _executor;
|
||||
|
||||
private string _hostname;
|
||||
|
||||
@ -91,7 +92,9 @@ namespace Aurora.Frontend.Views.Party
|
||||
#region Commands
|
||||
private void OnJoinExecute()
|
||||
{
|
||||
_executor = BaseExecutor.CreateExecutor<BasePartyExecutor>(ExecutorType.Client) as BasePartyExecutor;
|
||||
_executor = BaseExecutor.CreateExecutor<ClientExecutor>();
|
||||
Int32.TryParse(this.Port, out int intPort);
|
||||
_executor.Initialize();
|
||||
State(PartyState.Connecting);
|
||||
}
|
||||
|
||||
@ -102,7 +105,19 @@ namespace Aurora.Frontend.Views.Party
|
||||
|
||||
private void OnHostExecute()
|
||||
{
|
||||
_executor = BaseExecutor.CreateExecutor<BasePartyExecutor>(ExecutorType.Server) as BasePartyExecutor;
|
||||
Int32.TryParse(this.Port, out int intPort);
|
||||
//Init gRPC server
|
||||
ServerService.Instance.Initialize(this.Hostname, intPort);
|
||||
|
||||
//Instantiate and initialize all executors
|
||||
_executor = BaseExecutor.CreateExecutor<HostExecutor>();
|
||||
_executor.Initialize();
|
||||
|
||||
//start gRPC server
|
||||
|
||||
ServerService.Instance.Start();
|
||||
|
||||
//Change state
|
||||
State(PartyState.Connecting);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user