Skip to content

Commit

Permalink
Merge pull request #3 from Sky-CSC/ChampSelect
Browse files Browse the repository at this point in the history
New version champ select
  • Loading branch information
Sky-CSC authored Jan 26, 2023
2 parents d548fbe + f461d54 commit b8d51e3
Show file tree
Hide file tree
Showing 113 changed files with 33,061 additions and 23,312 deletions.
7 changes: 7 additions & 0 deletions OSL-Server/Communication/ServerHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public async Task SendPort(int port)
_logger.log(LoggingLevel.INFO, "SendPort()", $"Server port changed to : {port}");
AsyncServer.Run();
}
public static async Task SendPort()
{
_logger.log(LoggingLevel.INFO, "SendPort()", "A client ask to change the port");
AsyncServer.Stop();
_logger.log(LoggingLevel.INFO, "SendPort()", $"Server port changed to : {AsyncServer.portSocketOSLServer}");
AsyncServer.Run();
}


/// <summary>
Expand Down
322 changes: 216 additions & 106 deletions OSL-Server/Configuration/Config.cs

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions OSL-Server/Configuration/Overlay/ChampSelect/View1/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"DefaultPatch": "latest",
"DefaultRegion": "fr_fr",
"BlueSideTeamName": "",
"BlueTeamSubtext": "",
"BlueTeamNameColor": "#ffffff",
"BlueTeamSubtextColor": "#ffffff",
"BlueLogo": "",
"BlueSideTexteColor": "#ffffff",
"BlueSideBackgroudColor": "#0b849e",
"BlueSideBorderColor": "5px solid #FFFF00",
"BlueSideTimerBackgroudColor": "#0b849e",
"BlueSideTimerBorderColor": "5px solid #0000FF",
"BlueSideTimerTexteColor": "#ffffff",
"RedSideTeamName": "",
"RedTeamSubtext": "",
"RedTeamNameColor": "#ffffff",
"RedTeamSubtextColor": "#ffffff",
"RedLogo": "",
"RedSideTexteColor": "#ffffff",
"RedSideBackgroudColor": "#be1e37",
"RedSideBorderColor": "5px solid #FFFF00",
"RedSideTimerBackgroudColor": "#be1e37",
"RedSideTimerBorderColor": "5px solid #FF0000",
"RedSideTimerTexteColor": "#ffffff",
"BanBackgroundPicture": "../assets/champselect/banning-1.png",
"BanOverlayPicture": "../assets/champselect/ban-completed-2.png",
"BanBackgroundColor": "#010a13",
"OverlayBackground": "../assets/champselect/backgroud-view-1.png",
}
33 changes: 33 additions & 0 deletions OSL-Server/Configuration/Overlay/ChampSelect/View2/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"DefaultPatch": "latest",
"DefaultRegion": "fr_fr",
"TimerBackground": "#010a13",
"TimerBlue": "#0b849e",
"TimerRed": "#be1e37",
"TimerEnd": "linear-gradient(90deg, rgba(11,132,158,1) 0%, rgba(190,30,55,1) 100%)",
"BlueSideBackgroud": "#0b849e",
"BlueSideSummoner": "#ffffff",
"BlueSideBackgroudSummonerPick": "#0b849e",
"BlueSideBlink": "radial-gradient(ellipse, rgba(0, 0, 0, 0) 25%, #0b849e)",
"BlueSideBackgroudSummonerPickEnd": "#010a13",
"BlueSideTeamName": "",
"BlueSideTeamNameColor": "#ffffff",
"BlueSideTeamNameSize": "70px",
"KeystonePickColor": "linear-gradient(150deg, #0b849e 0%, #be1e37 100%)",
"KeystonePickColorDeg": "150",
"KeystonePickColor1": "#0b849e",
"KeystonePickColorPercent1": "0",
"KeystonePickColor2": "#be1e37",
"KeystonePickColorPercent2": "100",
"RedSideBackgroud": "#be1e37",
"RedSideSummoner": "#ffffff",
"RedSideBackgroudSummonerPick": "#be1e37",
"RedSideBlink": "radial-gradient(ellipse, rgba(0, 0, 0, 0) 25%, #be1e37)",
"RedSideBackgroudSummonerPickEnd": "#010a13",
"RedSideTeamName": "",
"RedSideTeamNameColor": "#ffffff",
"RedSideTeamNameSize": "70px",
"BanBackgroundPicture": "../assets/champselect/banning-1.png",
"BanOverlayPicture": "../assets/champselect/ban-completed-2.png",
"BanBackgroundColor": "#010a13",
}
33 changes: 33 additions & 0 deletions OSL-Server/Configuration/Overlay/ChampSelect/View3/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"DefaultPatch": "latest",
"DefaultRegion": "fr_fr",
"TimerBackground": "#010a13",
"TimerBlue": "#0b849e",
"TimerRed": "#be1e37",
"TimerEnd": "linear-gradient(90deg, rgba(11,132,158,1) 0%, rgba(190,30,55,1) 100%)",
"BlueSideBackgroud": "#0b849e",
"BlueSideSummoner": "#ffffff",
"BlueSideBackgroudSummonerPick": "#0b849e",
"BlueSideBlink": "radial-gradient(ellipse, rgba(0, 0, 0, 0) 25%, #0b849e)",
"BlueSideBackgroudSummonerPickEnd": "#010a13",
"BlueSideTeamName": "",
"BlueSideTeamNameColor": "#ffffff",
"BlueSideTeamNameSize": "20px",
"KeystonePickColor": "linear-gradient(150deg, #0b849e 0%, #be1e37 100%)",
"KeystonePickColorDeg": "150",
"KeystonePickColor1": "#0b849e",
"KeystonePickColorPercent1": "0",
"KeystonePickColor2": "#be1e37",
"KeystonePickColorPercent2": "100",
"RedSideBackgroud": "#be1e37",
"RedSideSummoner": "#ffffff",
"RedSideBackgroudSummonerPick": "#be1e37",
"RedSideBlink": "radial - gradient(ellipse, rgba(0, 0, 0, 0) 25 %, #be1e37)",
"RedSideBackgroudSummonerPickEnd": "#010a13",
"RedSideTeamName": "",
"RedSideTeamNameColor": "#ffffff",
"RedSideTeamNameSize": "20px",
"BanBackgroundPicture": "../assets/champselect/banning-1.png",
"BanOverlayPicture": "../assets/champselect/ban-completed-2.png",
"BanBackgroundColor": "#010a13",
}
33 changes: 33 additions & 0 deletions OSL-Server/Configuration/Overlay/ChampSelect/View4/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"DefaultPatch": "latest",
"DefaultRegion": "fr_fr",
"BorderBottomPixel": "5px solid",
"BorderTop": "5px solid #FFFF00",
"BackgroudGradient": "linear-gradient(150deg, #0b849e 0%, #be1e37 100%)",
"BackgroudGradientDeg": "150",
"BackgroudGradientColor1": "#0b849e",
"BackgroudGradientPercent1": "0",
"BackgroudGradientColor2": "#be1e37",
"BackgroudGradientPercent2": "100",
"OverlayColorBackgroudGradient": "linear-gradient( to right, rgba(0, 0, 0, 0.83) 0%, rgba(0, 0, 0, 0.72) 50%, rgba(0, 0, 0, 0.83) 100% )",
"BlueSideBorderColorPick": "2px solid #0b849e",
"BlueSideBorderColorBan": "2px solid #0b849e",
"BlueSideTeamName": "",
"BlueSideTeamNameSubtext": "",
"BlueSideBanText": "BANS",
"BlueSidePickText": "PICK",
"BlueSideColorText": "#0b849e",
"BlueSideColorSubText": "#0b849e",
"BlueSideColorTextBan": "#0b849e",
"BlueSideColorTextPick": "#0b849e",
"RedSideBorderColorPick": "2px solid #be1e37",
"RedSideBorderColorBan": "2px solid #be1e37",
"RedSideTeamName": "",
"RedSideTeamNameSubtext": "",
"RedSideBanText": "BANS",
"RedSidePickText": "PICK",
"RedSideColorText": "#be1e37",
"RedSideColorSubText": "#be1e37",
"RedSideColorTextBan": "#be1e37",
"RedSideColorTextPick": "#be1e37",
}
28 changes: 0 additions & 28 deletions OSL-Server/Configuration/configChampSelectView1.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public static void InChampSelect(string content)
ChampSelectTimer.phaseTimer.Stop();
ChampSelectTimer.DecreasingTimerChapSelect(180);
ChampSelectTimer.phaseTimerFast.Stop();
ChampSelectTimer.DecreasingTimerChapSelectFast(1750, 96);
ChampSelectTimer.DecreasingTimerChapSelectFast(1750, 103);
ChampSelectTimer.phaseTimerView3.Stop();
ChampSelectTimer.DecreasingTimerChapSelectView3(1920, 94);
}
else
{
Expand Down Expand Up @@ -63,6 +65,8 @@ public static void InChampSelect(string content)
ChampSelectTimer.DecreasingTimerChapSelect(27);
ChampSelectTimer.phaseTimerFast.Stop();
ChampSelectTimer.DecreasingTimerChapSelectFast(1750, 1);
ChampSelectTimer.phaseTimerView3.Stop();
ChampSelectTimer.DecreasingTimerChapSelectView3(1920, 1);
}
}
else
Expand All @@ -71,6 +75,8 @@ public static void InChampSelect(string content)
ChampSelectTimer.DecreasingTimerChapSelect(27);
ChampSelectTimer.phaseTimerFast.Stop();
ChampSelectTimer.DecreasingTimerChapSelectFast(1750, 1);
ChampSelectTimer.phaseTimerView3.Stop();
ChampSelectTimer.DecreasingTimerChapSelectView3(1920, 1);
}
}
}
Expand All @@ -82,7 +88,9 @@ public static void InChampSelect(string content)
ChampSelectTimer.phaseTimer.Stop();
ChampSelectTimer.DecreasingTimerChapSelect(59);
ChampSelectTimer.phaseTimerFast.Stop();
ChampSelectTimer.DecreasingTimerChapSelectFast(1750, 32);
ChampSelectTimer.DecreasingTimerChapSelectFast(1750, 34);
ChampSelectTimer.phaseTimerView3.Stop();
ChampSelectTimer.DecreasingTimerChapSelectView3(1920, 31);
alreadyLastPhase = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ public class ChampSelectTimer
public static int gobalTimer = 0;
public static int phaseTime = 5;
public static int phaseTimeFast = 1750;
public static int phaseTimeView3 = 1920;
public static System.Timers.Timer phaseTimer;
public static System.Timers.Timer phaseTimerFast;
public static System.Timers.Timer phaseTimerView3;
/// <summary>
/// Update timer (second display)
/// </summary>
Expand Down Expand Up @@ -42,6 +44,21 @@ private static void OnTimedEventFast(object source, ElapsedEventArgs e)
}
}

