From 8343f08f9089bbe8df66f859517e6c139d4b9abd Mon Sep 17 00:00:00 2001 From: rafi1212122 Date: Wed, 24 May 2023 17:18:36 +0700 Subject: [PATCH] Http w/ dispatch --- .gitignore | 6 +- Common/Common.csproj | 4 +- Common/Database/User.cs | 67 +++++ Common/Program.cs | 46 ++- HttpServer/Controllers/DispatchController.cs | 297 +++++++++++++++++++ HttpServer/HttpServer.csproj | 19 ++ HttpServer/Models/Dispatch.cs | 186 ++++++++++++ HttpServer/Program.cs | 24 ++ HttpServer/Properties/launchSettings.json | 31 ++ HttpServer/appsettings.Development.json | 8 + HttpServer/appsettings.json | 10 + PemukulPaku.csproj | 9 +- PemukulPaku.sln | 6 + Program.cs | 6 +- Resources/.gitkeep | 1 - 15 files changed, 708 insertions(+), 12 deletions(-) create mode 100644 Common/Database/User.cs create mode 100644 HttpServer/Controllers/DispatchController.cs create mode 100644 HttpServer/HttpServer.csproj create mode 100644 HttpServer/Models/Dispatch.cs create mode 100644 HttpServer/Program.cs create mode 100644 HttpServer/Properties/launchSettings.json create mode 100644 HttpServer/appsettings.Development.json create mode 100644 HttpServer/appsettings.json delete mode 100644 Resources/.gitkeep diff --git a/.gitignore b/.gitignore index 9491a2f..ffc8581 100644 --- a/.gitignore +++ b/.gitignore @@ -360,4 +360,8 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd + +# Personal +!.gitkeep +Common/Resources/** \ No newline at end of file diff --git a/Common/Common.csproj b/Common/Common.csproj index 059ef88..50d105f 100644 --- a/Common/Common.csproj +++ b/Common/Common.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -8,6 +8,8 @@ + + diff --git a/Common/Database/User.cs b/Common/Database/User.cs new file mode 100644 index 0000000..c146adc --- /dev/null +++ b/Common/Database/User.cs @@ -0,0 +1,67 @@ +using MongoDB.Bson.Serialization.Attributes; +using MongoDB.Bson; +using Common.Resources.Proto; +using MongoDB.Driver; + +namespace Common.Database +{ + public class User + { + public static readonly IMongoCollection collection = Global.db.GetCollection("Users"); + + public static UserScheme CreateUser(string name) + { + UserScheme user = new() + { + Name = name, + Uid = 1001, + Nick = "", + Exp = 0, + Hcoin = 0, + Stamina = 80, + SelfDesc = "", + IsFirstLogin = true, + Token = Guid.NewGuid(), + WarshipId = 0, + WarshipAvatar = new WarshipAvatarData() + { + WarshipFirstAvatarId = 101, + WarshipSecondAvatarId = 0 + }, + AssistantAvatarId = 101, + BirthDate = 0, + AvatarTeamList = new List { new AvatarTeam { AvatarIdLists = new uint[] { 101 }, StageType = ((uint)StageType.StageStory) } }, + CustomAvatarTeamList = new List { } + }; + + collection.InsertOne(user); + + return user; + } + +#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. + public class UserScheme + { + public ObjectId Id { get; set; } + public string Name { get; set; } + public uint Uid { get; set; } + public string Nick { get; set; } + public int Exp { get; set; } + public int Hcoin { get; set; } + public int Stamina { get; set; } + public string SelfDesc { get; set; } + public bool IsFirstLogin { get; set; } + + [BsonGuidRepresentation(GuidRepresentation.Standard)] + public Guid Token { get; set; } + public int WarshipId { get; set; } + public WarshipAvatarData WarshipAvatar { get; set; } + public int AssistantAvatarId { get; set; } + public int BirthDate { get; set; } + public List AvatarTeamList { get; set; } + public List CustomAvatarTeamList { get; set; } + } +#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. + } + +} diff --git a/Common/Program.cs b/Common/Program.cs index 932db59..c6568fc 100644 --- a/Common/Program.cs +++ b/Common/Program.cs @@ -1,25 +1,61 @@ using Config.Net; +using MongoDB.Driver; namespace Common { public static class Global { public static IConfig config = new ConfigurationBuilder().UseJsonFile("config.json").Build(); + + public static MongoClient MongoClient = new MongoClient(config.DatabaseUri); + public static IMongoDatabase db = MongoClient.GetDatabase("PemukulPaku"); + public static long GetUnixInSeconds() => ((DateTimeOffset)DateTime.UtcNow).ToUnixTimeSeconds(); } public interface IConfig { - [Option(DefaultValue = VerboseLevel.Normal)] + [Option(DefaultValue = VerboseLevel.Warns)] VerboseLevel VerboseLevel { get; } - [Option(DefaultValue = "mongodb://localhost:27017/crepebh")] - string DatabaseUri { get; } + [Option(DefaultValue = false)] + bool UseLocalCache { get; } + [Option(DefaultValue = "mongodb://localhost:27017/PemukulPaku")] + string DatabaseUri { get; } + + [Option] + IGameserver Gameserver { get; } + + [Option] + IHttp Http { get; } + + public interface IGameserver + { + [Option(DefaultValue = "127.0.0.1")] + public string Host { get; } + + [Option(DefaultValue = (uint)(16100))] + public uint Port { get; } + + [Option(DefaultValue = "overseas01")] + public string RegionName { get; } + } + + public interface IHttp + { + + [Option(DefaultValue = (uint)(80))] + public uint HttpPort { get; } + + [Option(DefaultValue = (uint)(443))] + public uint HttpsPort { get; } + } } public enum VerboseLevel { - Normal = 0, - Debug = 1 + Errors = 0, + Warns = 1, + Debug = 2 } } \ No newline at end of file diff --git a/HttpServer/Controllers/DispatchController.cs b/HttpServer/Controllers/DispatchController.cs new file mode 100644 index 0000000..e028f77 --- /dev/null +++ b/HttpServer/Controllers/DispatchController.cs @@ -0,0 +1,297 @@ +using HttpServer.Models; +using Newtonsoft.Json; +using Common; +using System.Text.RegularExpressions; + +namespace HttpServer.Controllers +{ + public class DispatchController + { + public static void AddHandlers(WebApplication app) + { + app.Map("/query_dispatch", (ctx) => + { + QueryDispatch rsp = new() + { + Retcode = 0, + RegionList = new Region[] { + new Region() { + Retcode = 0, + DispatchUrl = $"http://{Global.config.Gameserver.Host}/query_gateway", + Name = Global.config.Gameserver.RegionName, + Title = "", + Ext = GetExt(ctx.Request.Query["version"].ToString()) + } + } + }; + return ctx.Response.WriteAsync(JsonConvert.SerializeObject(rsp)); + }); + + app.Map("/query_gateway", (ctx) => + { + string Version = ctx.Request.Query["version"].ToString(); + Gameserver Gameserver = new() + { + Ip = Global.config.Gameserver.Host, + Port = Global.config.Gameserver.Port + }; + + QueryGateway rsp = new() + { + Retcode = 0, + Msg = "", + RegionName = Global.config.Gameserver.RegionName, + AccountUrl = $"http://{Global.config.Gameserver.Host}/account", + AccountUrlBackup = $"http://{Global.config.Gameserver.Host}/account", + AssetBundleUrlList = GetAssetBundleUrlList(Version), + ExAudioAndVideoUrlList = GetExAudioAndVideoUrlList(Version), + ExResourceUrlList = GetExResourceUrlList(Version), + Ext = GetExt(Version), + Gameserver = Gameserver, + Gateway = Gameserver, + IsDataReady = true, + OaserverUrl = $"http://{Global.config.Gameserver.Host}/oaserver", + ServerCurTime = Global.GetUnixInSeconds(), + ServerCurTimezone = 8, + ServerExt = new ServerExt() + { + CdkeyUrl = $"http://{Global.config.Gameserver.Host}/common", + MihoyoSdkEnv = "2" + } + }; + return ctx.Response.WriteAsync(JsonConvert.SerializeObject(rsp)); + }); + } + + public static Ext GetExt(string version) + { + return new Ext() + { + AiUseAssetBoundle = "1", + ApmLogLevel = "2", + ApmSwitch = "1", + ApmSwitchCrash = "1", + DataUseAssetBoundle = "1", + EnableWatermark = "1", + ExAudioAndVideoUrlList = GetExAudioAndVideoUrlList(version), + ExResPrePublish = "0", + ExResUseHttp = "0", + ExResourceUrlList = GetExResourceUrlList(version), + ForbidRecharge = "1", + IsChecksumOff = "1", + OfflineReportSwitch = "1", + ResUseAssetBoundle = "1", + ShowVersionText = "0", + UpdateStreamingAsb = "1", + UseMultyCdn = "1", + ApmLogDest = "2", + ApmSwitchGameLog = "1", + BlockErrorDialog = "1", + ElevatorModelPath = "GameEntry/EVA/StartLoading_Model", + ExResBuffSize = "10485760", + IsXxxx = "1", + MtpSwitch = "0", + NetworkFeedbackEnable = "0", + ShowBulletinButton = "0", + ShowBulletinEmptyDialogBg = "0" + }; + } + + public static string[] GetAssetBundleUrlList(string version) + { + Regex regex = new Regex(@"^(.*?)_(os|gf|global)_(.*?)$"); + Match matches = regex.Match(version); + + if (matches.Success) + { + string type = matches.Groups[2].Value; // get the second group (os or gf) + + switch (type) + { + case "os": + return Global.config.UseLocalCache ? new string[] + { + $"http://{Global.config.Gameserver.Host}/asset_bundle/overseas01/1.1", + $"http://{Global.config.Gameserver.Host}/asset_bundle/overseas01/1.1" + } : new string[] + { + "https://hk-bundle-os-mihayo.akamaized.net/asset_bundle/overseas01/1.1", + "https://bundle-aliyun-os.honkaiimpact3.com/asset_bundle/overseas01/1.1" + }; + case "gf": + if (version.Contains("beta")) + { + return Global.config.UseLocalCache ? new string[] + { + $"https://{Global.config.Gameserver.Host}/asset_bundle/beta_release/1.0", + $"https://{Global.config.Gameserver.Host}/asset_bundle/beta_release/1.0" + } : new string[] + { + "https://bh3rd-beta-qcloud.bh3.com/asset_bundle/beta_release/1.0", + "https://bh3rd-beta.bh3.com/asset_bundle/beta_release/1.0" + }; + } + return Global.config.UseLocalCache ? new string[] + { + $"https://{Global.config.Gameserver.Host}/asset_bundle/android01/1.0", + $"https://{Global.config.Gameserver.Host}/asset_bundle/android01/1.0" + } : new string[] + { + "https://bundle-qcloud.bh3.com/asset_bundle/android01/1.0", + "https://bundle.bh3.com/asset_bundle/android01/1.0" + }; + case "global": + return Global.config.UseLocalCache ? new string[] + { + $"https://{Global.config.Gameserver.Host}/asset_bundle/usa01/1.1", + $"https://{Global.config.Gameserver.Host}/asset_bundle/usa01/1.1" + } : new string[] + { + "http://hk-bundle-west-mihayo.akamaized.net/asset_bundle/usa01/1.1", + "http://bundle-aliyun-usa.honkaiimpact3.com/asset_bundle/usa01/1.1" + }; + default: + return Global.config.UseLocalCache ? new string[] + { + $"http://{Global.config.Gameserver.Host}/asset_bundle/overseas01/1.1", + $"http://{Global.config.Gameserver.Host}/asset_bundle/overseas01/1.1" + } : new string[] + { + "https://hk-bundle-os-mihayo.akamaized.net/asset_bundle/overseas01/1.1", + "https://bundle-aliyun-os.honkaiimpact3.com/asset_bundle/overseas01/1.1" + }; + } + } + else + { + return Global.config.UseLocalCache ? new string[] + { + $"http://{Global.config.Gameserver.Host}/asset_bundle/overseas01/1.1", + $"http://{Global.config.Gameserver.Host}/asset_bundle/overseas01/1.1" + } : new string[] + { + "https://hk-bundle-os-mihayo.akamaized.net/asset_bundle/overseas01/1.1", + "https://bundle-aliyun-os.honkaiimpact3.com/asset_bundle/overseas01/1.1" + }; + } + } + + public static string[] GetExAudioAndVideoUrlList(string version) + { + Regex regex = new(@"^(.*?)_(os|gf|global)_(.*?)$"); + Match matches = regex.Match(version); + + if (matches.Success) + { + string type = matches.Groups[2].Value; // get the second group (os or gf) + + switch (type) + { + case "os": + return new string[] { }; + case "gf": + if (version.Contains("beta")) + { + return Global.config.UseLocalCache ? new string[] + { + $"{Global.config.Gameserver.Host}/tmp/CGAudio", + $"{Global.config.Gameserver.Host}/tmp/CGAudio" + } : new string[] + { + "bh3rd-beta-qcloud.bh3.com/tmp/CGAudio", + "bh3rd-beta.bh3.com/tmp/CGAudio" + }; + } + return new string[] { }; + case "global": + return new string[] { }; + default: + return new string[] { }; + } + } + else + { + return new string[] { }; + } + } + + public static string[] GetExResourceUrlList(string version) + { + Regex regex = new(@"^(.*?)_(os|gf|global)_(.*?)$"); + Match matches = regex.Match(version); + + if (matches.Success) + { + string type = matches.Groups[2].Value; // get the second group (os or gf) + + switch (type) + { + case "os": + return Global.config.UseLocalCache ? new string[] + { + $"{Global.config.Gameserver.Host}/com.miHoYo.bh3oversea", + $"{Global.config.Gameserver.Host}/com.miHoYo.bh3oversea" + } : new string[] + { + "hk-bigfile-os-mihayo.akamaized.net/com.miHoYo.bh3oversea", + "bigfile-aliyun-os.honkaiimpact3.com/com.miHoYo.bh3oversea" + }; + case "gf": + if (version.Contains("beta")) + { + return Global.config.UseLocalCache ? new string[] + { + $"{Global.config.Gameserver.Host}/tmp/beta", + $"{Global.config.Gameserver.Host}/tmp/beta" + } : new string[] + { + "bh3rd-beta-qcloud.bh3.com/tmp/beta", + "bh3rd-beta.bh3.com/tmp/beta" + }; + } + return Global.config.UseLocalCache ? new string[] + { + $"{Global.config.Gameserver.Host}/tmp/Original", + $"{Global.config.Gameserver.Host}/tmp/Original" + } : new string[] + { + "bundle-qcloud.bh3.com/tmp/Original", + "bundle.bh3.com/tmp/Original" + }; + case "global": + return Global.config.UseLocalCache ? new string[] + { + $"{Global.config.Gameserver.Host}/tmp/com.miHoYo.bh3global", + $"{Global.config.Gameserver.Host}/tmp/com.miHoYo.bh3global" + } : new string[] + { + "hk-bundle-west-mihayo.akamaized.net/tmp/com.miHoYo.bh3global", + "bigfile-aliyun-usa.honkaiimpact3.com/tmp/com.miHoYo.bh3global" + }; + default: + return Global.config.UseLocalCache ? new string[] + { + $"{Global.config.Gameserver.Host}/com.miHoYo.bh3oversea", + $"{Global.config.Gameserver.Host}/com.miHoYo.bh3oversea" + } : new string[] + { + "hk-bigfile-os-mihayo.akamaized.net/com.miHoYo.bh3oversea", + "bigfile-aliyun-os.honkaiimpact3.com/com.miHoYo.bh3oversea" + }; + } + } + else + { + return Global.config.UseLocalCache ? new string[] + { + $"{Global.config.Gameserver.Host}/com.miHoYo.bh3oversea", + $"{Global.config.Gameserver.Host}/com.miHoYo.bh3oversea" + } : new string[] + { + "hk-bigfile-os-mihayo.akamaized.net/com.miHoYo.bh3oversea", + "bigfile-aliyun-os.honkaiimpact3.com/com.miHoYo.bh3oversea" + }; + } + } + } +} diff --git a/HttpServer/HttpServer.csproj b/HttpServer/HttpServer.csproj new file mode 100644 index 0000000..fe33fd0 --- /dev/null +++ b/HttpServer/HttpServer.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + Library + + + + + + + + + + + + diff --git a/HttpServer/Models/Dispatch.cs b/HttpServer/Models/Dispatch.cs new file mode 100644 index 0000000..76a09a3 --- /dev/null +++ b/HttpServer/Models/Dispatch.cs @@ -0,0 +1,186 @@ +using Newtonsoft.Json; + +#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. +namespace HttpServer.Models +{ + public partial class QueryDispatch + { + [JsonProperty("region_list")] + public Region[] RegionList { get; set; } + + [JsonProperty("retcode")] + public int Retcode { get; set; } + } + + public partial class QueryGateway + { + [JsonProperty("account_url")] + public string AccountUrl { get; set; } + + [JsonProperty("account_url_backup")] + public string AccountUrlBackup { get; set; } + + [JsonProperty("asset_bundle_url_list")] + public string[] AssetBundleUrlList { get; set; } + + [JsonProperty("ex_audio_and_video_url_list")] + public object[] ExAudioAndVideoUrlList { get; set; } + + [JsonProperty("ex_resource_url_list")] + public string[] ExResourceUrlList { get; set; } + + [JsonProperty("ext")] + public Ext Ext { get; set; } + + [JsonProperty("gameserver")] + public Gameserver Gameserver { get; set; } + + [JsonProperty("gateway")] + public Gameserver Gateway { get; set; } + + [JsonProperty("is_data_ready")] + public bool IsDataReady { get; set; } + + [JsonProperty("msg")] + public string Msg { get; set; } + + [JsonProperty("oaserver_url")] + public string OaserverUrl { get; set; } + + [JsonProperty("region_name")] + public string RegionName { get; set; } + + [JsonProperty("retcode")] + public int Retcode { get; set; } + + [JsonProperty("server_cur_time")] + public long ServerCurTime { get; set; } + + [JsonProperty("server_cur_timezone")] + public long ServerCurTimezone { get; set; } + + [JsonProperty("server_ext")] + public ServerExt ServerExt { get; set; } + } + + public partial class Ext + { + [JsonProperty("ai_use_asset_boundle")] + public string AiUseAssetBoundle { get; set; } + + [JsonProperty("apm_log_dest")] + public string ApmLogDest { get; set; } + + [JsonProperty("apm_log_level")] + public string ApmLogLevel { get; set; } + + [JsonProperty("apm_switch")] + public string ApmSwitch { get; set; } + + [JsonProperty("apm_switch_crash")] + public string ApmSwitchCrash { get; set; } + + [JsonProperty("apm_switch_game_log")] + public string ApmSwitchGameLog { get; set; } + + [JsonProperty("block_error_dialog")] + public string BlockErrorDialog { get; set; } + + [JsonProperty("data_use_asset_boundle")] + public string DataUseAssetBoundle { get; set; } + + [JsonProperty("enable_watermark")] + public string EnableWatermark { get; set; } + + [JsonProperty("elevator_model_path")] + public string ElevatorModelPath { get; set; } + + [JsonProperty("ex_audio_and_video_url_list")] + public string[] ExAudioAndVideoUrlList { get; set; } + + [JsonProperty("ex_res_buff_size")] + public string ExResBuffSize { get; set; } + + [JsonProperty("ex_res_pre_publish")] + public string ExResPrePublish { get; set; } + + [JsonProperty("ex_res_use_http")] + public string ExResUseHttp { get; set; } + + [JsonProperty("ex_resource_url_list")] + public string[] ExResourceUrlList { get; set; } + + [JsonProperty("forbid_recharge")] + public string ForbidRecharge { get; set; } + + [JsonProperty("is_checksum_off")] + public string IsChecksumOff { get; set; } + + [JsonProperty("is_xxxx")] + public string IsXxxx { get; set; } + + [JsonProperty("mtp_switch")] + public string MtpSwitch { get; set; } + + [JsonProperty("network_feedback_enable")] + public string NetworkFeedbackEnable { get; set; } + + [JsonProperty("offline_report_switch")] + public string OfflineReportSwitch { get; set; } + + [JsonProperty("res_use_asset_boundle")] + public string ResUseAssetBoundle { get; set; } + + [JsonProperty("show_bulletin_button")] + public string ShowBulletinButton { get; set; } + + [JsonProperty("show_bulletin_empty_dialog_bg")] + public string ShowBulletinEmptyDialogBg { get; set; } + + [JsonProperty("show_version_text")] + public string ShowVersionText { get; set; } + + [JsonProperty("update_streaming_asb")] + public string UpdateStreamingAsb { get; set; } + + [JsonProperty("use_multy_cdn")] + public string UseMultyCdn { get; set; } + } + + public partial class Gameserver + { + [JsonProperty("ip")] + public string Ip { get; set; } + + [JsonProperty("port")] + public uint Port { get; set; } + } + + public partial class Region + { + [JsonProperty("dispatch_url")] + public string DispatchUrl { get; set; } + + [JsonProperty("ext")] + public Ext Ext { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("retcode")] + public int Retcode { get; set; } + + [JsonProperty("title")] + public string Title { get; set; } + } + + public partial class ServerExt + { + [JsonProperty("cdkey_url")] + public string CdkeyUrl { get; set; } + + [JsonProperty("mihoyo_sdk_env")] + public string MihoyoSdkEnv { get; set; } + } +} +#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. \ No newline at end of file diff --git a/HttpServer/Program.cs b/HttpServer/Program.cs new file mode 100644 index 0000000..19bb2c3 --- /dev/null +++ b/HttpServer/Program.cs @@ -0,0 +1,24 @@ +using Common; +using HttpServer.Controllers; + +namespace HttpServer +{ + public class Program + { + public static void Main() + { + Thread.CurrentThread.IsBackground = true; + var builder = WebApplication.CreateBuilder(); + + var app = builder.Build(); + + app.UsePathBase("/"); + app.Urls.Add($"http://*:{Global.config.Http.HttpPort}"); + app.Urls.Add($"https://*:{Global.config.Http.HttpsPort}"); + + DispatchController.AddHandlers(app); + + app.Run(); + } + } +} \ No newline at end of file diff --git a/HttpServer/Properties/launchSettings.json b/HttpServer/Properties/launchSettings.json new file mode 100644 index 0000000..0514594 --- /dev/null +++ b/HttpServer/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:64847", + "sslPort": 44333 + } + }, + "profiles": { + "HttpServer": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7227;http://localhost:5186", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/HttpServer/appsettings.Development.json b/HttpServer/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/HttpServer/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/HttpServer/appsettings.json b/HttpServer/appsettings.json new file mode 100644 index 0000000..16e675b --- /dev/null +++ b/HttpServer/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Trace", + "System": "Information", + "Microsoft": "None" + } + }, + "AllowedHosts": "*" +} \ No newline at end of file diff --git a/PemukulPaku.csproj b/PemukulPaku.csproj index b3e7e06..117715e 100644 --- a/PemukulPaku.csproj +++ b/PemukulPaku.csproj @@ -1,4 +1,4 @@ - + Exe @@ -14,11 +14,14 @@ - + + + - + + diff --git a/PemukulPaku.sln b/PemukulPaku.sln index 213d62d..f4d93bf 100644 --- a/PemukulPaku.sln +++ b/PemukulPaku.sln @@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PemukulPaku", "PemukulPaku. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common", "Common\Common.csproj", "{226D0356-65DE-4DBD-9FF4-7D4B527B02E0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpServer", "HttpServer\HttpServer.csproj", "{DA5FFC52-14BB-44ED-B8EA-54012279F644}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {226D0356-65DE-4DBD-9FF4-7D4B527B02E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {226D0356-65DE-4DBD-9FF4-7D4B527B02E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {226D0356-65DE-4DBD-9FF4-7D4B527B02E0}.Release|Any CPU.Build.0 = Release|Any CPU + {DA5FFC52-14BB-44ED-B8EA-54012279F644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA5FFC52-14BB-44ED-B8EA-54012279F644}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA5FFC52-14BB-44ED-B8EA-54012279F644}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA5FFC52-14BB-44ED-B8EA-54012279F644}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Program.cs b/Program.cs index aaec4df..b401d15 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,5 @@ -using PemukulPaku.Resources.Proto; +using Common.Resources.Proto; +using Common; namespace PemukulPaku { @@ -11,6 +12,9 @@ namespace PemukulPaku { Msg = "Hello!" }; + Console.WriteLine(Global.config.Gameserver.Host); + new Thread(HttpServer.Program.Main).Start(); + Console.ReadKey(true); } } } \ No newline at end of file diff --git a/Resources/.gitkeep b/Resources/.gitkeep deleted file mode 100644 index 5f28270..0000000 --- a/Resources/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file