private void OnReq_AddHeroExp(MessageRecv obj) { System.IO.MemoryStream ms = new System.IO.MemoryStream(obj.Data); ReqAddPlayerExp req = Serializer.Deserialize <ReqAddPlayerExp>(ms); AckAddPlayerExp ack = new AckAddPlayerExp(); ack.Exp = req.Exp; NetworkManager.Instance.Send(MessageID.MSG_ACK_ADDHERO_EXP, ack, 0, 0); }
public void TryAddRoleExp(int exp) { XCharacter role = RoleModule.Instance.GetCurPlayer(); int maxLevel = ReadCfgRoleLevel.Count; if (role.Level >= maxLevel) { GTItemHelper.ShowTip("你不能再获得经验了"); return; } ReqAddPlayerExp req = new ReqAddPlayerExp(); req.Exp = exp; NetworkManager.Instance.Send(MessageID.MSG_REQ_ADDHERO_EXP, req); }