public static void CallEmail(UserNote note) { //MailAddress address = new MailAddress("", string.Empty, Encoding.UTF8); //MailMessage mail = new MailMessage(); //mail.Subject = "asdfasdf"; //mail.From = address; //Dictionary<string, string> dic = new Dictionary<string, string>(); //foreach (string k in dic.Keys) //{ // mail.To.Add(new MailAddress(k, dic[k])); //} //mail.CC.Add(new MailAddress("*****@*****.**", "尊敬的领导")); //mail.Body = string.Empty; //mail.BodyEncoding = Encoding.UTF8; //mail.IsBodyHtml = true; //mail.Priority = MailPriority.Normal; //mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess; //SmtpClient client = new SmtpClient(); //client.Host = "smtp.hotmail.com"; //client.Port = 25; //client.UseDefaultCredentials = false; //client.Credentials = new NetworkCredential("", string.Empty); //client.Send(mail); }
void Execute(UserNote note) { switch (note.Name) { case StarCommand.PlayerMeditation: StarBusiness.PlayerMeditation(note); break; case StarCommand.StartStar: StarBusiness.StartStar(note); break; case StarCommand.StartStarShared: StarBusiness.StartStarShared(note); break; case StarCommand.InStarTroops: StarBusiness.InStarTroops(note); break; case StarCommand.OutStarTroops: StarBusiness.OutStarTroops(note); break; case StarCommand.GetStarTroops: //StarBusiness.GetStarTroops(note); break; case StarCommand.IsStartTroops: StarBusiness.IsStartTroops(note); break; case LoginCommand.PlayerLoginSuccess: StarBusiness.OfflineTroops(note); break; } }
private void GetMyRank(UserNote note) { //int rank = TopAccess.Instance.GetMyRank(note.Player); //note.Call(PaiHangCommand.GetMyRankR, rank); for (int i = 0; i < PlayerDump.Lev0Players.Length; i++) { Player p = PlayerDump.Lev0Players[i]; if (p == null) break; if (p.PID == note.PID) { string fid = note.Player.Family.Value.GetStringOrDefault("FamilyID"); if (!string.IsNullOrEmpty(fid)) { p.Value["LevF"] = GetLevF(fid);//TopAccess.Instance.GetMyFamilyRank(note.Player); } note.Call(PaiHangCommand.GetMyRankR, p.Value); return; } } string fid2 = note.Player.Family.Value.GetStringOrDefault("FamilyID"); int familRank = GetLevF(fid2);// TopAccess.Instance.GetMyFamilyRank(note.Player); if (familRank > 0) { Variant v = new Variant(1); v["LevF"] = familRank; note.Call(PaiHangCommand.GetMyRankR, v); } else { note.Call(PaiHangCommand.GetMyRankR, new object[] { null }); } }
/// <summary> /// 判断是否存在要求回收的物品 /// </summary> /// <param name="note"></param> /// <param name="s"></param> /// <returns>true表示发生变化</returns> public static bool Task10004(UserNote note, Variant s) { if (s.GetIntOrDefault("Cur") == s.GetIntOrDefault("Total")) return false; if (!s.ContainsKey("GoodsID")) return false; if (s.GetIntOrDefault("Type") != 10004) return false; int m = GameConfigAccess.Instance.GetStactCount(s.GetStringOrDefault("GoodsID")); if (m <= 0) return false; PlayerEx burden = note.Player.B0; IList c = burden.Value.GetValue<IList>("C"); int number = 0; foreach (Variant d in c) { if (d.GetStringOrDefault("G") == s.GetStringOrDefault("GoodsID")) { number += d.GetIntOrDefault("A"); } } if (number >= s.GetIntOrDefault("Total")) s["Cur"] = s.GetIntOrDefault("Total"); else s["Cur"] = number; return true; }
protected override void ExecuteUserNote(UserNote note) { switch (note.Name) { //case ClientCommand.WalkTo: // WalkTo(note); // return; //case LoginCommand.PlayerLogin: // PlayerLogin(note); // return; case ClientCommand.IntoSceneSuccess: IntoSceneSuccess(note); return; case ClientCommand.ExitScene: ExitScene(note.Player); return; case ClientCommand.UserDisconnected: Disconnected(note.Player); return; default: return; } }
/// <summary> /// 删除仇人 /// </summary> /// <param name="note"></param> public static void DelEnemy(UserNote note) { string playerid = note.GetString(0); PlayerEx Social = note.Player.Social; IList Enemy = Social.Value.GetValue<IList>("Enemy"); if (Enemy != null) { Variant msg = null; foreach (Variant d in Enemy) { if (d.GetStringOrDefault("PlayerID") == playerid) { msg = d; break; } } if (msg != null) { ///移除成功 Enemy.Remove(msg); Social.Save(); } } Variant v = new Variant(); v.Add("ID",playerid); note.Call(SocialCommand.DelEnemyR, true, v); }
/// <summary> /// 合成光环 /// </summary> /// <param name="note"></param> private void Aura(UserNote note) { RobBusiness part = PartProxy.TryGetPart(Part.Rob) as RobBusiness; if (part != null) { if (part.CombinAura(note)) { //成功合成元素的玩家得奖励 Int32 exp = (int)(part.TotalExp / 100); PlayerBusiness player = note.Player; player.AddExperience(exp, FinanceType.Part); player.AddPetExp(player.Pet, exp, true, (int)FinanceType.Part); var team = player.Team; if (team == null) { player.AddExperience(exp, FinanceType.Part); player.AddPetExp(player.Pet, exp, true, (int)FinanceType.Part); } else { TeamAddExp(team, exp); } } } }
/// <summary> /// 离开队伍 /// </summary> /// <param name="note"></param> /// <param name="team"></param> private void OutTeam(UserNote note, PlayerTeam team) { PlayerBusiness player = note.Player; if (team.RemoveMember(player)) { var buffer = AmfCodec.Encode(TeamCommand.OutTeamR, new object[] { true, team.TeamID, player.ID, player.Name, null }); if (player.SceneID == team.Captain.SceneID) { team.Captain.CallAll(buffer); //通知其它场景上的用户 team.CallAway(buffer, team.Captain.SceneID); } else { player.Call(buffer); //通知其它场景上的用户 team.CallAway(buffer, player.SceneID); } } var t = player.TeamInstance; if (t != null) { t.Exit(player, true); } }
/// <summary> /// 宠物仓库扩展 /// </summary> public void PetExtend(UserNote note) { PlayerEx b2 = note.Player.B2; Variant v = b2.Value; //允许最大值 int max = v.GetIntOrDefault("Max"); //当前值 int cur = v.GetIntOrDefault("Cur"); IList c = v.GetValue<IList>("C"); if (cur >= max) { note.Call(PetsCommand.PetExtendR, false, TipManager.GetMessage(PetsReturn.PetExtendMax)); return; } int n = 4; int number = 0;//note.GetInt32(0); string goodsid = ""; double lv = GameConfigAccess.Instance.FindExtend(ExtendType.B2, cur.ToString(),out number, out goodsid); if (string.IsNullOrEmpty(goodsid) || number <= 0) { note.Call(PetsCommand.PetExtendR, false, TipManager.GetMessage(ExtendReturn.B22)); return; } if (note.Player.RemoveGoods(goodsid, number, GoodsSource.PetExtend)) { note.Player.UpdateBurden(); if (NumberRandom.RandomHit(lv)) { for (int i = cur; i < cur + n; i++) { Variant m = new Variant(); m.Add("P", i); m.Add("E", ""); m.Add("G", "");//道具ID m.Add("A", 0); m.Add("S", 0);//排序 m.Add("H", 0);//0非绑定,1绑定是否绑定 m.Add("D", 0);//0不能堆叠,1可以 m.Add("T", null);//物品类型 c.Add(m); } v["Cur"] = cur + n; b2.Save(); note.Call(PetsCommand.PetExtendR, true, (cur + n)); } else { note.Call(PetsCommand.PetExtendR, false, TipManager.GetMessage(ExtendReturn.B23)); } } else { note.Call(PetsCommand.PetExtendR, false, TipManager.GetMessage(ExtendReturn.B22)); } }
void Execute(UserNote note) { switch (note.Name) { case LoginCommand.PlayerLoginSuccess: //case ActivityCommand.CheckActivity: ActivityBusiness.Activity(note); break; case ClientCommand.UserDisconnected: ActivityBusiness.UserDisconnected(note); break; case ActivityCommand.ActivitySign: ActivityBusiness.Sign(note); break; case ActivityCommand.ActivityAward: ActivityBusiness.ActivityAward(note); break; case ActivityCommand.LoginAward: ActivityBusiness.LoginAward(note); break; case ActivityCommand.SignAward: ActivityBusiness.SignAward(note); break; case ActivityCommand.VIPDayAward: ActivityBusiness.VIPDayAward(note); break; case ActivityCommand.VipExchange: ActivityBusiness.VipExchange(note); break; case ActivityCommand.OnlineAward: ActivityBusiness.OnlineAward(note); break; } }
/// <summary> /// 道具使用限制 /// </summary> /// <param name="note"></param> /// <param name="gc"></param> /// <returns></returns> public static bool SupplyLimit(UserNote note, GameConfig gc) { Variant limit = gc.Value.GetVariantOrDefault("UserLimit"); if (limit == null) return true; //补充类使用限制 return CheckLevel(note, limit); }
void Execute(UserNote note) { //表示角色正在战斗中,客户端提交信息不进行处理 if (note.Player.AState == ActionState.Fight) { Variant msg = GoodsAccess.Instance.LiaoTianList(TipManager.GetMessage(DealReturn.SelfFighting)); note.Call(ClientCommand.SendMsgToAllPlayerR, string.Empty, msg); return; } switch (note.Name) { case DealCommand.DealApply: DealBusiness.DealApply(note); break; case DealCommand.DealApplyBack: DealBusiness.DealApplyBack(note); break; case DealCommand.LockDeal: DealBusiness.LockDeal(note); break; case DealCommand.EnterDeal: DealBusiness.EnterDeal(note); break; case DealCommand.ExitDeal: case ClientCommand.UserDisconnected: DealBusiness.ExitDeal(note); break; } }
void Execute(UserNote note) { //表示角色正在战斗中,客户端提交信息不进行处理 if (note.Player.AState == ActionState.Fight) return; switch (note.Name) { case EmailCommand.EmailList: EmailBusiness.EmailList(note); break; case EmailCommand.SendEmail: EmailBusiness.SendEmail(note); break; case EmailCommand.NewEmailTotal: EmailBusiness.NewEmailTotal(note); break; case EmailCommand.UpdateEmail: EmailBusiness.UpdateEmail(note); break; case EmailCommand.DelEmail: EmailBusiness.DelEmail(note); break; case EmailCommand.ExtractGoods: //EmailBusiness.ExtractGoods(note); EmailBusiness.GetEmailGoods(note); break; case EmailCommand.ExitEmail: EmailBusiness.ExitEmail(note); break; case PartCommand.RobFamilyAward: EmailBusiness.RobFamilyAward(note); break; } }
/// <summary> /// 领取奖励 /// </summary> /// <param name="note"></param> public static void BossAward(UserNote note) { string fid = note.Player.Family.Value.GetStringOrDefault("FamilyID"); if (string.IsNullOrEmpty(fid)) { note.Call(FamilyCommand.BossAwardR, false, TipManager.GetMessage(FamilyReturn.NoAddFamily)); return; } string bid = note.GetString(0); var p = GameConfigAccess.Instance.FindOneById(bid); if (p == null) { return; } string gid = note.GetString(1); //FamilyBossAccess.Instance.ViewAward(fid + bid, note.Player.ID); if (string.IsNullOrEmpty(gid)) { return; } string[] tt = gid.Split('$'); int number = 1; if (tt.Length != 2 || (!int.TryParse(tt[1], out number))) { number = 1; } string goodsid = tt[0]; //TODO:检查包袱 Dictionary<string, Variant> goods = new Dictionary<string, Variant>(); Variant tmp = new Variant(); tmp.Add("Number1", number); goods.Add(goodsid, tmp); if (BurdenManager.GetBurdenSpace(note.Player.B0.Value.GetValue<IList>("C")) == null) { note.Call(FamilyCommand.BossAwardR, false, TipManager.GetMessage(ActivityReturn.SignAward4)); return; } //if (BurdenManager.IsFullBurden(note.Player.B0, goods)) //{ // note.Call(FamilyCommand.BossAwardR, false, TipManager.GetMessage(ActivityReturn.SignAward4)); // return; //} if (FamilyBossAccess.Instance.GetAward(fid + bid, note.Player.ID, gid)) { //发放物品 note.Player.AddGoods(goods, GoodsSource.FamilyBoss); note.Call(FamilyCommand.BossAwardR, true, gid); } else { //已领取.. note.Call(FamilyCommand.BossAwardR, false, TipManager.GetMessage(FamilyReturn.CannotBossAward)); } }
/// <summary> /// 添加好友 /// </summary> /// <param name="note"></param> public static void AddFriends(UserNote note) { string name = note.GetString(0); if (note.Player.Name == name) { return; } PlayerEx social = note.Player.Social; if (social == null) { note.Call(SocialCommand.AddFriendsR, false, TipManager.GetMessage(SocialReturn.UserInfoError)); return; } PlayerBusiness player = PlayersProxy.FindPlayerByName(name); if (player == null) { note.Call(SocialCommand.AddFriendsR, false, TipManager.GetMessage(SocialReturn.UserInfoError)); return; } if (social.Value != null) { if (SocialBusiness.IsLet(social, player.ID, new List<string> { "Friends" })) { note.Call(SocialCommand.AddFriendsR, false, TipManager.GetMessage(SocialReturn.Friends)); return; } if (SocialBusiness.IsLet(social, player.ID, new List<string> { "Enemy" })) { note.Call(SocialCommand.AddFriendsR, false, TipManager.GetMessage(SocialReturn.Master)); return; } } Variant v = new Variant(); v.Add("PlayerID", player.ID); v.Add("Created", DateTime.UtcNow); IList list = social.Value.GetValue<IList>("Friends"); int num = 0; if (list == null) { social.Value["Friends"] = new List<Variant>() { v }; num = 1; } else { list.Add(v); num = list.Count; } social.Save(); note.Call(SocialCommand.AddFriendsR, true, new PlayerSimple(player, 3)); //添加好友 note.Player.FinishNote(FinishCommand.Friends, num); }
void ExecuteNote(UserNote note) { switch (note.Name) { case WebCommand.CodeAward: WebBusiness.CodeAward(note); break; } }
/// <summary> /// 回复交易 /// </summary> /// <param name="note"></param> public static void DealApplyBack(UserNote note) { IList o = note[0] as IList; bool IsSame = false; PlayerBusiness OnlineBusiness = PlayersProxy.FindPlayerByID(o[1].ToString()); if (OnlineBusiness == null || (!OnlineBusiness.Online)) { note.Call(DealCommand.DealApplyBackR, false, TipManager.GetMessage(DealReturn.NoLine)); return; } if (!OnlineBusiness.Value.ContainsKey("Deal")) { note.Call(DealCommand.DealApplyBackR, false, TipManager.GetMessage(DealReturn.BackMsgError)); return; } Variant v0 = note.Player.Value.GetVariantOrDefault("Deal"); Variant v1 = OnlineBusiness.Value.GetVariantOrDefault("Deal"); if (!bool.TryParse(o[0].ToString(), out IsSame)) { if (OnlineBusiness.Value.ContainsKey("Deal")) OnlineBusiness.Value.Remove("Deal"); OnlineBusiness.Call(DealCommand.DealApplyBackR, false, TipManager.GetMessage(DealReturn.NoDeal)); //note.Call(DealCommand.DealApplyBackR, false, TipAccess.GetMessage(DealReturn.NoDeal)); return; } if (!note.Player.Value.ContainsKey("Deal")) { if (OnlineBusiness.Value.ContainsKey("Deal")) OnlineBusiness.Value.Remove("Deal"); OnlineBusiness.Call(DealCommand.DealApplyBackR, false, TipManager.GetMessage(DealReturn.NoDeal)); //note.Call(DealCommand.DealApplyBackR, false, TipAccess.GetMessage(DealReturn.NoDeal)); return; } if (!IsSame) { if (OnlineBusiness.Value.ContainsKey("Deal")) OnlineBusiness.Value.Remove("Deal"); OnlineBusiness.Call(DealCommand.DealApplyBackR, false, TipManager.GetMessage(DealReturn.NoDeal)); if (note.Player.Value.ContainsKey("Deal")) note.Player.Value.Remove("Deal"); //note.Call(DealCommand.DealApplyBackR, false, TipAccess.GetMessage(DealReturn.NoDeal)); return; } v0["Status"] = 1; v1["Status"] = 1; OnlineBusiness.Call(DealCommand.DealApplyBackR, true, DealReturn.AgreeDeal); note.Call(DealCommand.DealApplyBackR, true, DealReturn.AgreeDeal); }
/// <summary> /// 使用者等级限制 /// </summary> /// <param name="note"></param> /// <param name="limit"></param> /// <returns></returns> private static bool CheckLevel(UserNote note, Variant limit) { int needLev = limit.GetIntOrDefault("LevelRequire"); if (needLev > note.Player.Level) { note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(GoodsReturn.NoLevel)); return false; } return true; }
void ExecuteNote(UserNote note) { if (note.Name == UserPlayerCommand.CreatePlayerSuccess) { TaskBusinessBase.TaskActivation(note); return; } // 需验证玩家登录的操作..... if (note.Player == null) return; switch (note.Name) { case TaskCommand.PlayerActivation: TaskBusinessBase.TaskActivation(note); TaskBusinessBase.UpdateTask(note); break; case TaskCommand.PlayerTaskList: case LoginCommand.PlayerLoginSuccess: TaskBusinessBase.TaskList(note); break; case TaskCommand.UpdateTask: TaskBusinessBase.UpdateTask_1(note); break; case TaskCommand.Award: TaskBusinessBase.Award(note); break; case TaskCommand.Giveup: TaskBusinessBase.Giveup(note, note.GetString(0)); break; case TaskCommand.FightingTask: TaskBusinessBase.FightingTask(note); break; case TaskCommand.IsShow: TaskBusinessBase.IsShow(note, note.GetString(0)); break; case TaskCommand.TaskCollect: TaskBusinessBase.TaskCollect(note); break; case ClientCommand.UserDisconnected: TaskAccess.Instance.Remove(note.PlayerID); break; case TaskCommand.TaskGoods: TaskBusinessBase.GoodsTask(note); break; case SocialCommand.InvitedFriends: FinishBusiness.TaskFriends(note); break; case FamilyCommand.AddFamily: TaskBusinessBase.ActFamilyTask(note); break; } }
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); }
/// <summary> /// 宠物奖励 /// </summary> public static void TaskAward112009(UserNote note, Dictionary<string, int> pets) { foreach (string ps in pets.Keys) { for (int i = 0; i < pets[ps]; i++) { PetAccess.Instance.CreatePet(note.Player.B3, ps, 0, 1); } } note.Call(ClientCommand.UpdateActorR, new PlayerExDetail(note.Player.B3)); }
/// <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(); }
void Execute(UserNote note) { //表示角色正在战斗中,客户端提交信息不进行处理 //if (note.Player.AState == ActionState.Fight) // return; switch (note.Name) { case ArenaCommand.CreateArena: ArenaInfo.CreateArena(note); break; case ArenaCommand.GetArenaList: ArenaInfo.GetArenaList(note); break; case ArenaCommand.ArenaInto: ArenaInfo.ArenaInto(note); break; case ArenaCommand.PetListArena: ArenaInfo.PetListArena(note); break; case ArenaCommand.PetInArena: ArenaInfo.PetInArena(note); break; case ArenaCommand.PetOutArena: ArenaInfo.PetOutArena(note); break; case ArenaCommand.SelectSkill: ArenaInfo.SelectSkill(note); break; case ArenaCommand.ArenaGoods: ArenaInfo.ArenaGoodsPet(note); break; case ArenaCommand.ArenaWalk: ArenaInfo.ArenaWalk(note); break; case ArenaCommand.ArenaGroupName: ArenaInfo.ArenaGroupName(note); break; case ClientCommand.UserDisconnected: ArenaInfo.PetOutArena(note); break; case ArenaCommand.PlayerOutArena: ArenaInfo.PlayerOutArena(note); break; case ArenaCommand.SceneBase: ArenaInfo.SceneBase(note); break; case ArenaCommand.ArenaUserCount: ArenaInfo.ArenaUserCount(note); break; } }
/// <summary> /// 添加仇人 /// </summary> /// <param name="note"></param> public static void AddEnemy(UserNote note) { string name = note.GetString(0); PlayerEx Social = note.Player.Social; if (Social == null) { note.Call(SocialCommand.AddEnemyR, false, TipManager.GetMessage(SocialReturn.UserInfoError)); return; } PlayerBusiness player = PlayersProxy.FindPlayerByName(name); if (player == null) { note.Call(SocialCommand.AddEnemyR, false, TipManager.GetMessage(SocialReturn.UserInfoError)); return; } if (SocialBusiness.IsLet(Social, player.ID, new List<string> { "Enemy" })) { note.Call(SocialCommand.AddEnemyR, false, TipManager.GetMessage(SocialReturn.Enemy)); return; } if (SocialBusiness.IsLet(Social, player.ID, new List<string> { "Friends" })) { note.Call(SocialCommand.AddEnemyR, false, TipManager.GetMessage(SocialReturn.Friends)); return; } if (SocialBusiness.IsLet(Social, player.ID, new List<string> { "Apprentice" })) { note.Call(SocialCommand.AddEnemyR, false, TipManager.GetMessage(SocialReturn.Apprentice)); return; } if (SocialBusiness.IsLet(Social, player.ID, new List<string> { "Master" })) { note.Call(SocialCommand.AddEnemyR, false, TipManager.GetMessage(SocialReturn.Master)); return; } IList Enemy = Social.Value.GetValue<IList>("Enemy"); Variant v = new Variant(); v.Add("PlayerID", player.ID); v.Add("Created", DateTime.UtcNow); if (Enemy == null) { Social.Value["Enemy"] = new List<Variant> { v }; } else { Enemy.Add(v); } Social.Save(); note.Call(SocialCommand.AddEnemyR, true, new PlayerSimple(player, 3)); }
/// <summary> /// 移交队长 /// </summary> /// <param name="note"></param> /// <param name="team"></param> private void ChangeManager(UserNote note, PlayerTeam team) { string teamID = team.TeamID; string newCaptainID = note.GetString(0); PlayerBusiness newCaptain = team.TransferCaptain(newCaptainID); if (newCaptain != null) { //通知 var buffer = AmfCodec.Encode(TeamCommand.ChangeManagerR, new object[] { teamID, newCaptainID }); team.Captain.CallAll(buffer); team.CallAway(buffer, note.Player.SceneID); } }
void ExecuteNote(UserNote note) { if (note.Player == null) return; if (note.Player.Scene == null) return; switch (note.Name) { case ClientCommand.OpenBox: OpenBox(note); return; default: return; } }
void ExecuteNote(UserNote note) { if (note.Player == null) return; if (note.Player.Scene == null) return; switch (note.Name) { case FightCommand.FightSceneApc: FightSceneApc(note); return; default: return; } }
/// <summary> /// 增加坐骑熟练度 /// </summary> /// <param name="note"></param> public static void MountSkilling(UserNote note) { Mounts m = note.Player.Mounts; if (m == null) return; Variant mv = m.Value; if (mv == null) return; Variant sk = mv.GetVariantOrDefault("Skill"); if (sk == null) return; bool ischange = false; foreach (var item in sk) { Variant info = item.Value as Variant; if (info == null) continue; GameConfig gc = GameConfigAccess.Instance.FindOneById(item.Key); if (gc == null) continue; Variant ui = gc.UI; if (ui == null) continue; IList sn = ui.GetValue<IList>("StudyNeeds"); if(sn==null) continue; //当前技能等级 int level= info.GetIntOrDefault("Level"); //升级需要的最大熟练度 int max = Convert.ToInt32(sn[level]); int cur = info.GetIntOrDefault("Cur"); if (cur >= max) continue; info["Cur"] = cur + 1; if (!ischange) { ischange = true; } } if (ischange) { m.Save(); note.Player.MountsUpdate(m, new List<string>() { "Skill" }); } }
/// <summary> /// 获取所有技能信息 /// </summary> /// <param name="note"></param> private void GetSkills(UserNote note) { object[] ids = note[0] as object[]; if (ids == null || ids.Length == 0) { var skills = GameConfigAccess.Instance.Find(MainType.Skill, string.Empty); note.Call(SkillCommand.GetSkillsR, true, skills.Select(x => new SkillSimple(x))); } else { var skill = GameConfigAccess.Instance.FindByIDList(ids); note.Call(SkillCommand.GetSkillsR, true, skill.Select(x => new SkillSimple(x))); } }
/// <summary> /// 申请交易 /// </summary> /// <param name="note"></param> public static void DealApply(UserNote note) { string playerid = note.GetString(0); if (note.Player.Value.ContainsKey("Deal")) { note.Call(DealCommand.DealApplyR, false, TipManager.GetMessage(DealReturn.DealOther)); return; } PlayerBusiness OnlineBusiness = PlayersProxy.FindPlayerByID(playerid); if (OnlineBusiness == null || (!OnlineBusiness.Online)) { note.Call(DealCommand.DealApplyR, false, TipManager.GetMessage(DealReturn.NoLine)); return; } if (OnlineBusiness.AState == ActionState.Fight) { note.Call(DealCommand.DealApplyR, false, TipManager.GetMessage(DealReturn.Fighting)); return; } if (OnlineBusiness.Value.ContainsKey("Deal")) { Variant dy = OnlineBusiness.Value.GetVariantOrDefault("Deal"); if (dy.GetIntOrDefault("Status") >= 0) { note.Call(DealCommand.DealApplyR, false, TipManager.GetMessage(DealReturn.DealOther)); return; } } Variant d0 = new Variant(); d0.Add("Status", 0); d0.Add("PlayerID", playerid);//被邀请者 d0.Add("Goods", null); if (!note.Player.Value.ContainsKey("Deal")) note.Player.Value.Add("Deal", d0); Variant d1 = new Variant(); d1.Add("Status", 0); d1.Add("PlayerID", note.PlayerID);//邀请者 d1.Add("Goods", null); if (!OnlineBusiness.Value.ContainsKey("Deal")) OnlineBusiness.Value.Add("Deal", d1); OnlineBusiness.Call(DealCommand.DealApplyR, true, note.PlayerID); note.Call(DealCommand.DealApplyR, true, note.PlayerID); }