/// <summary>
/// Update timer (pixel display)
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
private static void OnTimedEventView3(object source, ElapsedEventArgs e)
{
phaseTimeView3--;
if (phaseTimeView3 <= 0)
{
phaseTimeView3 = 0;
phaseTimerView3.Stop();
}
}

/// <summary>
/// Decreasing timer function (second display)
/// </summary>
Expand All @@ -68,5 +85,19 @@ public static void DecreasingTimerChapSelectFast(int time, int interval)
phaseTimerFast.Interval = interval;
phaseTimerFast.Enabled = true;
}

/// <summary>
/// Decreasing timer function (pixel display)
/// </summary>
/// <param name="time"></param>
/// <param name="interval"></param>
public static void DecreasingTimerChapSelectView3(int time, int interval)
{
phaseTimeView3 = time;
phaseTimerView3 = new System.Timers.Timer();
phaseTimerView3.Elapsed += new ElapsedEventHandler(OnTimedEventView3);
phaseTimerView3.Interval = interval;
phaseTimerView3.Enabled = true;
}
}
}
11 changes: 5 additions & 6 deletions OSL-Server/OSL-Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,23 @@
<ApplicationIcon>Icone_Eau.ico</ApplicationIcon>
<Copyright>Sky-csc</Copyright>
<PackageProjectUrl>https://github.com/Sky-CSC/OSL</PackageProjectUrl>
<AssemblyVersion>0.1.0</AssemblyVersion>
<FileVersion>0.1.0</FileVersion>
<Version>0.1.0-alpha</Version>
<AssemblyVersion>0.2.0</AssemblyVersion>
<FileVersion>0.2.0</FileVersion>
<Version>0.2.0-alpha</Version>
</PropertyGroup>

