-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from Jump-Suit/EA_BlazeWork
Blaze + HTTP
- Loading branch information
Showing
22 changed files
with
2,126 additions
and
64 deletions.
There are no files selected for viewing
351 changes: 351 additions & 0 deletions
351
AuxiliaryServices/WebAPIService/CCPGames/Dust514Class.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
152 changes: 152 additions & 0 deletions
152
...ryServices/WebAPIService/UBISOFT/BuildAPI/BuildDBPullService/BuildDBPullServiceHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
using CustomLogger; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Xml.Linq; | ||
|
||
namespace WebAPIService.UBISOFT.BuildAPI.BuildDBPullService | ||
{ | ||
public class BuildDBPullServiceHandler | ||
{ | ||
|
||
public static string buildDBRequestParser(byte[] PostData, string ContentType) | ||
{ | ||
|
||
if (PostData == null || PostData.Length == 0) | ||
return "Empty PostData"; | ||
|
||
|
||
// Load the XML string into an XDocument | ||
XDocument xdoc = XDocument.Parse(Encoding.UTF8.GetString(PostData)); | ||
|
||
// Define the namespaces used in the XML document | ||
XNamespace soap = "http://www.w3.org/2003/05/soap-envelope"; | ||
XNamespace responseNamespace = "http://builddatabasepullapi/"; | ||
|
||
var resultElement = xdoc.Descendants(soap + "Body").FirstOrDefault(); | ||
string innerRequestName = resultElement.Name.ToString(); | ||
|
||
List<string> buildDbRequests = new List<string>() | ||
{ "GetCurrentLauncherVersion", "GetConsoleOwner", | ||
"GetProjectDetailWithMacValidation", "GetFilteredBuildVersionsWithMacValidation", | ||
"GetProjectsWithMacValidation", "GetFilteredBuildVersionsWithMacValidation"}; | ||
|
||
|
||
if (buildDbRequests.Contains(innerRequestName)) | ||
{ | ||
switch (innerRequestName) { | ||
case "GetCurrentLauncherVersion": | ||
{ | ||
|
||
LoggerAccessor.LogInfo($"[BuildDBPullService] - GetCurrentLauncherVersion: TRIGGERED!"); | ||
|
||
return @"<?xml version=""1.0"" encoding=""utf-8""?> | ||
<soap:Envelope | ||
xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"" | ||
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" | ||
xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | ||
<soap:Body> | ||
<LauncherVersion | ||
xmlns=""http://builddatabasepullapi/""> | ||
<VersionName>2.10.1</VersionName> | ||
<VersionPath>/BuildDBPullService.asmx</VersionPath> | ||
<LauncherVersionId>4</LauncherVersionId> | ||
<PlatformId>4</PlatformId> | ||
</LauncherVersion> | ||
</soap:Body> | ||
</soap:Envelope>"; | ||
} | ||
|
||
default: | ||
{ | ||
|
||
LoggerAccessor.LogInfo($"[BuildDBPullService] - GetCurrentLauncherVersion: FAILED!"); | ||
return @"<?xml version=""1.0"" encoding=""utf-8""?> | ||
<soap:Envelope | ||
xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"" | ||
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" | ||
xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | ||
<soap:Body> | ||
<LauncherVersion | ||
xmlns=""http://builddatabasepullapi/""> | ||
<VersionName>2.10.1</VersionName> | ||
<VersionPath>/BuildDBPullService.asmx</VersionPath> | ||
<LauncherVersionId>4</LauncherVersionId> | ||
<PlatformId>4</PlatformId> | ||
</LauncherVersion> | ||
</soap:Body> | ||
</soap:Envelope>"; | ||
} | ||
|
||
} | ||
} | ||
else | ||
{ | ||
LoggerAccessor.LogWarn("[BuildDBPullService] - No GetConsoleOwnerResult found."); | ||
} | ||
|
||
|
||
return @"<?xml version=""1.0"" encoding=""utf-8""?> | ||
<soap:Envelope | ||
xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"" | ||
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" | ||
xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | ||
<soap:Body> | ||
<LauncherVersion | ||
xmlns=""http://builddatabasepullapi/""> | ||
<VersionName>2.10.2</VersionName> | ||
<VersionPath>/BuildDBPullService.asmx</VersionPath> | ||
<LauncherVersionId>4</LauncherVersionId> | ||
<PlatformId>4</PlatformId> | ||
</LauncherVersion> | ||
</soap:Body> | ||
</soap:Envelope>"; | ||
|
||
|
||
} | ||
|
||
|
||
public static string getVersion(byte[] PostData, string ContentType) { | ||
|
||
|
||
return @"<?xml version=""1.0"" encoding=""utf-8""?> | ||
<soap:Envelope | ||
xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"" | ||
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" | ||
xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | ||
<soap:Body> | ||
<GetConsoleOwnerResponse | ||
xmlns=""http://builddatabasepullapi/""> | ||
<GetConsoleOwnerResult> | ||
<ADLogin>hensley.edwin</ADLogin> | ||
<Name>Hensley Edwin</Name> | ||
</GetConsoleOwnerResult> | ||
</GetConsoleOwnerResponse> | ||
</soap:Body> | ||
</soap:Envelope>"; | ||
} | ||
|
||
public static string getConsoleOwner(byte[] PostData, string ContentType) | ||
{ | ||
|
||
|
||
return @"<?xml version=""1.0"" encoding=""utf-8""?> | ||
<soap:Envelope | ||
xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"" | ||
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" | ||
xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | ||
<soap:Body> | ||
<GetConsoleOwnerResponse | ||
xmlns=""http://builddatabasepullapi/""> | ||
<GetConsoleOwnerResult> | ||
<ADLogin>hensley.edwin</ADLogin> | ||
<Name>Hensley Edwin</Name> | ||
</GetConsoleOwnerResult> | ||
</GetConsoleOwnerResponse> | ||
</soap:Body> | ||
</soap:Envelope>"; | ||
} | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
AuxiliaryServices/WebAPIService/UBISOFT/BuildAPI/SoapBuildAPIClass.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using CustomLogger; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using WebAPIService.OUWF; | ||
using WebAPIService.UBISOFT.BuildAPI.BuildDBPullService; | ||
|
||
namespace WebAPIService.UBISOFT.BuildAPI | ||
{ | ||
|
||
public class SoapBuildAPIClass : IDisposable | ||
{ | ||
string workpath; | ||
string absolutepath; | ||
string method; | ||
private bool disposedValue; | ||
|
||
public SoapBuildAPIClass(string method, string absolutepath, string workpath) | ||
{ | ||
this.workpath = workpath; | ||
this.absolutepath = absolutepath; | ||
this.method = method; | ||
} | ||
|
||
public string ProcessRequest(byte[] PostData, string ContentType) | ||
{ | ||
if (string.IsNullOrEmpty(absolutepath)) | ||
return null; | ||
|
||
switch (method) | ||
{ | ||
case "POST": | ||
switch (absolutepath) | ||
{ | ||
|
||
case "/BuildDBPullService.asmx": | ||
return BuildDBPullServiceHandler.buildDBRequestParser(PostData, ContentType); | ||
default: | ||
{ | ||
LoggerAccessor.LogError($"[BuildDBPullService] - Unhandled server request discovered: {absolutepath} | DETAILS: \n{Encoding.UTF8.GetString(PostData)}"); | ||
} | ||
break; | ||
} | ||
break; | ||
default: | ||
{ | ||
LoggerAccessor.LogError($"[BuildDBPullService] - Method unhandled {method}"); | ||
} | ||
break; | ||
} | ||
|
||
return null; | ||
} | ||
|
||
protected virtual void Dispose(bool disposing) | ||
{ | ||
if (!disposedValue) | ||
{ | ||
if (disposing) | ||
{ | ||
absolutepath = string.Empty; | ||
method = string.Empty; | ||
workpath = string.Empty; | ||
} | ||
|
||
// TODO: libérer les ressources non managées (objets non managés) et substituer le finaliseur | ||
// TODO: affecter aux grands champs une valeur null | ||
disposedValue = true; | ||
} | ||
} | ||
|
||
// // TODO: substituer le finaliseur uniquement si 'Dispose(bool disposing)' a du code pour libérer les ressources non managées | ||
// ~HERMESClass() | ||
// { | ||
// // Ne changez pas ce code. Placez le code de nettoyage dans la méthode 'Dispose(bool disposing)' | ||
// Dispose(disposing: false); | ||
// } | ||
|
||
public void Dispose() | ||
{ | ||
// Ne changez pas ce code. Placez le code de nettoyage dans la méthode 'Dispose(bool disposing)' | ||
Dispose(disposing: true); | ||
GC.SuppressFinalize(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.