diff --git a/Aurora.gtk/Aurora.gtk.csproj b/Aurora.gtk/Aurora.gtk.csproj index 570b39c..aba093d 100644 --- a/Aurora.gtk/Aurora.gtk.csproj +++ b/Aurora.gtk/Aurora.gtk.csproj @@ -1,5 +1,6 @@ + Debug @@ -110,6 +111,19 @@ ..\packages\LibVLCSharp.Forms.GTK.3.0.0\lib\net47\LibVLCSharp.Forms.Platforms.GTK.dll + + ..\packages\Google.Protobuf.3.8.0\lib\net45\Google.Protobuf.dll + + + ..\packages\System.Interactive.Async.3.2.0\lib\net46\System.Interactive.Async.dll + + + ..\packages\Grpc.Core.Api.1.21.0\lib\net45\Grpc.Core.Api.dll + + + + ..\packages\Grpc.Core.1.21.0\lib\net45\Grpc.Core.dll + @@ -463,4 +477,6 @@ + + \ No newline at end of file diff --git a/Aurora.gtk/packages.config b/Aurora.gtk/packages.config index 1d268c1..04695b6 100644 --- a/Aurora.gtk/packages.config +++ b/Aurora.gtk/packages.config @@ -1,5 +1,10 @@  + + + + + @@ -7,6 +12,7 @@ + diff --git a/Aurora/Aurora.csproj b/Aurora/Aurora.csproj index ad3b7f1..c6ad3b5 100644 --- a/Aurora/Aurora.csproj +++ b/Aurora/Aurora.csproj @@ -1,43 +1,94 @@ - - - - netstandard2.0 - true - - - - pdbonly - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Player.xaml - - + + + netstandard2.0 + true + + + pdbonly + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Player.xaml + + + + + + + \ No newline at end of file diff --git a/Aurora/Backend/Proto/PartyService/party.proto b/Aurora/Backend/Proto/PartyService/party.proto new file mode 100644 index 0000000..db844b7 --- /dev/null +++ b/Aurora/Backend/Proto/PartyService/party.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package Aurora.Backend.Proto; + +// PartyServic definition +service PartyService{ + //Party Service + rpc JoinParty(JoinPartyRequest) returns (JoinPartyResponse); + rpc LeaveParty(LeavePartyRequest) returns (LeavePartyResponse); +} + +message JoinPartyRequest { + string clientId = 1; + string userName = 2; + string ipAddress = 3; + string port = 4; +} + +message JoinPartyResponse { + PartyJoinedStatusEnum status = 1; +} + +message LeavePartyRequest { + string clientId = 1; +} + +message LeavePartyResponse { + PartyJoinedStatusEnum status = 1; +} + +enum PartyJoinedStatusEnum { + Connected = 0; + Disconnected = 1; +} diff --git a/Aurora/Backend/Proto/PlaybackService/playback.proto b/Aurora/Backend/Proto/PlaybackService/playback.proto new file mode 100644 index 0000000..8ed189a --- /dev/null +++ b/Aurora/Backend/Proto/PlaybackService/playback.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package Aurora.Backend.Proto; + +import "Backend/Proto/general.proto"; + +service PlaybackService { + //Playback Service + rpc GetPartyStream(Empty) returns (stream Chunk) {}; +} + +enum TransferStatusCode { + Unknown = 0; + Ok = 1; + Failed = 2; +} + +message TransferStatus { + string Message = 1; + TransferStatusCode Code = 2; +} \ No newline at end of file diff --git a/Aurora/Backend/Proto/general.proto b/Aurora/Backend/Proto/general.proto new file mode 100644 index 0000000..4ad5e7a --- /dev/null +++ b/Aurora/Backend/Proto/general.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package Aurora.Backend.Proto; + +message Chunk { + bytes Content = 1; +} + +message Empty{ +} \ No newline at end of file diff --git a/Aurora/Backend/Services/Server/PartyServiceImpl.cs b/Aurora/Backend/Services/Server/PartyServiceImpl.cs new file mode 100644 index 0000000..9367ad8 --- /dev/null +++ b/Aurora/Backend/Services/Server/PartyServiceImpl.cs @@ -0,0 +1,10 @@ +using System; +using Aurora.Backend.Proto; + +namespace Aurora.Backend.Services.Server +{ + class PartyServiceImpl : PartyService.PartyServiceBase + { + + } +} \ No newline at end of file diff --git a/Aurora/Backend/Services/Server/PlaybackServiceImpl.cs b/Aurora/Backend/Services/Server/PlaybackServiceImpl.cs new file mode 100644 index 0000000..33ba9f1 --- /dev/null +++ b/Aurora/Backend/Services/Server/PlaybackServiceImpl.cs @@ -0,0 +1,10 @@ +using System; +using Aurora.Backend.Proto; + +namespace Aurora.Backend.Services.Server +{ + class PlaybackServiceImpl : PlaybackService.PlaybackServiceBase + { + + } +} \ No newline at end of file diff --git a/Aurora/Backend/Services/Server/ServerService.cs b/Aurora/Backend/Services/Server/ServerService.cs new file mode 100644 index 0000000..4863621 --- /dev/null +++ b/Aurora/Backend/Services/Server/ServerService.cs @@ -0,0 +1,28 @@ +using System; +using Grpc.Core; +using Aurora.Backend.Proto; + +namespace Aurora.Backend.Services.Server +{ + public class ServerService : BaseService + { + const int Port = 50051; + public ServerService() + { + Grpc.Core.Server server = new Grpc.Core.Server + { + Services = { + PartyService.BindService(new PartyServiceImpl()), + PlaybackService.BindService(new PlaybackServiceImpl()) }, + Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } + }; + server.Start(); + + Console.WriteLine("Aurora server listening on port " + Port); + Console.WriteLine("Press any key to stop the server..."); + Console.ReadKey(); + + server.ShutdownAsync().Wait(); + } + } +} \ No newline at end of file