Skip to content

Commit

Permalink
Backup
Browse files Browse the repository at this point in the history
  • Loading branch information
boonkerz committed Sep 17, 2018
1 parent fbe872d commit fa70ce1
Show file tree
Hide file tree
Showing 24 changed files with 914 additions and 6,415 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[Bb]in/
packages/
TestResults/
.vs/

# globs
Makefile.in
Expand Down
4 changes: 0 additions & 4 deletions Broker/ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
<ItemGroup>
<ProjectReference Include="..\..\Core\Network\Network.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Terminal.Gui" Version="0.16.0" />
</ItemGroup>
</Project>
37 changes: 14 additions & 23 deletions Broker/ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using LiteNetLib;
using Network.Thread;
using Terminal.Gui;

namespace TeamScreen.Broker.ConsoleApp
{
Expand All @@ -11,40 +10,32 @@ class Program

static void Main(string[] args)
{
var ml = new Label(new Rect(3, 17, 47, 1), "");


Manager.Events.onPeerConnected += delegate (object sender, EventArgs eventArgs)
{
NetPeer peer = (NetPeer)sender;
ml.Text = "Peer connected: " + peer.EndPoint;
Console.WriteLine("Peer connected: " + peer.EndPoint);
};

Manager.Start();


Application.Init();
var top = Application.Top;

var menu = new MenuBar(new MenuBarItem[] {
new MenuBarItem ("_File", new MenuItem [] {
new MenuItem ("_Quit", "", () => { if (Quit ()) top.Running = false; })
})
});
// important!!!
Console.TreatControlCAsInput = true;

top.Add(menu);
while (true)
{
Console.WriteLine("Use CTRL+C to exit");
var input = Console.ReadKey();

var win = new Window(new Rect(0, 1, top.Frame.Width, top.Frame.Height - 1), "TeamScreen Broker");
top.Add(win);
win.Add(ml);

Application.Run();
if (input.Key == ConsoleKey.C && input.Modifiers == ConsoleModifiers.Control)
{
break;
}
}

}

static bool Quit()
{
var n = MessageBox.Query(50, 7, "Quit TeamScreen Broker", "Are you sure you want to quit?", "Yes", "No");
return n == 0;
}

}
}
19 changes: 19 additions & 0 deletions BrokerDockerImage
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM microsoft/dotnet:sdk AS build-env
WORKDIR /app
COPY Broker /app/Broker
COPY packages /app/packages
COPY Core /app/Core


RUN dotnet restore Broker/ConsoleApp
RUN dotnet publish -c Release -o out Broker/ConsoleApp


# Build runtime image
FROM microsoft/dotnet:runtime
WORKDIR /app
COPY --from=build-env /app/Broker/ConsoleApp/out .

ENTRYPOINT ["dotnet", "ConsoleApp.dll"]

EXPOSE 9050
3 changes: 2 additions & 1 deletion Client/ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
 using System;
using Network.Thread;

namespace ConsoleApp
Expand Down Expand Up @@ -28,6 +28,7 @@ static void Main(string[] args)
break;
}
}
System.Threading.Thread.Sleep(10);
}
}
}
Expand Down
31 changes: 16 additions & 15 deletions Client/Win/TeamScreenClientPortable/RemoteForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fa70ce1

Please sign in to comment.