mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-16 16:34:44 +01:00
updated protos, hardcoded gacha
This commit is contained in:
65
Novaria.GameServer/Controllers/Api/ProtocolHandlers/Gacha.cs
Normal file
65
Novaria.GameServer/Controllers/Api/ProtocolHandlers/Gacha.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using Novaria.Common.Core;
|
||||
using Proto;
|
||||
|
||||
namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
{
|
||||
public class Gacha : ProtocolHandlerBase
|
||||
{
|
||||
public Gacha(IProtocolHandlerFactory protocolHandlerFactory) : base(protocolHandlerFactory)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.gacha_information_req)]
|
||||
public Packet GachaInfoHandler(Nil req)
|
||||
{
|
||||
GachaInformationResp gachaInfoResp = new GachaInformationResp()
|
||||
{
|
||||
Information =
|
||||
{
|
||||
new GachaInfo()
|
||||
{
|
||||
Id = 1,
|
||||
DaysCount = 31,
|
||||
AupMissTimes = 1,
|
||||
TotalTimes = 123,
|
||||
AupGuaranteeTimes = 10,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return Packet.Create(NetMsgId.gacha_information_succeed_ack, gachaInfoResp);
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.gacha_spin_req)]
|
||||
public Packet GachaInfoHandler(GachaSpinReq req)
|
||||
{
|
||||
GachaSpinResp gachaSpinResp = new GachaSpinResp()
|
||||
{
|
||||
Change = new ChangeInfo()
|
||||
{
|
||||
},
|
||||
Time = 10,
|
||||
TotalTimes = 123,
|
||||
AupGuaranteeTimes = 1,
|
||||
AupMissTimes = 1,
|
||||
DaysCount = 2,
|
||||
};
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
gachaSpinResp.Cards.Add(new GachaCard()
|
||||
{
|
||||
Card = new ItemTpl()
|
||||
{
|
||||
Qty = 1,
|
||||
Tid = 132,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return Packet.Create(NetMsgId.gacha_spin_succeed_ack, gachaSpinResp);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,25 +14,10 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
{
|
||||
public Login(IProtocolHandlerFactory protocolHandlerFactory, TableService tableService) : base(protocolHandlerFactory)
|
||||
{
|
||||
table_Achievement achievements = (table_Achievement)tableService.GetTable<Nova.Client.Achievement>();
|
||||
}
|
||||
//table_Achievement achievements = (table_Achievement)tableService.GetTable<Nova.Client.Achievement>();
|
||||
table_Character characters = (table_Character)tableService.GetTable<Nova.Client.Character>();
|
||||
|
||||
[ProtocolHandler(NetMsgId.gacha_information_req)]
|
||||
public Packet PlayerLoginHandler(Nil req)
|
||||
{
|
||||
GachaInformationResp gachaInfoResp = new GachaInformationResp()
|
||||
{
|
||||
Information =
|
||||
{
|
||||
new GachaInfo()
|
||||
{
|
||||
Id = 1,
|
||||
DaysCount = 31,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return Packet.Create(NetMsgId.gacha_information_req, gachaInfoResp);
|
||||
Log.Information(Newtonsoft.Json.JsonConvert.SerializeObject(characters, Newtonsoft.Json.Formatting.Indented));
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.player_login_req)] // req id goes here
|
||||
@@ -597,8 +582,11 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
//]);
|
||||
playerInfoResponse.Res.AddRange(pcapPlayerInfo.Res);
|
||||
playerInfoResponse.Items.AddRange(pcapPlayerInfo.Items);
|
||||
|
||||
playerInfoResponse.Res.Where(i => i.Tid == 2).SingleOrDefault().Qty = 777777771; // gacha stone
|
||||
|
||||
playerInfoResponse.Formation = pcapPlayerInfo.Formation;
|
||||
playerInfoResponse.StarTowerRankTicket = 3;
|
||||
//playerInfoResponse.StarTowerRankTicket = 3;
|
||||
playerInfoResponse.Energy = pcapPlayerInfo.Energy;
|
||||
playerInfoResponse.WorldClass = pcapPlayerInfo.WorldClass;
|
||||
playerInfoResponse.Agent = pcapPlayerInfo.Agent;
|
||||
@@ -645,5 +633,14 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
});
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.player_learn_req)]
|
||||
public Packet PlayerLearnHandler(NewbieInfo newbieInfo)
|
||||
{
|
||||
return Packet.Create(NetMsgId.player_learn_succeed_ack, new Nil()
|
||||
{
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user