Starting work on Shared Files
This commit is contained in:
14
Relay.sln
14
Relay.sln
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelayClient", "RelayClient\
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelayServer", "RelayServer\RelayServer.csproj", "{38995780-E9AA-44D6-B62D-07CCA45E4E4C}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelayServer", "RelayServer\RelayServer.csproj", "{38995780-E9AA-44D6-B62D-07CCA45E4E4C}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RelayShared", "RelayShared\RelayShared.csproj", "{60B17B0B-9910-426A-9B48-AD9377AC89F7}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -55,6 +57,18 @@ Global
|
|||||||
{38995780-E9AA-44D6-B62D-07CCA45E4E4C}.Release|x64.Build.0 = Release|Any CPU
|
{38995780-E9AA-44D6-B62D-07CCA45E4E4C}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{38995780-E9AA-44D6-B62D-07CCA45E4E4C}.Release|x86.ActiveCfg = Release|Any CPU
|
{38995780-E9AA-44D6-B62D-07CCA45E4E4C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{38995780-E9AA-44D6-B62D-07CCA45E4E4C}.Release|x86.Build.0 = Release|Any CPU
|
{38995780-E9AA-44D6-B62D-07CCA45E4E4C}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{60B17B0B-9910-426A-9B48-AD9377AC89F7}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using WebSocketSharp;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Text.Json.Serialization.Metadata;
|
using System.Text.Json.Serialization.Metadata;
|
||||||
|
using RelayShared.Rtc;
|
||||||
|
|
||||||
namespace RelayClient;
|
namespace RelayClient;
|
||||||
|
|
||||||
|
|||||||
@@ -50,4 +50,8 @@
|
|||||||
<PackageReference Include="WebSocketSharp" Version="1.0.3-rc11" />
|
<PackageReference Include="WebSocketSharp" Version="1.0.3-rc11" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\RelayShared\RelayShared.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -13,4 +13,8 @@
|
|||||||
<PackageReference Include="WebSocketSharp" Version="1.0.3-rc11" />
|
<PackageReference Include="WebSocketSharp" Version="1.0.3-rc11" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\RelayShared\RelayShared.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
93
RelayShared/.gitignore
vendored
Normal file
93
RelayShared/.gitignore
vendored
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
############################################
|
||||||
|
# .NET Build
|
||||||
|
############################################
|
||||||
|
|
||||||
|
bin/
|
||||||
|
obj/
|
||||||
|
out/
|
||||||
|
publish/
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Visual Studio
|
||||||
|
############################################
|
||||||
|
|
||||||
|
.vs/
|
||||||
|
*.user
|
||||||
|
*.suo
|
||||||
|
*.userprefs
|
||||||
|
*.csproj.user
|
||||||
|
*.dbmdl
|
||||||
|
*.cache
|
||||||
|
*.pdb
|
||||||
|
*.opendb
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Rider / JetBrains
|
||||||
|
############################################
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
*.sln.iml
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# VSCode
|
||||||
|
############################################
|
||||||
|
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# NuGet
|
||||||
|
############################################
|
||||||
|
|
||||||
|
*.nupkg
|
||||||
|
*.snupkg
|
||||||
|
packages/
|
||||||
|
.nuget/
|
||||||
|
.nuget/packages/
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Logs
|
||||||
|
############################################
|
||||||
|
|
||||||
|
*.log
|
||||||
|
logs/
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# OS files
|
||||||
|
############################################
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Local secrets / environment
|
||||||
|
############################################
|
||||||
|
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
secrets.json
|
||||||
|
appsettings.Development.json
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# E2EE private keys
|
||||||
|
############################################
|
||||||
|
|
||||||
|
keys/*
|
||||||
|
!keys/.gitkeep
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Local test databases / data folders
|
||||||
|
############################################
|
||||||
|
|
||||||
|
data/
|
||||||
|
*.db
|
||||||
|
*.sqlite
|
||||||
|
*.sqlite3
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Temporary files
|
||||||
|
############################################
|
||||||
|
|
||||||
|
*.tmp
|
||||||
|
*.temp
|
||||||
|
*.bak
|
||||||
|
*.swp
|
||||||
9
RelayShared/Class1.cs
Normal file
9
RelayShared/Class1.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace RelayShared;
|
||||||
|
|
||||||
|
public class Class1
|
||||||
|
{
|
||||||
|
public Class1()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
13
RelayShared/RelayShared.csproj
Normal file
13
RelayShared/RelayShared.csproj
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="SurrealDb.Net" Version="0.9.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
97
RelayShared/Rtc/RtcModels.cs
Normal file
97
RelayShared/Rtc/RtcModels.cs
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
using SurrealDb.Net.Models;
|
||||||
|
|
||||||
|
namespace RelayShared.Rtc;
|
||||||
|
|
||||||
|
public class RtcSignalTypes
|
||||||
|
{
|
||||||
|
public const string Offer = "rtc_offer";
|
||||||
|
public const string Answer = "rtc_answer";
|
||||||
|
public const string Candidate = "rtc_candidate";
|
||||||
|
public const string OfferUpdated = "rtc_offer_updated";
|
||||||
|
public const string AnswerUpdated = "rtc_answer_updated";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RtcJoinRequest
|
||||||
|
{
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public required string Username { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class RtcSessionDescription
|
||||||
|
{
|
||||||
|
public required string Type { get; set; }
|
||||||
|
public required string Sdp { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RtcOffer : Record
|
||||||
|
{
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public required string Username { get; set; }
|
||||||
|
public required RtcSessionDescription SessionDescription { get; set; }
|
||||||
|
// public required string Type { get; set; }
|
||||||
|
// public required string Sdp { get; set; }
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
public DateTime UpdatedAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RtcLeaveRequest
|
||||||
|
{
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public required string Username { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RtcJoinResponse
|
||||||
|
{
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public bool HasActiveCall { get; set; }
|
||||||
|
public bool IsOfferer { get; set; }
|
||||||
|
public string? OfferUser { get; set; }
|
||||||
|
public string? OfferSdp { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RtcIceCandidate : Record
|
||||||
|
{
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public required string Username { get; set; }
|
||||||
|
public required string Candidate { get; set; }
|
||||||
|
public string? SdpMid { get; set; }
|
||||||
|
public int? SdpMLineIndex { get; set; }
|
||||||
|
// public required string Direction { get; set; } // "offer" or "answer"
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DBIceCandidate
|
||||||
|
{
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public required string Username { get; set; }
|
||||||
|
public required IceCandidate Candidate { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class IceCandidate
|
||||||
|
{
|
||||||
|
public required string candidate { get; set; }
|
||||||
|
public required string sdpMid { get; set; }
|
||||||
|
public required int sdpMLineIndex { get; set; }
|
||||||
|
public required string usernameFragment { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RtcAnswer : Record
|
||||||
|
{
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public required string OfferUser { get; set; }
|
||||||
|
public required string AnswerUser { get; set; }
|
||||||
|
public required string Sdp { get; set; }
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class RtcActiveCall : Record
|
||||||
|
{
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public string? OfferUser { get; set; }
|
||||||
|
public RtcSessionDescription? Offer { get; set; }
|
||||||
|
public RtcSessionDescription? Answer { get; set; }
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
public DateTime UpdatedAt { get; set; }
|
||||||
|
public bool IsActive { get; set; }
|
||||||
|
}
|
||||||
6
RelayShared/Rtc/RtcServices.cs
Normal file
6
RelayShared/Rtc/RtcServices.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace RelayShared.Rtc;
|
||||||
|
|
||||||
|
public class RtcServices
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user