<ItemGroup>
<Content Remove="Configuration\configCDragon.json" />
<Content Remove="Configuration\configChampSelectView1.json" />
<Content Remove="Configuration\configChampSelectView2.json" />
<Content Remove="Configuration\configChampSelectView3.json" />
</ItemGroup>

<ItemGroup>
<Content Include="Icone_Eau.ico" />
</ItemGroup>

<ItemGroup>
<None Include="Configuration\configChampSelectView1.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Configuration\configCDragon.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
16 changes: 4 additions & 12 deletions OSL-Server/Pages/CDragonPage.razor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using Microsoft.AspNetCore.Components.Forms;
using OSL_Server.DataLoader.CDragon;
using OSL_Server.Download;
using OSL_Server.DataLoader.CDragon;

namespace OSL_Server.Pages
{
Expand All @@ -12,14 +9,9 @@ public partial class CDragonPage
{
private static OSLLogger _logger = new OSLLogger("CDragonPage");

public string Message { get; private set; } = "PageModel in C#";

public void OnGet()
{
Message = $"Server time is {CDragon.patch}";
Console.WriteLine(Message);
}

/// <summary>
/// Launch on thread download of last version of league of legends data
/// </summary>
public static void UpdateManual()
{
_logger.log(LoggingLevel.INFO, "UpdateManual()", "Update in progress");
Expand Down
Loading

0 comments on commit b8d51e3

Please sign in to comment.