mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-08-02 12:02:56 +00:00
c
This commit is contained in:
parent
38830b7c4f
commit
e06975f872
@ -721,65 +721,79 @@ namespace Oshima.Core.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("cckjs")]
|
[HttpPost("cckjs")]
|
||||||
public string GetCharacterInfoFromInventory([FromQuery] long? qq = null, [FromQuery] int? index = null)
|
public string GetCharacterInfoFromInventory([FromQuery] long? qq = null, [FromQuery] int? seq = null)
|
||||||
{
|
{
|
||||||
long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
|
try
|
||||||
int itemIndex = index ?? 0;
|
|
||||||
|
|
||||||
PluginConfig pc = new("saved", userid.ToString());
|
|
||||||
pc.LoadConfig();
|
|
||||||
|
|
||||||
if (pc.Count > 0)
|
|
||||||
{
|
{
|
||||||
User user = FunGameService.GetUser(pc);
|
long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
|
||||||
|
int cIndex = seq ?? 0;
|
||||||
|
|
||||||
if (itemIndex > 0 && itemIndex <= user.Inventory.Characters.Count)
|
PluginConfig pc = new("saved", userid.ToString());
|
||||||
|
pc.LoadConfig();
|
||||||
|
|
||||||
|
if (pc.Count > 0)
|
||||||
{
|
{
|
||||||
Character character = user.Inventory.Characters.ToList()[itemIndex - 1];
|
User user = FunGameService.GetUser(pc);
|
||||||
return NetworkUtility.JsonSerialize($"这是你库存中序号为 {itemIndex} 的角色详细信息:\r\n{character.GetInfo().Trim()}");
|
|
||||||
|
if (cIndex > 0 && cIndex <= user.Inventory.Characters.Count)
|
||||||
|
{
|
||||||
|
Character character = user.Inventory.Characters.ToList()[cIndex - 1];
|
||||||
|
return NetworkUtility.JsonSerialize($"这是你库存中序号为 {cIndex} 的角色详细信息:\r\n{character.GetInfo().Trim()}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NetworkUtility.JsonSerialize($"没有找到与这个序号相对应的角色!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return NetworkUtility.JsonSerialize($"没有找到与这个序号相对应的角色!");
|
return NetworkUtility.JsonSerialize(noSaved);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
return NetworkUtility.JsonSerialize(noSaved);
|
return NetworkUtility.JsonSerialize(e.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("cckwp")]
|
[HttpPost("cckwp")]
|
||||||
public string GetItemInfoFromInventory([FromQuery] long? qq = null, [FromQuery] int? index = null)
|
public string GetItemInfoFromInventory([FromQuery] long? qq = null, [FromQuery] int? seq = null)
|
||||||
{
|
{
|
||||||
long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
|
try
|
||||||
int itemIndex = index ?? 0;
|
|
||||||
|
|
||||||
PluginConfig pc = new("saved", userid.ToString());
|
|
||||||
pc.LoadConfig();
|
|
||||||
|
|
||||||
if (pc.Count > 0)
|
|
||||||
{
|
{
|
||||||
User user = FunGameService.GetUser(pc);
|
long userid = qq ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
|
||||||
|
int itemIndex = seq ?? 0;
|
||||||
|
|
||||||
if (itemIndex > 0 && itemIndex <= user.Inventory.Items.Count)
|
PluginConfig pc = new("saved", userid.ToString());
|
||||||
|
pc.LoadConfig();
|
||||||
|
|
||||||
|
if (pc.Count > 0)
|
||||||
{
|
{
|
||||||
Item item = user.Inventory.Items.ToList()[itemIndex - 1];
|
User user = FunGameService.GetUser(pc);
|
||||||
return NetworkUtility.JsonSerialize($"这是你库存中序号为 {itemIndex} 的物品详细信息:\r\n{item.ToStringInventory(true).Trim()}");
|
|
||||||
|
if (itemIndex > 0 && itemIndex <= user.Inventory.Items.Count)
|
||||||
|
{
|
||||||
|
Item item = user.Inventory.Items.ToList()[itemIndex - 1];
|
||||||
|
return NetworkUtility.JsonSerialize($"这是你库存中序号为 {itemIndex} 的物品详细信息:\r\n{item.ToStringInventory(true).Trim()}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NetworkUtility.JsonSerialize($"没有找到与这个序号相对应的物品!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return NetworkUtility.JsonSerialize($"没有找到与这个序号相对应的物品!");
|
return NetworkUtility.JsonSerialize(noSaved);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
return NetworkUtility.JsonSerialize(noSaved);
|
return NetworkUtility.JsonSerialize(e.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("reload")]
|
[HttpGet("reload")]
|
||||||
public string Relaod([FromQuery] long? master = null)
|
public string Relaod([FromQuery] long? master = null)
|
||||||
{
|
{
|
||||||
if (master != null && master == GeneralSettings.Master)
|
if (master != null && master == GeneralSettings.Master)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user