remove static serving & ely realm prep

This commit is contained in:
rafi1212122
2023-06-04 15:23:53 +07:00
parent c7f0c661ed
commit 9cf5e313a3
6 changed files with 53 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
using Common.Utils; using System.Reflection;
using Common.Utils;
using Config.Net; using Config.Net;
using MongoDB.Driver; using MongoDB.Driver;
@@ -23,16 +24,16 @@ namespace Common
bool UseLocalCache { get; set; } bool UseLocalCache { get; set; }
[Option(DefaultValue = true)] [Option(DefaultValue = true)]
bool CreateAccountOnLoginAttempt { get; } bool CreateAccountOnLoginAttempt { get; set; }
[Option(DefaultValue = "mongodb://127.0.0.1:27017/PemukulPaku")] [Option(DefaultValue = "mongodb://127.0.0.1:27017/PemukulPaku")]
string DatabaseUri { get; set; } string DatabaseUri { get; set; }
[Option] [Option]
IGameserver Gameserver { get; } IGameserver Gameserver { get; set; }
[Option] [Option]
IHttp Http { get; } IHttp Http { get; set; }
public interface IGameserver public interface IGameserver
{ {
@@ -40,20 +41,20 @@ namespace Common
public string Host { get; set; } public string Host { get; set; }
[Option(DefaultValue = (uint)(16100))] [Option(DefaultValue = (uint)(16100))]
public uint Port { get; } public uint Port { get; set; }
[Option(DefaultValue = "overseas01")] [Option(DefaultValue = "overseas01")]
public string RegionName { get; } public string RegionName { get; set; }
} }
public interface IHttp public interface IHttp
{ {
[Option(DefaultValue = (uint)(80))] [Option(DefaultValue = (uint)(80))]
public uint HttpPort { get; } public uint HttpPort { get; set; }
[Option(DefaultValue = (uint)(443))] [Option(DefaultValue = (uint)(443))]
public uint HttpsPort { get; } public uint HttpsPort { get; set; }
} }
} }

View File

@@ -0,0 +1,15 @@
using Common.Resources.Proto;
namespace PemukulPaku.GameServer.Handlers
{
[PacketCmdId(CmdId.GetClientDataReq)]
internal class GetClientDataReqHandler : IPacketHandler
{
public void Handle(Session session, Packet packet)
{
GetClientDataReq Data = packet.GetDecodedBody<GetClientDataReq>();
session.Send(Packet.FromProto(new GetClientDataRsp() { retcode = GetClientDataRsp.Retcode.NotFound, Type = Data.Type, Id = Data.Id }, CmdId.GetClientDataRsp));
}
}
}

View File

@@ -7,7 +7,7 @@ namespace PemukulPaku.GameServer.Handlers
{ {
public void Handle(Session session, Packet packet) public void Handle(Session session, Packet packet)
{ {
session.Send(Packet.FromProto(new GetGodWarRsp() { retcode = GetGodWarRsp.Retcode.NotOpen }, CmdId.GetGodWarRsp)); session.Send(Packet.FromProto(new GetGodWarRsp() { retcode = GetGodWarRsp.Retcode.Succ }, CmdId.GetGodWarRsp));
} }
} }
} }

View File

@@ -0,0 +1,15 @@
using Common.Resources.Proto;
namespace PemukulPaku.GameServer.Handlers
{
[PacketCmdId(CmdId.RefreshGodWarTicketReq)]
internal class RefreshGodWarTicketReqHandler : IPacketHandler
{
public void Handle(Session session, Packet packet)
{
RefreshGodWarTicketReq Data = packet.GetDecodedBody<RefreshGodWarTicketReq>();
session.Send(Packet.FromProto(new RefreshGodWarTicketRsp() { retcode = RefreshGodWarTicketRsp.Retcode.Succ, GodWarId = Data.GodWarId }, CmdId.RefreshGodWarTicketRsp));
}
}
}

View File

@@ -0,0 +1,13 @@
using Common.Resources.Proto;
namespace PemukulPaku.GameServer.Handlers
{
[PacketCmdId(CmdId.StageInnerDataReportReq)]
internal class StageInnerDataReportReqHandler : IPacketHandler
{
public void Handle(Session session, Packet packet)
{
session.Send(Packet.FromProto(new StageInnerDataReportRsp() { retcode = StageInnerDataReportRsp.Retcode.Succ }, CmdId.StageInnerDataReportRsp));
}
}
}

View File

@@ -24,7 +24,6 @@ namespace HttpServer
AccountController.AddHandlers(app); AccountController.AddHandlers(app);
ConfigController.AddHandlers(app); ConfigController.AddHandlers(app);
app.UseStaticFiles(new StaticFileOptions() { FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot")) });
app.UseMiddleware<RequestLoggingMiddleware>(); app.UseMiddleware<RequestLoggingMiddleware>();
c.Log($"HTTP server started on port 80 & 443"); // A lie c.Log($"HTTP server started on port 80 & 443"); // A lie
app.Run(); app.Run();