本文整理汇总了C#中Sinan.FrontServer.UserNote.GetInt32方法的典型用法代码示例。如果您正苦于以下问题:C# UserNote.GetInt32方法的具体用法?C# UserNote.GetInt32怎么用?C# UserNote.GetInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sinan.FrontServer.UserNote
的用法示例。
在下文中一共展示了UserNote.GetInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AllUseGoods
private void AllUseGoods(UserNote note)
{
//商品的使用
Variant package = BurdenManager.BurdenPlace(note.Player.B0, note.GetInt32(0));
if (package == null) return;
string goodsid = package.GetStringOrDefault("E");
if (goodsid == null) return;
GameConfig gc = GameConfigAccess.Instance.FindOneById(goodsid);
if (gc == null) return;
UseGoods(note, package, gc, true);
}
示例2: IntoBattle
/// <summary>
/// 进入玩家和怪的战斗
/// </summary>
/// <param name="note"></param>
private void IntoBattle(UserNote note)
{
List<PlayerBusiness> players = FightBase.GetPlayers(note.Player);
FightObject[] teamA = FightBase.CreateFightPlayers(players);
FightType fType = (FightType)(note.GetInt32(0));
FightObject[] teamB = FightBase.CreateApcTeam(players, fType, note[1]);
string npcID = note.GetString(2);
if (players.Count == 0 || teamB.Length == 0)
{
foreach (var v in players)
{
v.SetActionState(ActionState.Standing);
}
return;
}
bool isEctype = (note.Player.Scene is SceneEctype || note.Player.Scene is SceneSubEctype);
FightBusiness fb;
if (fType == FightType.SceneAPC)
{
//打明怪
SceneApc sab = note.GetValue<SceneApc>(3);
int subID = note.GetInt32(4);
fb = new FightSceneApc(teamA, teamB, players, npcID, isEctype, sab, subID);
}
else if (fType == FightType.RobAPC)
{
SceneApc sab = note.GetValue<SceneApc>(3);
int subID = note.GetInt32(4);
RobBusiness rb = note.GetValue<RobBusiness>(5);
fb = new FightBusinessRobApc(teamA, teamB, players, npcID, isEctype, sab, subID, rb);
}
else if (fType == FightType.ProAPC)
{
//守护战争明怪
SceneApc sab = note.GetValue<SceneApc>(3);
int subID = note.GetInt32(4);
PartBusiness pb = note.GetValue<PartBusiness>(5);
fb = new FightBusinessProApc(teamA, teamB, players, npcID, isEctype, sab, subID, pb);
}
else
{
fb = new FightBusiness(teamA, teamB, players, npcID, isEctype);
}
foreach (var player in players)
{
player.Fight = fb;
}
fb.SendToClinet(FightCommand.StartFight, (int)fType, teamA, teamB);
fb.Start();
}
示例3: FightEctypeApc
/// <summary>
/// 跟副本怪战斗
/// </summary>
/// <param name="note"></param>
private void FightEctypeApc(UserNote note)
{
PlayerBusiness player = note.Player;
TeamInstanceBusiness eb = player.TeamInstance;
if (eb == null || player.AState == ActionState.Fight || (player.TeamJob == TeamJob.Member))
{
return;
}
int index = note.GetInt32(0);
if (!eb.CheckBatch(index))
{
//提示
return;
}
const FightType ft = FightType.EctypeApc;
EctypeApc apc = eb.CurrentApcs[index];
List<PlayerBusiness> players = FightBase.GetPlayers(note.Player);
FightObject[] teamA = FightBase.CreateFightPlayers(players);
FightObject[] teamB = FightBase.CreateApcTeam(players, ft, apc.Apc);
if (teamB.Length == 0 || eb.Astate != ActionState.Standing)
{
foreach (var v in players)
{
v.SetActionState(ActionState.Standing);
}
return;
}
FightBusinessEctype fb = new FightBusinessEctype(teamA, teamB, players, eb, apc);
foreach (var item in players)
{
item.Fight = fb;
}
fb.SendToClinet(FightCommand.StartFight, (int)ft, teamA, teamB);
fb.Start();
}
示例4: AuctionBid
/// <summary>
/// 竞价
/// </summary>
public static void AuctionBid(UserNote note)
{
string auctionid = note.GetString(0);
int BidPrice = note.GetInt32(1);//竞价
string npcid = note.GetString(2);//NPC
if (!note.Player.EffectActive(npcid, ""))
return;
if (note.Player.Score < BidPrice)
{
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.NoScore));
//游戏不足
return;
}
Auction auction = AuctionAccess.Instance.FindOne(auctionid);
if (auction == null)
{
//物口不存在
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.NoGoods));
return;
}
string soleid = auctionid + note.Name;
if (!m_dic.TryAdd(soleid, soleid))
return;
try
{
if (auction.Value.GetIntOrDefault("Status") != 0)
{
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.IsSell));
return;
}
DateTime dt = DateTime.UtcNow;
DateTime EndTime;
if (!DateTime.TryParse(auction.Value.GetStringOrEmpty("EndTime"), out EndTime))
{
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.Expired));
return;
}
if (EndTime < dt)
{
//过期物品不能竞拍
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.Expired));
return;
}
int price = auction.Value.GetIntOrDefault("Price");//一口价
if (price > 0 && BidPrice > price)
{
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.MorePrice));
return;
}
else if (price > 0 && BidPrice == price)
{
//一口价操作
UserNote n = new UserNote(note, AuctionCommand.AuctionBuy, new object[] { auction.ID });
Notifier.Instance.Publish(n);
return;
}
int bidPrice = auction.Value.GetIntOrDefault("BidPrice");
if (string.IsNullOrEmpty(auction.Value.GetStringOrEmpty("BidderID")))
{
if (bidPrice > BidPrice)
{
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.LossStartPrice));
return;
}
}
else
{
if (bidPrice >= BidPrice)
{
//竞拍价格太底
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.NoBidPrice));
return;
}
}
if (!note.Player.AddScore(-BidPrice, FinanceType.AuctionBid))
{
note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.MorePrice));
return;
}
if (auction.Value.GetStringOrEmpty("BidderID") != string.Empty)
{
//竞购失败
Dictionary<string, object> bidFail = new Dictionary<string, object>();
bidFail.Add("GoodsName", auction.Name);
bidFail.Add("Name", auction.Value.GetStringOrDefault("BidName"));
bidFail.Add("Score", bidPrice.ToString());
PlayerBusiness BidOnLine = PlayersProxy.FindPlayerByID(auction.Value.GetStringOrDefault("BidderID"));
AuctionEmail.SendAuctionEmail(bidFail, AuctionEmail.BidFail, auction.ID, BidOnLine.ID, BidOnLine.Name, bidPrice, 0, null);
//.........这里部分代码省略.........
示例5: BuyMallGoods
/// <summary>
/// 购买商城产品
/// </summary>
/// <param name="note"></param>
private void BuyMallGoods(UserNote note)
{
//买的道具ID
string id = note.GetString(0);
//数量
int number = note.GetInt32(1);
//货币类型
string cointype = note.GetString(2);
//是否通过GM上下架检查
if (ServerManager.IsMall)
{
//物品没有上架
if (!MallAccess.HS.Contains(id))
{
note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallDown));
return;
}
}
GameConfig gc = GameConfigAccess.Instance.FindOneById(id);
if (gc == null)
{
note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallGoodsNo));
return;
}
Variant v = gc.Value;
DateTime dt = DateTime.UtcNow;
string upDate = v.GetStringOrDefault("UpDate");
//上架时间
if (!string.IsNullOrEmpty(upDate))
{
DateTime update = v.GetDateTimeOrDefault("UpDate").ToUniversalTime();
if (dt < update)
{
note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallUp));
return;
}
}
string downDate = v.GetStringOrDefault("DownDate");
//下架时间
if (!string.IsNullOrEmpty(downDate))
{
DateTime endDate = v.GetDateTimeOrDefault("DownDate").ToUniversalTime();
if (endDate < dt)
{
note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallDown));
return;
}
}
string goodsid = v.GetStringOrDefault("GoodsID");
int count = v.GetIntOrDefault("Number");
GameConfig gid = GameConfigAccess.Instance.FindOneById(goodsid);
if (gid == null)
{
note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallGoodsNo));
return;
}
if (gc.SubType == "ShiZhuang")
{
PlayerEx wx = note.Player.Wardrobe;
Variant wv = wx.Value;
IList wl = wv.GetValue<IList>("WardrobeList");
if (wl != null)
{
if (wl.Contains(goodsid))
{
note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.NoRepeat));
return;
}
}
Variant limit = gid.Value.GetVariantOrDefault("UserLimit");
if (limit != null)
{
if (limit.ContainsKey("Sex"))
{
int sex = Convert.ToInt32(limit["Sex"]);
if (sex != 2 && sex != note.Player.Sex)
{
note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.NoSex));
return;
}
}
}
//需要晶币
int coin = gc.Value.GetIntOrDefault("ZCoin");
if (note.Player.Coin < coin)
{
note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallCoinNo));
//.........这里部分代码省略.........
示例6: SaveShowInfo
/// <summary>
/// 更新显示信息
/// </summary>
/// <param name="note"></param>
private void SaveShowInfo(UserNote note)
{
int showInfo = note.GetInt32(0);
note.Player.ShowInfo = showInfo;
PlayerAccess.Instance.SaveValue(note.Player.PID, "ShowInfo", showInfo);
}
示例7: ConsumeCoin
/// <summary>
/// 晶币变化
/// </summary>
/// <param name="note"></param>
public static void ConsumeCoin(UserNote note)
{
PlayerEx ex = note.Player.Social;
if (ex == null)
return;
Variant m = ex.Value.GetValueOrDefault<Variant>("Mentor");
if (m == null)
return;
IList master = m.GetValue<IList>("Master");
if (master == null || master.Count <= 0)
return;
Variant v = master[0] as Variant;
if (v == null) return;
PlayerBusiness pb = PlayersProxy.FindPlayerByID(v.GetStringOrDefault("PlayerID"));
if (pb == null) return;
int coin = note.GetInt32(0);
FinanceType ft = note.GetValue<FinanceType>(1);
int bond = 0;//得到
int owe = 0;
if (coin < 0)
{
if (note.Player.Level > 39)
{
//高徒
bond = Convert.ToInt32(Math.Ceiling(-coin * 0.05));
}
else
{
//学徒
bond = Convert.ToInt32(Math.Ceiling(-coin * 0.1));
}
owe = Convert.ToInt32(Math.Ceiling(-coin * 0.5));
}
int reTime = Convert.ToInt32(TipManager.GetMessage(EmailReturn.HameDay));
if (bond > 0)
{
if (pb.AddBond(bond, FinanceType.ConsumeCoin))
{
string msg = string.Format(TipManager.GetMessage(SocialReturn.ConsumeCoin1), note.Player.Name, bond);
//"你的徒弟【" + note.Player.Name + "】消费晶币,为感谢师傅的栽培,为师傅送上了【" + bond + "】点劵";
//徒弟消费奖励点劵
if (EmailAccess.Instance.SendEmail(TipManager.GetMessage(SocialReturn.ConsumeCoin2), TipManager.GetMessage(SocialReturn.FriendsBless8), pb.ID, pb.Name, msg, string.Empty, null, reTime))
{
if (pb.Online)
{
pb.Call(EmailCommand.NewEmailTotalR, EmailAccess.Instance.NewTotal(pb.ID));
}
}
}
}
if (owe > 0)
{
if (pb.AddOwe(owe, FinanceType.ConsumeCoin))
{
string msg = string.Format(TipManager.GetMessage(SocialReturn.ConsumeCoin3), owe);
// "你获得了【" + owe + "】点感恩值";
//徒弟消费奖励感恩值
if (EmailAccess.Instance.SendEmail(TipManager.GetMessage(SocialReturn.ConsumeCoin4), TipManager.GetMessage(SocialReturn.FriendsBless8), pb.ID, pb.Name, msg, string.Empty, null, reTime))
{
if (pb.Online)
{
pb.Call(EmailCommand.NewEmailTotalR, EmailAccess.Instance.NewTotal(pb.ID));
pb.Call(ClientCommand.SendActivtyR, new object[] { "T02", msg });
}
}
}
}
//晶币消费总量
//long gce = note.Player.GCE;
}
示例8: HomeProduce
/// <summary>
/// 家园生产
/// </summary>
/// <param name="note"></param>
public static void HomeProduce(UserNote note)
{
string soleid = note.PlayerID + "HomeProduce";
if (!m_dic.TryAdd(soleid, soleid))
return;
try
{
string id = note.GetString(0);
int number = note.GetInt32(1);
string npcid = note.GetString(2);//NPC
if (!note.Player.EffectActive(npcid, ""))
return;
//要生产的道具数量
GameConfig gc = GameConfigAccess.Instance.FindOneById(id);
if (gc == null)
{
note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.PareError));
return;
}
string subType = gc.SubType;
PlayerEx home = note.Player.Home;
if (home == null)
{
note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.NoHome));
return;
}
Variant hv = home.Value;
//得到需要的道具数量,计算出当前可以生产道具的数量
Variant produces = hv.GetValueOrDefault<Variant>("Produces");
if (produces == null)
{
note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.PareError));
return;
}
Variant v = produces.GetValueOrDefault<Variant>(subType);
if (v == null)
{
note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.PareError));
return;
}
IList petList = v.GetValue<IList>("PetList");
if (petList.Count == 0)
{
note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.InPet));
return;
}
int yaoJi = 0;
int juanZhou = 0;
int sheJi = 0;
int jiaGong = 0;
int caiJi = 0;
int jiazhengtotal = 0;//宠物家政值总数
Dictionary<string, Pet> producePet = new Dictionary<string, Pet>();
foreach (Variant d in petList)
{
yaoJi += d.GetIntOrDefault("YaoJi");
juanZhou += d.GetIntOrDefault("JuanZhou");
sheJi += d.GetIntOrDefault("SheJi");
jiaGong += d.GetIntOrDefault("JiaGong");
caiJi += d.GetIntOrDefault("CaiJi");
}
jiazhengtotal = yaoJi + juanZhou + jiaGong + caiJi;
Dictionary<string, int> dic = new Dictionary<string, int>();
dic.Add("YaoJi", yaoJi);
dic.Add("JuanZhou", juanZhou);
dic.Add("SheJi", sheJi);
dic.Add("JiaGong", jiaGong);
dic.Add("CaiJi", caiJi);
//目标道具
string goodsid = gc.Value.GetStringOrDefault("GoodsID");
//生产所需时间,秒钟
int produceTime = gc.Value.GetIntOrDefault("ProduceTime");
//所需家政信息
Variant homeInfo = gc.Value.GetValueOrDefault<Variant>("HomeValue");
//所需家政信息
DateTime dt = DateTime.UtcNow;
DateTime endTime = dt.AddSeconds(number * produceTime);
Variant mv = MemberAccess.MemberInfo(note.Player.MLevel);
//生产队列数
int qc = 3 + mv.GetIntOrDefault("Produce");
//.........这里部分代码省略.........
示例9: BurdenExtend
/// <summary>
/// 包袱或仓库扩展[还要求判断是否要求晶币消费]
/// </summary>
/// <param name="note"></param>
/// <param name="exname">包袱或仓库名</param>
/// <param name="count">扩展数量</param>
private void BurdenExtend(UserNote note)
{
PlayerEx burden = note.Player.B1;
if (burden != null)
{
Variant v = burden.Value;
//最大值
int max = v.GetIntOrDefault("Max");
//当前数量
int cur = v.GetIntOrDefault("Cur");
if (cur >= max)
{
note.Call(BurdenCommand.BurdenExtendR, false, TipManager.GetMessage(BurdenReturn.BurdenMaxEx));
return;
}
int number = note.GetInt32(0);
string goodsid = "";
double lv = GameConfigAccess.Instance.FindExtend(ExtendType.B1, cur.ToString(), out number, out goodsid);
if (string.IsNullOrEmpty(goodsid) || number <= 0)
{
note.Call(PetsCommand.ShockSkillR, false, TipManager.GetMessage(ExtendReturn.B12));
return;
}
if (!note.Player.RemoveGoods(goodsid, number, GoodsSource.BurdenExtend))
{
note.Call(PetsCommand.ShockSkillR, false, TipManager.GetMessage(ExtendReturn.B12));
return;
}
note.Player.UpdateBurden();
if (NumberRandom.RandomHit(lv))
{
v["Cur"] = cur + 7;
IList c = v.GetValue<IList>("C");
for (int i = cur; i < cur + 7; i++)
{
Variant d = new Variant();
d["P"] = i;
d["E"] = "";
d["G"] = "";
d["A"] = 0;
d["S"] = 0;
d["H"] = 0;
d["D"] = 0;
d["T"] = null;
c.Add(d);
}
burden.Save();
note.Call(BurdenCommand.BurdenExtendR, true, TipManager.GetMessage(BurdenReturn.Success));
note.Player.FinishNote(FinishCommand.ExtendLib);
}
else
{
note.Call(PetsCommand.ShockSkillR, false, TipManager.GetMessage(ExtendReturn.B13));
}
}
}
示例10: Fuse
/// <summary>
/// 合成操作,将多个道具或装备合成新的道具[完成]
/// </summary>
/// <param name="note"></param>
private void Fuse(UserNote note)
{
//合成配置的ID
string mixid = note.GetString(0);
//合成数量
int number = note.GetInt32(1);
//提升成功率的数量
int upCount = note.GetInt32(2);
string npcid = note.GetString(3);
if (!note.Player.EffectActive(npcid, ""))
return;
GameConfig gc = GameConfigAccess.Instance.FindOneById(mixid);
if (gc == null)
{
note.Call(FuseCommand.FuseR, false, TipManager.GetMessage(FuseReturn.FuseEquipNo));
return;
}
#region 目标道具基本信息,判断包袱是否满和角色游戏币是否满足
string upid = gc.Value.GetStringOrDefault("UpID");
string fuseGoodsID = gc.Value.GetStringOrDefault("GoodsID");
GameConfig fuseGC = GameConfigAccess.Instance.FindOneById(fuseGoodsID);
int m = BurdenManager.StactCount(fuseGC);
if (m == 0)
{
note.Call(FuseCommand.FuseR, false, TipManager.GetMessage(FuseReturn.FuseEquipError));
return;
}
int y = 0;
int s = Math.DivRem(number, m, out y);
//需要空格子的数量
int n = (y == 0) ? s : s + 1;
PlayerEx burden = note.Player.B0;
IList c = burden.Value.GetValue<IList>("C");
int grid = 0;
int upNumber = 0;
foreach (Variant d in c)
{
if (string.IsNullOrEmpty(d.GetStringOrDefault("E")))
grid++;
//提升成功率的道具
if (upid == d.GetStringOrDefault("G"))
{
upNumber += d.GetIntOrDefault("A");
}
}
if (grid < n)
{
//表示包袱格子数不足
note.Call(FuseCommand.FuseR, false, TipManager.GetMessage(FuseReturn.FuseBurdenFull));
return;
}
if (upNumber < upCount)
{
note.Call(FuseCommand.FuseR, false, TipManager.GetMessage(FuseReturn.FuseGoodsLv));
return;
}
int score = 0;//合成所需游戏币
Variant price = fuseGC.Value.GetValueOrDefault<Variant>("Price");
Variant buy = price.GetValueOrDefault<Variant>("Buy");
score = buy.GetIntOrDefault("Score") * number;
#endregion
#region 判断合成所需材料是否够
IList mixNeed = gc.Value.GetValue<IList>("MixNeed");
int isBinding = 0;
foreach (Variant d in mixNeed)
{
int total = 0;
int numCount = d.GetIntOrDefault("Number") * number;
foreach (Variant con in c)
{
if (con.GetStringOrDefault("G") == d.GetStringOrDefault("GoodsID"))
{
if (total < numCount && con.GetIntOrDefault("H") == 1)
{
//判断目标道具是否为绑定状态
isBinding = 1;
}
total += con.GetIntOrDefault("A");
}
}
if (total < numCount)
//.........这里部分代码省略.........
示例11: FamilyList
/// <summary>
/// 得到所有家族列表
/// </summary>
/// <param name="note"></param>
public static void FamilyList(UserNote note)
{
int pageSize = note.GetInt32(0);
int pageIndex = note.GetInt32(1);
string familName = note.GetString(2);
int totalCount = 0;
int currCount = 0;
List<Family> list = FamilyAccess.Instance.FamilyPage(pageSize, pageIndex, familName, out totalCount, out currCount);
List<Variant> tmp = new List<Variant>();
int a = 0;
foreach (Family model in list)
{
a++;
Variant v = new Variant();
v.Add("ID", model.ID);
v.Add("Name", model.Name);
v.Add("Level", model.Value.GetIntOrDefault("Level"));
IList persons = model.Value.GetValue<IList>("Persons");
string bossName = string.Empty;
foreach (Variant dy in persons)
{
if (dy.GetIntOrDefault("RoleID") == 0)
{
//PlayerBusiness pb = PlayersProxy.FindPlayerByID(dy.GetStringOrDefault("PlayerID"));
////族长名称
//if (pb != null)
//{
// ;// pb.Name;
//}
bossName = PlayerAccess.Instance.GetPlayerName(Convert.ToInt32(dy.GetStringOrDefault("PlayerID"), 16));
break;
}
}
Variant number = new Variant();
number.Add("V", persons.Count);
Variant max = FamilyBase.FamilyCount(model.Value.GetIntOrDefault("Level"));
number.Add("M", max == number ? 20 : max.GetIntOrDefault("Persons"));
v.Add("Number", number);
v.Add("BossName", bossName);
v.Add("Notice", model.Value.GetStringOrDefault("Notice"));
v.Add("Sort", (currCount * pageSize) + a);
tmp.Add(v);
}
note.Call(FamilyCommand.FamilyListR, totalCount, tmp);
}
示例12: ArenaGoodsPet
/// <summary>
/// 物品使用
/// </summary>
/// <param name="note"></param>
public static void ArenaGoodsPet(UserNote note)
{
string sole = note.PlayerID + "ArenaGoodsPet";
if (!m_dic.TryAdd(sole, sole))
return;
try
{
string petid = note.GetString(0);
//使用格子物品的位置
int position = note.GetInt32(1);
ArenaBase model;
if (!ArenaBusiness.ArenaList.TryGetValue(note.Player.SoleID, out model))
{
//请先选择竞技场
note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet1));
return;
}
Variant v = BurdenManager.BurdenPlace(note.Player.B0, position);
if (v == null)
{
//输入参数不对
note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet2));
return;
}
string goodsid = v.GetStringOrDefault("G");
if (string.IsNullOrEmpty(goodsid))
{
//物品不存在
note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet3));
return;
}
GameConfig gc = GameConfigAccess.Instance.FindOneById(goodsid);
if (gc == null)
{
//物品不存在
note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet3));
return;
}
if (gc.SubType != GoodsSub.Supply)
{
//该物品不能在战斗中使用
note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet4));
return;
}
if (!ArenaGoods.SupplyLimit(note, gc))
return;
Pet p;
if (model.Pets.TryGetValue(petid, out p))
{
if (!SupplyPet(gc.Value, p, model, note.Player.Name))
{
//不需要补充
note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet5));
return;
}
//作用成功移除物品
if (note.Player.RemoveGoods(position, GoodsSource.ArenaGoodsPet))
{
//Variant tmp = new Variant();
//tmp.Add("B0", note.Player.B0);
//note.Call(BurdenCommand.BurdenListR, tmp);
note.Player.UpdateBurden();
}
}
}
finally
{
m_dic.TryRemove(sole, out sole);
}
}
示例13: PetInArena
/// <summary>
/// 宠物进入参战
/// </summary>
/// <param name="note"></param>
public static void PetInArena(UserNote note)
{
string petid = note.GetString(0);
string groupname = note.GetString(1);
int x = note.GetInt32(2);
int y = note.GetInt32(3);
if (string.IsNullOrEmpty(note.Player.SoleID))
{
//请选择要参战的竞技场
note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.ArenaGroupName1));
return;
}
ArenaBase model;
if (!ArenaBusiness.ArenaList.TryGetValue(note.Player.SoleID, out model))
{
//请选择要参战的竞技场
note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena1));
return;
}
if (model.StartTime < DateTime.UtcNow)
{
//竞技场已经开始,不能再参战
note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena2));
return;
}
if (!model.GroupName.Contains(groupname))
{
//请选择分组
note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena3));
return;
}
if (!string.IsNullOrEmpty(note.Player.GroupName))
{
if (note.Player.GroupName != groupname)
{
//你已经加入【" + note.Player.GroupName + "】组,不能再选择其它组
note.Call(ArenaCommand.PetInArenaR, false, string.Format(TipManager.GetMessage(ArenaReturn.PetInArena4), note.Player.GroupName));
return;
}
}
PlayerEx b3 = note.Player.B3;
IList c = b3.Value.GetValue<IList>("C");
Variant tmp = null;
foreach (Variant v in c)
{
if (v.GetStringOrDefault("E") == petid)
{
tmp = v;
break;
}
}
if (tmp == null)
{
//宠物不存在
note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena5));
return;
}
Pet p = PetAccess.Instance.FindOneById(petid);
if (p == null || p.PlayerID != note.PlayerID)
{
note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena5));
return;
}
if (PetAccess.Instance.IsFatigue(p))
{
//宠物过度疲劳,不能参加竞技场
note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena6));
return;
}
if (Math.Abs(note.Player.FightValue - model.FightValue) > model.FightPoor)
{
//战绩差距太大,不能参加
note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena7));
return;
}
int count = 0;//已经放入的宠物数量
int groupcount = 0;//得到选组宠物总数
foreach (Pet pk in model.Pets.Values)
{
if (pk.PlayerID == note.PlayerID)
{
count++;
}
//.........这里部分代码省略.........
示例14: ArenaWalk
/// <summary>
/// 行走坐标中转
/// </summary>
/// <param name="note"></param>
public static void ArenaWalk(UserNote note)
{
string petid = note.GetString(0);
Int64 point = note.GetInt64(1);
ArenaBase model;
if (!ArenaBusiness.ArenaList.TryGetValue(note.Player.SoleID, out model))
return;
//开始坐标
Point begin = new Point();
begin.X = Convert.ToInt32(point >> 24);
begin.Y = Convert.ToInt32(point >> 16 & 0xff);
//结束坐标
Point end = new Point();
end.X = Convert.ToInt32(point >> 8 & 0xff);
end.Y = Convert.ToInt32(point & 0xff);
Pet p;
if (model.Pets.TryGetValue(petid, out p))
{
p.StartTime = DateTime.UtcNow;
p.BeginPoint = model.SceneSession.ToScreen(begin);
p.EndPoint = model.SceneSession.ToScreen(end);
p.RangePet = note.GetString(2);
p.PetStatus = note.GetInt32(3);
}
if (p != null)
{
if (p.PetStatus != 0)
{
model.CallAll(ArenaCommand.ArenaWalkR, true, petid, point);
}
}
}
示例15: EmailList
/// <summary>
/// 得到邮件列表
/// </summary>
/// <param name="note"></param>
public static void EmailList(UserNote note)
{
int pageIndex = note.GetInt32(0);
int pageSize = 6;//note.GetInt32(1);
//0所有按时间,1未读,2有附件,3到期时间
int number = note.GetInt32(2);
if (pageIndex < 0 || pageSize < 1)
{
note.Call(EmailCommand.EmailListR, 0, new List<Variant>());
return;
}
int total = 0;
List<Email> emailList = EmailAccess.Instance.EmailPage(note.PlayerID, pageSize, pageIndex, number, out total);
List<Variant> list = new List<Variant>();
foreach (Email model in emailList)
{
Variant mv = model.Value;
if (mv == null)
continue;
Variant v = new Variant();
foreach (var item in mv)
{
v.Add(item.Key, item.Value);
}
v.Add("ID", model.ID);
v.Add("Name", model.Name);
v.Add("MainType", model.MainType);
v.Add("Status", model.Status);
list.Add(v);
}
note.Call(EmailCommand.EmailListR, total, list);
}