add dorm and random stuff for fun

This commit is contained in:
raphaeIl
2024-04-07 04:37:09 -04:00
parent 92907806b2
commit 00060fb310
6 changed files with 97 additions and 37 deletions

View File

@@ -34,9 +34,6 @@ namespace BLHX.Server.Game.Commands {
List<PlayerShip> all_ships = all_ship_ids.Select(ship_id => CreateShipFromId((uint)ship_id, connection.player.Uid)).Take(amount).ToList();
foreach (int id in all_ship_ids)
Logger.c.Log(id + "");
all_ships.AddRange(GetDefaultShips(connection.player.Ships)); // add the defaults
connection.player.Ships = all_ships;
connection.SendSystemMsg($"Added {amount} ships!");

View File

@@ -23,6 +23,13 @@ namespace BLHX.Server.Game.Handlers {
connection.Send(new Sc11010());
}
[PacketHandler(Command.Cs11011, SaveDataAfterRun = true)]
static void ChangePlayerIconHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs11011>();
connection.Send(new Sc11012());
}
[PacketHandler(Command.Cs11013, SaveDataAfterRun = true)]
static void HarvestResourceHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs11013>();

View File

@@ -1,12 +1,30 @@
using BLHX.Server.Common.Proto.p15;
using BLHX.Server.Common.Data;
using BLHX.Server.Common.Utils;
using BLHX.Server.Common.Proto;
namespace BLHX.Server.Game.Handlers {
internal static class P15 {
[PacketHandler(Command.Cs15002, SaveDataAfterRun = true)]
static void UseFudaiItemHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs15002>();
Logger.c.Log("Arg: ");
foreach (var arg in req.Args)
Logger.c.Log(arg + "");
Logger.c.Log(req.Count + "");
Logger.c.Log(req.Id + "");
connection.Send(new Sc15003() {
DropLists = [],
});
}
}
static class P15ConnectionNotifyExtensions {
public static void NotifyBagData(this Connection connection) {
//List<int> AllItemsKeys = Data.ItemDataStatistics.Where(data => data.Value.Type == 2 && data.Value.Rarity >= 6).ToDictionary().Keys.ToList();
List<int> AllItemsKeys = Data.ItemDataStatistics.ToDictionary().Keys.ToList();

View File

@@ -1,27 +1,32 @@
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Proto.p16;
using BLHX.Server.Common.Utils;
namespace BLHX.Server.Game.Handlers {
internal static class P16 {
[PacketHandler(Command.Cs16001, SaveDataAfterRun = true)]
static void DormTrainShoppingHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs16001>();
Logger.c.Log("Id: " + req.Id);
Logger.c.Log("Number: " + req.Number);
connection.Send(new Sc16002() { });
}
namespace BLHX.Server.Game.Handlers
{
internal static class P16
{
[PacketHandler(Command.Cs16104)]
static void GetChargeListHandler(Connection connection, Packet packet)
{
static void GetChargeListHandler(Connection connection, Packet packet) {
connection.Send(new Sc16105());
}
[PacketHandler(Command.Cs16106)]
static void GetExchangeItemHandler(Connection connection, Packet packet)
{
static void GetExchangeItemHandler(Connection connection, Packet packet) {
connection.Send(new Sc16107());
}
}
static class P16ConnectionNotifyExtensions
{
public static void NotifyShopMonthData(this Connection connection)
{
static class P16ConnectionNotifyExtensions {
public static void NotifyShopMonthData(this Connection connection) {
connection.Send(new Sc16200() { Month = (uint)DateTime.Now.Month });
}
}

View File

@@ -1,17 +1,45 @@
using BLHX.Server.Common.Proto.p19;
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Proto.p19;
using BLHX.Server.Common.Utils;
namespace BLHX.Server.Game.Handlers
{
internal static class P19
{
namespace BLHX.Server.Game.Handlers {
internal static class P19 {
[PacketHandler(Command.Cs19002, SaveDataAfterRun = true)]
static void AddShipHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs19002>();
Logger.c.Log("ShipId: " + req.ShipId);
Logger.c.Log("Type: " + req.Type);
connection.Send(new Sc19003() {});
connection.Send(new Sc19003() {});
}
[PacketHandler(Command.Cs19004, SaveDataAfterRun = true)]
static void ShipExitHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs19004>();
connection.Send(new Sc19005() { });
}
[PacketHandler(Command.Cs19103, SaveDataAfterRun = true)]
static void GetOSSArgsHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs19103>();
Logger.c.Log("Typ: " + req.Typ);
connection.Send(new Sc19104() {
AccessId = "1",
AccessSecret = "1",
ExpireTime = (uint)new DateTimeOffset(DateTime.Now.AddDays(31)).ToUnixTimeSeconds(),
SecurityToken = "3874839"
});
}
}
static class P19ConnectionNotifyExtensions
{
public static void NotifyDormData(this Connection connection)
{
connection.Send(new Sc19001()
{
static class P19ConnectionNotifyExtensions {
public static void NotifyDormData(this Connection connection) {
connection.Send(new Sc19001() {
Lv = 1,
FloorNum = 1,
ExpPos = 2,

View File

@@ -1,16 +1,21 @@
using BLHX.Server.Common.Proto.p33;
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Proto.p33;
namespace BLHX.Server.Game.Handlers {
internal class P33 {
[PacketHandler(Command.Cs33000, SaveDataAfterRun = true)]
static void ReqWorldCheckHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs33000>();
connection.Send(new Sc33001() {
IsWorldOpen = 0,
});
}
namespace BLHX.Server.Game.Handlers
{
internal class P33
{
}
static class P33ConnectionNotifyExtensions
{
public static void NotifyWorldData(this Connection connection)
{
connection.Send(new Sc33114()
{
static class P33ConnectionNotifyExtensions {
public static void NotifyWorldData(this Connection connection) {
connection.Send(new Sc33114() {
IsWorldOpen = 1
});
}