mirror of
https://github.com/rafi1212122/BLHX.Server.git
synced 2025-12-12 14:34:39 +01:00
strictly necessary handlers
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using BLHX.Server.Common.Database;
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Proto.p11;
|
||||
using BLHX.Server.Common.Utils;
|
||||
using BLHX.Server.Game.Handlers;
|
||||
using ProtoBuf;
|
||||
using System.Buffers.Binary;
|
||||
using System.Net;
|
||||
@@ -117,6 +117,13 @@ namespace BLHX.Server.Game
|
||||
ns.Write(sendBuf);
|
||||
}
|
||||
|
||||
public void InitClientData()
|
||||
{
|
||||
this.NotifyPlayerData();
|
||||
this.NotifyStatisticsInit();
|
||||
this.NotifyShipData();
|
||||
}
|
||||
|
||||
public void SendHttpResponse(string rsp, string type = "text/plain")
|
||||
{
|
||||
tcpClient.GetStream().Write(Encoding.UTF8.GetBytes(
|
||||
|
||||
@@ -8,9 +8,7 @@ namespace BLHX.Server.Game.Handlers
|
||||
[PacketHandler(Command.Cs11001)]
|
||||
static void ServerTimeHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.NotifyPlayerData();
|
||||
connection.NotifyStatisticsInit();
|
||||
connection.NotifyShipData();
|
||||
connection.InitClientData();
|
||||
connection.Send(new Sc11002()
|
||||
{
|
||||
Timestamp = (uint)DateTimeOffset.Now.ToUnixTimeSeconds(),
|
||||
@@ -19,6 +17,18 @@ namespace BLHX.Server.Game.Handlers
|
||||
});
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs11603)]
|
||||
static void FetchSecondaryPasswordHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc11604());
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs11017)]
|
||||
static void StageDropListHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc11018());
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs11401)]
|
||||
static void ChangeChatRoomHandler(Connection connection, Packet packet)
|
||||
{
|
||||
@@ -51,7 +61,10 @@ namespace BLHX.Server.Game.Handlers
|
||||
GmFlag = 1,
|
||||
Rank = 1,
|
||||
GuideIndex = 1,
|
||||
ChatRoomId = 1,
|
||||
RegisterTime = (uint)new DateTimeOffset(connection.player.CreatedAt).ToUnixTimeSeconds(),
|
||||
ShipCount = (uint)connection.player.Ships.Count,
|
||||
CommanderBagMax = 40,
|
||||
Display = connection.player.DisplayInfo,
|
||||
Appreciation = new()
|
||||
});
|
||||
|
||||
@@ -18,5 +18,18 @@ namespace BLHX.Server.Game.Handlers
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static void NotifyFleetData(this Connection connection)
|
||||
{
|
||||
if (connection.player is not null)
|
||||
{
|
||||
connection.Send(new Sc12101()
|
||||
{
|
||||
GroupLists = [
|
||||
new Groupinfo() { Id = 1, ShipLists = [1, 2] }
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
BLHX.Server.Game/Handlers/P18.cs
Normal file
17
BLHX.Server.Game/Handlers/P18.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Proto.p18;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers
|
||||
{
|
||||
internal static class P18
|
||||
{
|
||||
[PacketHandler(Command.Cs18001)]
|
||||
static void SeasonInfoHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc18002()
|
||||
{
|
||||
Rank = 1
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
14
BLHX.Server.Game/Handlers/P24.cs
Normal file
14
BLHX.Server.Game/Handlers/P24.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Proto.p24;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers
|
||||
{
|
||||
internal static class P24
|
||||
{
|
||||
[PacketHandler(Command.Cs24020)]
|
||||
static void LimitChallengeHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc24021());
|
||||
}
|
||||
}
|
||||
}
|
||||
14
BLHX.Server.Game/Handlers/P26.cs
Normal file
14
BLHX.Server.Game/Handlers/P26.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Proto.p26;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers
|
||||
{
|
||||
internal static class P26
|
||||
{
|
||||
[PacketHandler(Command.Cs26101)]
|
||||
static void MiniGameHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc26102());
|
||||
}
|
||||
}
|
||||
}
|
||||
53
BLHX.Server.Game/Handlers/P27.cs
Normal file
53
BLHX.Server.Game/Handlers/P27.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Proto.p27;
|
||||
using BLHX.Server.Common.Utils;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers
|
||||
{
|
||||
internal static class P27
|
||||
{
|
||||
[PacketHandler(Command.Cs27000)]
|
||||
static void EducateHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc27001()
|
||||
{
|
||||
Child = new()
|
||||
{
|
||||
Tid = 1,
|
||||
CurTime = new() { Month = (uint)DateTimeOffset.Now.Month, Week = (uint)DateTime.Now.GetWeekOfMonth(), Day = (uint)DateTimeOffset.Now.AddDays(-1).DayOfWeek },
|
||||
Mood = 50,
|
||||
Money = 20,
|
||||
Attrs = [
|
||||
new ChildAttr() { Id = 101, Val = 0 },
|
||||
new ChildAttr() { Id = 102, Val = 0 },
|
||||
new ChildAttr() { Id = 103, Val = 0 },
|
||||
new ChildAttr() { Id = 104, Val = 0 },
|
||||
new ChildAttr() { Id = 201, Val = 0 },
|
||||
new ChildAttr() { Id = 202, Val = 0 },
|
||||
new ChildAttr() { Id = 203, Val = 0 },
|
||||
new ChildAttr() { Id = 301, Val = 0 },
|
||||
new ChildAttr() { Id = 302, Val = 0 },
|
||||
new ChildAttr() { Id = 303, Val = 0 },
|
||||
new ChildAttr() { Id = 304, Val = 0 },
|
||||
new ChildAttr() { Id = 305, Val = 0 },
|
||||
new ChildAttr() { Id = 306, Val = 0 }
|
||||
],
|
||||
Favor = new() { Lv = 1, Exp = 0 },
|
||||
Tasks = [
|
||||
new ChildTask() { Id = 101, Progress = 0 },
|
||||
new ChildTask() { Id = 102, Progress = 0 },
|
||||
new ChildTask() { Id = 103, Progress = 0 },
|
||||
],
|
||||
CanTriggerHomeEvent = 1,
|
||||
NewGamePlusCount = 1
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs27010)]
|
||||
static void EducateEndingsHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc27011());
|
||||
}
|
||||
}
|
||||
}
|
||||
18
BLHX.Server.Game/Handlers/P34.cs
Normal file
18
BLHX.Server.Game/Handlers/P34.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Proto.p34;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers
|
||||
{
|
||||
internal static class P34
|
||||
{
|
||||
[PacketHandler(Command.Cs34001)]
|
||||
static void GetMetaPTHandler(Connection connection, Packet packet)
|
||||
{
|
||||
var req = packet.Decode<Cs34001>();
|
||||
connection.Send(new Sc34002()
|
||||
{
|
||||
MetaShipLists = req.GroupIds.Select(x => new MetaShipInfo() { GroupId = x }).ToList()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
35
BLHX.Server.Game/Handlers/P60.cs
Normal file
35
BLHX.Server.Game/Handlers/P60.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Proto.p60;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers
|
||||
{
|
||||
internal static class P60
|
||||
{
|
||||
[PacketHandler(Command.Cs60037)]
|
||||
static void GuildInfoHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc60000()
|
||||
{
|
||||
Guild = new()
|
||||
{
|
||||
DonateTasks = [1],
|
||||
TechIds = [8, 0, 18, 6, 8, 0, 16, 0, 24, 0, 24, 0, 40, 0, 48, 0, 56, 0, 64, 0],
|
||||
BenefitTime = 1,
|
||||
WeeklyTaskFlag = 1
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[PacketHandler(Command.Cs60102)]
|
||||
static void GuildUserInfoHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc60103()
|
||||
{
|
||||
UserInfo = new()
|
||||
{
|
||||
DonateTasks = [1, 20, 4]
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
14
BLHX.Server.Game/Handlers/P62.cs
Normal file
14
BLHX.Server.Game/Handlers/P62.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using BLHX.Server.Common.Proto;
|
||||
using BLHX.Server.Common.Proto.p62;
|
||||
|
||||
namespace BLHX.Server.Game.Handlers
|
||||
{
|
||||
internal static class P62
|
||||
{
|
||||
[PacketHandler(Command.Cs62100)]
|
||||
static void GuildPublicUserDataHandler(Connection connection, Packet packet)
|
||||
{
|
||||
connection.Send(new Sc62101());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user