From b258ec6a17b766342f25d60e3fd77df03a9811ae Mon Sep 17 00:00:00 2001 From: BSRevival Date: Tue, 28 May 2024 01:38:34 -0700 Subject: [PATCH] Update data versions Serve file format in expected response for serverList.xml Fix authentication urls Add GetUidMicaQueue Check Tunnelling. Add Passport Controller pre-emptively Update proxycontrol for additional urls add userProtocol_en_v005.txt --- .../Controllers/FileController.cs | 18 ++++ .../Controllers/IndexController.cs | 31 +++++-- .../Controllers/PassportController.cs | 18 ++++ Elisa.GameServer/Elisa.GameServer.csproj | 3 + Elisa.GameServer/GameServer.cs | 4 +- .../Properties/launchSettings.json | 4 +- Elisa.GameServer/ProxyControl.cs | 85 +++++++++++++++++- Elisa.GameServer/Resources/serverList.xml | 90 +++++++++---------- .../Resources/userProtocol_en_v005.txt | 1 + 9 files changed, 192 insertions(+), 62 deletions(-) create mode 100644 Elisa.GameServer/Controllers/FileController.cs create mode 100644 Elisa.GameServer/Controllers/PassportController.cs create mode 100644 Elisa.GameServer/Resources/userProtocol_en_v005.txt diff --git a/Elisa.GameServer/Controllers/FileController.cs b/Elisa.GameServer/Controllers/FileController.cs new file mode 100644 index 0000000..cacc5be --- /dev/null +++ b/Elisa.GameServer/Controllers/FileController.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Elisa.GameServer.Controllers; + +public class FileController : Controller +{ + [HttpGet("image/imageconfig.txt", Name = "ImageConfig")] + public async Task ImageConfig() + { + return Results.Text(System.IO.File.ReadAllText(@"Resources\image\ImageConfig.txt")); + } + + [HttpGet("userProtocol_en_v005.txt", Name = "Terms Of Service")] + public async Task TermsOfService() + { + return Results.Text(System.IO.File.ReadAllText(@"Resources\userProtocol_en_v005.txt")); + } +} \ No newline at end of file diff --git a/Elisa.GameServer/Controllers/IndexController.cs b/Elisa.GameServer/Controllers/IndexController.cs index f591230..197d663 100644 --- a/Elisa.GameServer/Controllers/IndexController.cs +++ b/Elisa.GameServer/Controllers/IndexController.cs @@ -8,10 +8,13 @@ public class IndexController : Controller [HttpPost("index.php", Name = "ServerList")] public async Task ServerList() { - return Results.Text(System.IO.File.ReadAllText(@"Resources\serverList.xml")); + //read the serverlist + var text = System.IO.File.ReadAllText(@"Resources\serverList.xml"); + + return Results.Content(text, "text/html"); } - [HttpGet("index.php/1001/index/version", Name = "Version")] + [HttpPost("index.php/1001/index/version", Name = "Version")] public async Task Version([FromQuery] string req_id) { return Results.Json(new @@ -26,16 +29,28 @@ public class IndexController : Controller ab_version = GameServer.ABVersion, is_kick = "0", weekday = 1, - authentication_url = $"http://realauth.ucenter.ppgame.com/authoriz.html?appid={0}&openid={1}&accounttype=1&language=zh" + authentication_url = @"http://realauth.ucenter.ppgame.com/authoriz.html?appid={0}&openid={1}&accounttype=1&language=zh" }); } - - [HttpGet("image/imageconfig.txt", Name = "ImageConfig")] - public async Task ImageConfig() + [HttpPost("index.php/1001/index/getUidEnMicaQueue", Name = "GetUidMicaQueue")] + public async Task GetUidMicaQueue([FromQuery] string req_id) { - return Results.Text(System.IO.File.ReadAllText(@"Resources\image\ImageConfig.txt")); + return Results.Json(new + { + uid = "9303", + sign = "1f8063d3eb961af28f3fa5b90e9d3ba0", + is_username_exist = true, + real_name = 0, + authentication_url = @"http://realauth.ucenter.ppgame.com/authoriz.html?appid={0}&openid={1}&accounttype=1&language=zh", + tc_order_retry = 0 + }); + } + [HttpPost("index.php/1001/index/Index", Name = "Index")] + public async Task Index([FromQuery] string req_id) + { + return Results.Json(new + { }); } - /* [Route("{*url}")] public async Task HandleAll(string url) diff --git a/Elisa.GameServer/Controllers/PassportController.cs b/Elisa.GameServer/Controllers/PassportController.cs new file mode 100644 index 0000000..aabdb15 --- /dev/null +++ b/Elisa.GameServer/Controllers/PassportController.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Elisa.GameServer.Controllers; + +public class PassportController : Controller +{ + [HttpPost("/passport/userProtocol", Name = "UserProtocol")] + public async Task UserProtocol() + { + return Results.Json(new + { + user_protocol = "http://127.0.0.1/userProtocol_en_v005.txt", + delete_protocol = "http://127.0.0.1/passport/deleteProtocol", + delete_notice= @"

1.Please perform this on a safe and frequently-used network and devices.

2.If there are any unused paid services or virtual currency on the linked accounts, they will all be lost along with the account. All game account information on the Sunborn Network will be deleted, so please take care when performing this action.

3.Please read the Deletion Terms below carefully. Your account cannot be restored once it is deleted, so please consider your decision carefully.

", + twitter_disable = true + }); + } +} \ No newline at end of file diff --git a/Elisa.GameServer/Elisa.GameServer.csproj b/Elisa.GameServer/Elisa.GameServer.csproj index 4740ae2..9883449 100644 --- a/Elisa.GameServer/Elisa.GameServer.csproj +++ b/Elisa.GameServer/Elisa.GameServer.csproj @@ -33,6 +33,9 @@ PreserveNewest + + Always + diff --git a/Elisa.GameServer/GameServer.cs b/Elisa.GameServer/GameServer.cs index d8deac6..c1da81a 100644 --- a/Elisa.GameServer/GameServer.cs +++ b/Elisa.GameServer/GameServer.cs @@ -11,8 +11,8 @@ namespace Elisa.GameServer; public static class GameServer { public static string ClientVersion = 30400.ToString(); - public static string DataVersion = "d630eea53a1b869fa4d7d1479a3d09e7"; - public static string ABVersion = 2024051417.ToString(); + public static string DataVersion = "4e7d9f82634fd8c557600524b55c8efe"; + public static string ABVersion = 2024052719.ToString(); public static void Main(string[] args) { diff --git a/Elisa.GameServer/Properties/launchSettings.json b/Elisa.GameServer/Properties/launchSettings.json index edc61ef..195205d 100644 --- a/Elisa.GameServer/Properties/launchSettings.json +++ b/Elisa.GameServer/Properties/launchSettings.json @@ -14,7 +14,7 @@ "dotnetRunMessages": true, "launchBrowser": false, "launchUrl": "swagger", - "applicationUrl": "http://127.0.0.1", + "applicationUrl": "https://127.0.0.1;http://127.0.0.1;", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -24,7 +24,7 @@ "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "https://localhost:7010;http://localhost:5208", + "applicationUrl": "https://localhost:443;http://localhost:80", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/Elisa.GameServer/ProxyControl.cs b/Elisa.GameServer/ProxyControl.cs index 8029dc2..806702a 100644 --- a/Elisa.GameServer/ProxyControl.cs +++ b/Elisa.GameServer/ProxyControl.cs @@ -8,18 +8,28 @@ namespace Elisa.GameServer; public class ProxyControl { - static readonly Regex HostFilter = new Regex("(.*).(girlfrontline\\.co\\.kr|ppgame\\.com|txwy\\.tw|sunborngame\\.com|aihelp.net.cn).*"); + static readonly Regex HostFilter = new Regex("(.*).(girlfrontline\\.co\\.kr|ppgame\\.com|txwy\\.tw|sunborngame\\.com|aihelp\\.net).*"); + static readonly Regex AWSFilter = new Regex(@"s3.*.amazonaws.com"); + static readonly Regex DLlistFilter = new Regex(@"dl.listdl.com"); readonly string forwardIpAddress; readonly ProxyServer proxyServer; readonly ExplicitProxyEndPoint explicitEndPoint; - public ProxyControl(string forwardIpAddress, int port = 9000) + public ProxyControl(string forwardIpAddress, int port = 8888) { this.forwardIpAddress = forwardIpAddress; proxyServer = new ProxyServer(); explicitEndPoint = new ExplicitProxyEndPoint(System.Net.IPAddress.Any, port, true); - + proxyServer.BeforeRequest += OnRequest; + //Ssl handling + explicitEndPoint.BeforeTunnelConnectRequest += OnBeforeTunnelConnectRequest; + + /* + proxyServer.ServerCertificateValidationCallback += OnCertificateValidation; + proxyServer.ClientCertificateSelectionCallback += OnCertificateSelection; + */ + } public void Start() @@ -34,11 +44,61 @@ public class ProxyControl public void Stop() { proxyServer.BeforeRequest -= OnRequest; + //Ssl Handling + /*proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation; + proxyServer.ClientCertificateSelectionCallback -= OnCertificateSelection; + */ + + explicitEndPoint.BeforeTunnelConnectRequest -= OnBeforeTunnelConnectRequest; + proxyServer.Stop(); } + private async Task OnBeforeTunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e) + { + string hostname = e.HttpClient.Request.RequestUri.Host; + //show the hostname + Log.Information($"Tunnel Connect Request for {hostname}"); + //Forward to our domain --this doesn't work + /* + if (HostFilter.IsMatch(hostname) || AWSFilter.IsMatch(hostname) || DLlistFilter.IsMatch(hostname)) + { + Log.Information($"Forwarding tunnel connect request for {hostname} to {forwardIpAddress}"); + e.DecryptSsl = true; + e.HttpClient.Request.RequestUri = new Uri("https://" + forwardIpAddress); + + }*/ + if (hostname.Contains("gf-passport.sunborngame.com")) + { + // Exclude Https addresses you don't want to proxy + // Useful for clients that use certificate pinning + // for example dropbox.com + e.DecryptSsl = false; + } + + } + public Task OnCertificateValidation(object sender, CertificateValidationEventArgs e) + { + // set IsValid to true/false based on Certificate Errors + //if (e.SslPolicyErrors == System.Net.Security.SslPolicyErrors.None) + e.IsValid = true; + + return Task.CompletedTask; + } + +// Allows overriding default client certificate selection logic during mutual authentication + public Task OnCertificateSelection(object sender, CertificateSelectionEventArgs e) + { + // set e.clientCertificate to override + return Task.CompletedTask; + } private async Task OnRequest(object sender, SessionEventArgs e) { + if (e.IsHttps) + { + Log.Information("HTTPS request detected, skipping"); + return; + } Uri requestUri = e.HttpClient.Request.RequestUri; if (HostFilter.IsMatch(requestUri.Host)) { @@ -51,5 +111,24 @@ public class ProxyControl // Bubble it out to user } + //Test for aws + else if (AWSFilter.IsMatch(requestUri.Host)) + { + Log.Information($"Forwarding AWS request for {requestUri} to {forwardIpAddress}"); + + Uri newUri = new Uri("http://" + forwardIpAddress + requestUri.PathAndQuery, UriKind.Absolute); + Log.Information($"Forwarded request to {newUri}"); + + e.HttpClient.Request.RequestUri = newUri; + } + else if (DLlistFilter.IsMatch(requestUri.Host)) + { + Log.Information($"Forwarding DLList request for {requestUri} to {forwardIpAddress}"); + + Uri newUri = new Uri("http://" + forwardIpAddress + requestUri.PathAndQuery, UriKind.Absolute); + Log.Information($"Forwarded request to {newUri}"); + + e.HttpClient.Request.RequestUri = newUri; + } } } diff --git a/Elisa.GameServer/Resources/serverList.xml b/Elisa.GameServer/Resources/serverList.xml index 9838810..272ac3a 100644 --- a/Elisa.GameServer/Resources/serverList.xml +++ b/Elisa.GameServer/Resources/serverList.xml @@ -1,19 +1,17 @@ - GRIFFIN - http://127.0.0.1/ + http://127.0.0.1/index.php/1001/ 1001 0 0 0 0 - 2024051417 - 1714705161 + 2024052719 + 1715129630 1 - http://127.0.0.1/pages/notice http://127.0.0.1/pages/update_url @@ -22,80 +20,78 @@ 30400 https://play.google.com/store/apps/details?id=com.sunborn.girlsfrontline.en 20410 - - v.3.0400 Update Content: + v.3.0400 Update Content: - [Mobile Armor System Optimizations] + [Mobile Armor System Optimizations] - 1. Optimized: The "Mobile Armor" combat results screen now shows the remaining HP and other such info of the Mobile Armor units in question. An option to "Armor Enhancement" has been added to the Mission Failed screen. + 1. Optimized: The "Mobile Armor" combat results screen now shows the remaining HP and other such info of the Mobile Armor units in question. An option to "Armor Enhancement" has been added to the Mission Failed screen. - 2. Optimized: If a Mobile Armor 4unit is not "In Combat", Fire Support Units assigned to the armor in question can be independently deployed as normal. + 2. Optimized: If a Mobile Armor unit is not "In Combat", Fire Support Units assigned to the armor in question can be independently deployed as normal. - 3. Optimized: The "Tech Tree" display of the Mobile Armor system now features a before and after display of effects when activating certain nodes. + 3. Optimized: The "Tech Tree" display of the Mobile Armor system now features a before and after display of effects when activating certain nodes. - 4. Optimized: Mobile Armor support skills are now labelled with the [Support] tag. + 4. Optimized: Mobile Armor support skills are now labelled with the [Support] tag. - 5. Optimized: The Armor Design Shop's item preview function now adds an indication that an item is being previewed, as well as showing if a certain mobile armor design will clash with others. You can also instantly purchase a desired item after trying it out. Changing an armor's degisn blueprint no longer clears out equipped designs. + 5. Optimized: The Armor Design Shop's item preview function now adds an indication that an item is being previewed, as well as showing if a certain mobile armor design will clash with others. You can also instantly purchase a desired item after trying it out. Changing an armor's degisn blueprint no longer clears out equipped designs. - The "Armor Design" set display mode has also been added. You may use this function to preview the look of a scerain set of armor designs as well as purchase it immediately. + The "Armor Design" set display mode has also been added. You may use this function to preview the look of a scerain set of armor designs as well as purchase it immediately. - The "Armor Design" purchase screen has been made easier to use. + The "Armor Design" purchase screen has been made easier to use. - The arrangement of items in the "Armor Design" blueprint display screen has been improved. + The arrangement of items in the "Armor Design" blueprint display screen has been improved. - 6. Optimized: Information display for non-generic components has been improved and the equip screen has been mae easier to use. + 6. Optimized: Information display for non-generic components has been improved and the equip screen has been mae easier to use. - 7. Optimized: Information display and filtering for generic components has been improved. + 7. Optimized: Information display and filtering for generic components has been improved. - [Other New Content] + [Other New Content] - 1. Added: "Armored Assault" mode in "Gray Zone Exploration" now has the "Sweep" function. If you have already cleared up to a certain point in the stage, you can click "Sweep" to expend attempts to directly obtain the stage rewards. + 1. Added: "Armored Assault" mode in "Gray Zone Exploration" now has the "Sweep" function. If you have already cleared up to a certain point in the stage, you can click "Sweep" to expend attempts to directly obtain the stage rewards. - 2. Added: The "Gray Zone Exploration" system now features a new Proxy Planning function. At the "Echelon Formation" or the "Gray Zone Exploration" difficulty select, you can click the newly-added "Echelon Pre-Select" button to enter the echelon pre-selection screen. - On this screen, you can edit and select echelons for use in Proxy Battle mode, as well as deciding whether the echelons in question will take part in day or night battles. - Once you have finished editing, selected and activated your pre-selected echelons, the system will only use these echelons or units during Proxy Battle mode. + 2. Added: The "Gray Zone Exploration" system now features a new Proxy Planning function. At the "Echelon Formation" or the "Gray Zone Exploration" difficulty select, you can click the newly-added "Echelon Pre-Select" button to enter the echelon pre-selection screen. + On this screen, you can edit and select echelons for use in Proxy Battle mode, as well as deciding whether the echelons in question will take part in day or night battles. + Once you have finished editing, selected and activated your pre-selected echelons, the system will only use these echelons or units during Proxy Battle mode. - 3. Added: Combat Simulations now have the "Sweep" function. During "EXP Mode", "Data Mode", "Capsule Mode", "Neural Cloud Corridor" and "Coalition Drill, you can select the number of times you want to sweep the simulation in question and press the "Sweep" button to expend the corresponding amount of attempts and gain the appropriate materials as rewards. + 3. Added: Combat Simulations now have the "Sweep" function. During "EXP Mode", "Data Mode", "Capsule Mode", "Neural Cloud Corridor" and "Coalition Drill, you can select the number of times you want to sweep the simulation in question and press the "Sweep" button to expend the corresponding amount of attempts and gain the appropriate materials as rewards. - 4. Added: The "Echelon Formation" screen now has a Share function. By clicking the "Share" button, you can convert your current echelon's data into a bar code or QR code which can be shared with other Commanders. This code can be used by other Commanders to reproduce your echelon. - This function is not currently available for vehicle echelons. - - 5. Added: The "Search" function has ben aded to the unit display screen. You can enter keywords to search for units which meet the criteria. + 4. Added: The "Echelon Formation" screen now has a Share function. By clicking the "Share" button, you can convert your current echelon's data into a bar code or QR code which can be shared with other Commanders. This code can be used by other Commanders to reproduce your echelon. + This function is not currently available for vehicle echelons. - 6. Added: The "Favorite" function has been added to unit detail pages. By clicking it, you can favorite the unit in question, which enables the filter option "Only show favorited" units. + 5. Added: The "Search" function has ben aded to the unit display screen. You can enter keywords to search for units which meet the criteria. - 7. Added: The armor components "Vehicle Shotgun", "Mini Mortar", "Laser Rangefinder", "Camouflage Netting", "Top Slat Armor" can be obtained through exploring the "Vitrified - Hell" region during "Gray Zone Exploration". + 6. Added: The "Favorite" function has been added to unit detail pages. By clicking it, you can favorite the unit in question, which enables the filter option "Only show favorited" units. - [Other Optimizations] + 7. Added: The armor components "Vehicle Shotgun", "Mini Mortar", "Laser Rangefinder", "Camouflage Netting", "Top Slat Armor" can be obtained through exploring the "Vitrified - Hell" region during "Gray Zone Exploration". - 1. Optimized: The "Repair All " option now includes Fire Support Units and Mobile Armors. + [Other Optimizations] - 2. Optimized: Mid-battle nformation display for Fire Support Units has been improved. You can view information on Fire Support Units and Mobile Armors units by clicking and holding on them. + 1. Optimized: The "Repair All " option now includes Fire Support Units and Mobile Armors. - 3. Optimized: The post-mission reward display screen in Gray Zone Exploration has been tweaked. + 2. Optimized: Mid-battle nformation display for Fire Support Units has been improved. You can view information on Fire Support Units and Mobile Armors units by clicking and holding on them. - 4. Optimized: The overall functional experience of the Proxy Battle system in Gray Zone Exploration has been improved. + 3. Optimized: The post-mission reward display screen in Gray Zone Exploration has been tweaked. - 5. Optimized: The Chip Enhancement system for Fire Support Units has been improved. The Chip Enhancement screen now has options to "Max-Enhance One Chip" and "Max-Enhance Multiple Chips". + 4. Optimized: The overall functional experience of the Proxy Battle system in Gray Zone Exploration has been improved. - 6. Optimized: Data display for "Equipment" has been improved. A special equipment buff tab has been added for the equipment detail display screen. + 5. Optimized: The Chip Enhancement system for Fire Support Units has been improved. The Chip Enhancement screen now has options to "Max-Enhance One Chip" and "Max-Enhance Multiple Chips". - 7. Optimized: The Echelon Formation screen now gives the option to select multiple echelons at once. Also, certain Fire Support Units selection screens allow you to select multiple Fire Support Units at once. + 6. Optimized: Data display for "Equipment" has been improved. A special equipment buff tab has been added for the equipment detail display screen. - 8. Optimized: The maximum amount of Surplus EXP that can be held at one time has been increased. Kalina's speed of writing combat reports has also been increased. + 7. Optimized: The Echelon Formation screen now gives the option to select multiple echelons at once. Also, certain Fire Support Units selection screens allow you to select multiple Fire Support Units at once. - 9. Optimized: Alerts have been added for the addition of new Career Missions. + 8. Optimized: The maximum amount of Surplus EXP that can be held at one time has been increased. Kalina's speed of writing combat reports has also been increased. - 10. Optimized: Unit selection displays have been improved. The option to select units based on their Repair, Move Speed and other stats has also been added. + 9. Optimized: Alerts have been added for the addition of new Career Missions. - 11. Optimized: The potential dropped items display for missions ahas been improved. It now has popups for unlock conditions and the layout has been improved. + 10. Optimized: Unit selection displays have been improved. The option to select units based on their Repair, Move Speed and other stats has also been added. - 12. Optimized: Planning Mode AP expenditures now display extra APs for echelons and vehicle fuel supply status. + 11. Optimized: The potential dropped items display for missions ahas been improved. It now has popups for unlock conditions and the layout has been improved. - 13. Optimized: A problem where one could not drag or shrink unit CGs when inspecting them in the Unit Details screen. + 12. Optimized: Planning Mode AP expenditures now display extra APs for echelons and vehicle fuel supply status. - 14. Optimized: A problem where the rewards screen would be displayed multiple times after certain Ranking Mode stages were made permanently available in the campaign tab. - + 13. Optimized: A problem where one could not drag or shrink unit CGs when inspecting them in the Unit Details screen. + + 14. Optimized: A problem where the rewards screen would be displayed multiple times after certain Ranking Mode stages were made permanently available in the campaign tab. - + \ No newline at end of file diff --git a/Elisa.GameServer/Resources/userProtocol_en_v005.txt b/Elisa.GameServer/Resources/userProtocol_en_v005.txt new file mode 100644 index 0000000..275185b --- /dev/null +++ b/Elisa.GameServer/Resources/userProtocol_en_v005.txt @@ -0,0 +1 @@ +Suck me TOS \ No newline at end of file