You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

112 lines
5.6 KiB

using System;
using System.Linq;
using Sog;
using LitJson;
using SimpleHttpServer;
using ProtoCSStruct;
namespace Operation
{
public class Item
{
public int id { get; set; }
public string name { get; set; }
public uint itemType { get; set; } // //类型(定义后请修改proro里面的ItemType) 0.普通消耗材料物品(无法直接使用) 1.礼包 2.活动期间兑换券(可叠加) 3.头像边框 4.双倍经验卡 5.使用增加某项数值道具 6.附魔道具 7.角色碎片 8.装备模具 9.任务道具 10.可选礼包 11.地牢事件物品,每日重置清零的 12,道具碎片 13,宝物部件
public uint useType { get; set; } // //使用类型 type=5时 1.使用增加卡牌经验 2.使用增加体力 3.使用增加战队经验 4.增加装备经验 5.增加卡牌名望经验 6、增加金币 7、增加粉尘 8、增加卡牌 9、全资源(金币粉尘英雄经验) 10、宝物经验 type=7 0、使用掉落库,参数1合成数量,参数2掉落库 1、指定ID合成,参数1合成数量,参数2英雄ID,参数3英雄星级 type=11 235每日重置,14不重置
public int param1 { get; set; } // //参数 对头像边框来说就是边框id 对兑换券来说是兑换的金币数量 对buff道具是其持续秒数 对活动期间的物品来说就是活动ID 对于5类型来说,是增加使用类型的对应值 6类型:附魔ID 8类型:装备ID 5(3,6,7) 小时数 7||5.8 数量 10 掉落id 1,7,12 填要求数量
public int param2 { get; set; } // //dropID itemType10:选择数量 useType6-10: 1 研究院加成 2 vip加成 3 研究院和vip都加 itemtype12 填itemID
public int param3 { get; set; } //
public uint maxNum { get; set; } // //最大物品数量
public int validTimeSecond { get; set; } // //有效期,单位秒(不可叠加)
public int sellGetMoneyType { get; set; } // //出售获得货币类型
public int sellGetMoney { get; set; } // //出售获得货币
public int rewardChip { get; set; } // //筹码数量,作为礼包的时候使用,礼包包含物品
public int rewardDiamond { get; set; } // //钻石数量,作为礼包的时候使用,礼包包含物品
public int rewardItemNum { get; set; } // //奖励数量,作为礼包的时候使用,礼包包含物品
}
[MenuMapping(refc = typeof(PlayerInfoOp))]
public class SelectBag
{
public static int OnSelectItemHttpReq(string httpApiCmd, JsonData jsonData, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId)
{
var Language = LanguageDescMgr.Instance.ItemTable;
TraceLog.Trace("SelectBag.OnSelectItemHttpReq Url{0},param count {1}", request.Url, query.Count);
return 0;
}
public static int DoSelectBag(JsonData jsondata, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint id)
{
TraceLog.Trace("SelectBag.DoSelectBag Url{0},param count {1}", request.Url, query.Count);
int uid = query.GetValue("uid").Toint32(0);
SSGmQueryUserRoleInfoReq req = new SSGmQueryUserRoleInfoReq();
req.Id = id;
req.Uid = (uint)uid;
req.AccountType = 0;
//发送消息
OperationServerUtils.SendToWorld((int)SSGameMsgID.GmQueryUserRoleReq, ref req, uid, 0, "");
rsp.IsWaitFor = true;
return 0;
}
[RequestMapping("背包查询",PermissionCode.SELECT_BAG,true)]
public static int OnSelectBagHttpReq(string httpApiCmd, JsonData jsonData, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId)
{
try
{
DoSelectBag(jsonData, rsp, request, query, httpContextId);
}
catch (Exception ex)
{
TraceLog.Error("SelectBag.OnSelectBagHttpReq Error Msg {0}", ex.Message);
}
return 0;
}
[RequestMapping("扣除玩家背包道具",PermissionCode.COST_BAG_ITEM, toLog: true)]
public static int DoCostBagItem(string httpApiCmd, JsonData jsonData, HttpResponse rsp, HttpRequest request, HttpQueryParams query, uint httpContextId)
{
TraceLog.Trace("SelectBag.DoCostBagItem Url{0},param count {1}", request.Url, query.Count);
int uid = query.GetValue("uid").Toint32(0);
if (uid == 0)
{
jsonData["code"] = 6;
jsonData["msg"] = "uid is 0";
return -6;
}
var itemId = query.GetValue("itemId");
int value = query.GetValue("value").Toint32(0);
var config = ItemDescMgr.Instance.GetConfig(itemId);
if (config == null)
{
jsonData["code"] = 6;
jsonData["msg"] = "config not found";
return 6;
}
SSOperationCostItemReq req = new SSOperationCostItemReq();
req.ItemId.SetString(itemId);
req.Uid = (uint)uid;
req.CostNum = value;
//发送消息
OperationServerUtils.SendToWorld((int)SSGameMsgID.OperationCostItemReq, ref req, uid, 0, "");
jsonData["code"] = 0;
jsonData["msg"] = "操作完成,请刷新";
rsp.IsWaitFor = false;
return 0;
}
public static void DoCostBagRes(){
}
}
}