Starting work on Shared Files
This commit is contained in:
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