view hero detail

back_recharge
wangyuan 2019-10-15 16:53:08 +08:00
parent 589138f8a1
commit 46e26c9959
7 changed files with 2520 additions and 48 deletions

View File

@ -334,6 +334,34 @@ public final class ChatProto {
* </pre>
*/
int getFrequency();
// optional int32 speed = 20;
/**
* <code>optional int32 speed = 20;</code>
*/
boolean hasSpeed();
/**
* <code>optional int32 speed = 20;</code>
*/
int getSpeed();
// optional int32 multiple = 21;
/**
* <code>optional int32 multiple = 21;</code>
*
* <pre>
*
* </pre>
*/
boolean hasMultiple();
/**
* <code>optional int32 multiple = 21;</code>
*
* <pre>
*
* </pre>
*/
int getMultiple();
}
/**
* Protobuf type {@code com.ljsd.jieling.protocols.ChatInfo}
@ -471,6 +499,16 @@ public final class ChatProto {
frequency_ = input.readInt32();
break;
}
case 160: {
bitField0_ |= 0x00020000;
speed_ = input.readInt32();
break;
}
case 168: {
bitField0_ |= 0x00040000;
multiple_ = input.readInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
@ -981,6 +1019,46 @@ public final class ChatProto {
return frequency_;
}
// optional int32 speed = 20;
public static final int SPEED_FIELD_NUMBER = 20;
private int speed_;
/**
* <code>optional int32 speed = 20;</code>
*/
public boolean hasSpeed() {
return ((bitField0_ & 0x00020000) == 0x00020000);
}
/**
* <code>optional int32 speed = 20;</code>
*/
public int getSpeed() {
return speed_;
}
// optional int32 multiple = 21;
public static final int MULTIPLE_FIELD_NUMBER = 21;
private int multiple_;
/**
* <code>optional int32 multiple = 21;</code>
*
* <pre>
*
* </pre>
*/
public boolean hasMultiple() {
return ((bitField0_ & 0x00040000) == 0x00040000);
}
/**
* <code>optional int32 multiple = 21;</code>
*
* <pre>
*
* </pre>
*/
public int getMultiple() {
return multiple_;
}
private void initFields() {
senderId_ = 0;
senderName_ = "";
@ -999,6 +1077,8 @@ public final class ChatProto {
endTime_ = 0;
priorityLevel_ = 0;
frequency_ = 0;
speed_ = 0;
multiple_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@ -1063,6 +1143,12 @@ public final class ChatProto {
if (((bitField0_ & 0x00010000) == 0x00010000)) {
output.writeInt32(19, frequency_);
}
if (((bitField0_ & 0x00020000) == 0x00020000)) {
output.writeInt32(20, speed_);
}
if (((bitField0_ & 0x00040000) == 0x00040000)) {
output.writeInt32(21, multiple_);
}
getUnknownFields().writeTo(output);
}
@ -1140,6 +1226,14 @@ public final class ChatProto {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(19, frequency_);
}
if (((bitField0_ & 0x00020000) == 0x00020000)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(20, speed_);
}
if (((bitField0_ & 0x00040000) == 0x00040000)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(21, multiple_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@ -1290,6 +1384,10 @@ public final class ChatProto {
bitField0_ = (bitField0_ & ~0x00008000);
frequency_ = 0;
bitField0_ = (bitField0_ & ~0x00010000);
speed_ = 0;
bitField0_ = (bitField0_ & ~0x00020000);
multiple_ = 0;
bitField0_ = (bitField0_ & ~0x00040000);
return this;
}
@ -1386,6 +1484,14 @@ public final class ChatProto {
to_bitField0_ |= 0x00010000;
}
result.frequency_ = frequency_;
if (((from_bitField0_ & 0x00020000) == 0x00020000)) {
to_bitField0_ |= 0x00020000;
}
result.speed_ = speed_;
if (((from_bitField0_ & 0x00040000) == 0x00040000)) {
to_bitField0_ |= 0x00040000;
}
result.multiple_ = multiple_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@ -1457,6 +1563,12 @@ public final class ChatProto {
if (other.hasFrequency()) {
setFrequency(other.getFrequency());
}
if (other.hasSpeed()) {
setSpeed(other.getSpeed());
}
if (other.hasMultiple()) {
setMultiple(other.getMultiple());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@ -2415,6 +2527,88 @@ public final class ChatProto {
return this;
}
// optional int32 speed = 20;
private int speed_ ;
/**
* <code>optional int32 speed = 20;</code>
*/
public boolean hasSpeed() {
return ((bitField0_ & 0x00020000) == 0x00020000);
}
/**
* <code>optional int32 speed = 20;</code>
*/
public int getSpeed() {
return speed_;
}
/**
* <code>optional int32 speed = 20;</code>
*/
public Builder setSpeed(int value) {
bitField0_ |= 0x00020000;
speed_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 speed = 20;</code>
*/
public Builder clearSpeed() {
bitField0_ = (bitField0_ & ~0x00020000);
speed_ = 0;
onChanged();
return this;
}
// optional int32 multiple = 21;
private int multiple_ ;
/**
* <code>optional int32 multiple = 21;</code>
*
* <pre>
*
* </pre>
*/
public boolean hasMultiple() {
return ((bitField0_ & 0x00040000) == 0x00040000);
}
/**
* <code>optional int32 multiple = 21;</code>
*
* <pre>
*
* </pre>
*/
public int getMultiple() {
return multiple_;
}
/**
* <code>optional int32 multiple = 21;</code>
*
* <pre>
*
* </pre>
*/
public Builder setMultiple(int value) {
bitField0_ |= 0x00040000;
multiple_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 multiple = 21;</code>
*
* <pre>
*
* </pre>
*/
public Builder clearMultiple() {
bitField0_ = (bitField0_ & ~0x00040000);
multiple_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.ChatInfo)
}
@ -5553,25 +5747,25 @@ public final class ChatProto {
static {
java.lang.String[] descriptorData = {
"\n\017ChatProto.proto\022\032com.ljsd.jieling.prot" +
"ocols\"\266\002\n\010ChatInfo\022\020\n\010senderId\030\001 \001(\005\022\022\n\n" +
"ocols\"\327\002\n\010ChatInfo\022\020\n\010senderId\030\001 \001(\005\022\022\n\n" +
"senderName\030\002 \001(\t\022\023\n\013senderlevel\030\003 \001(\005\022\021\n" +
"\tsendervip\030\005 \001(\005\022\r\n\005times\030\006 \001(\004\022\013\n\003msg\030\007" +
" \001(\t\022\014\n\004head\030\010 \001(\005\022\r\n\005frame\030\t \001(\005\022\017\n\007sou" +
"lVal\030\n \001(\005\022\021\n\tmessageId\030\013 \001(\004\022\023\n\013message" +
"Type\030\r \001(\005\022\016\n\006itemId\030\016 \001(\005\022\014\n\004type\030\017 \001(\005" +
"\022\021\n\tstartTime\030\020 \001(\005\022\017\n\007endTime\030\021 \001(\005\022\025\n\r" +
"PriorityLevel\030\022 \001(\005\022\021\n\tFrequency\030\023 \001(\005\"@" +
"\n\031GetChatMessageInfoRequest\022\020\n\010chatType\030",
"\001 \001(\005\022\021\n\tmessageId\030\002 \001(\004\"T\n\032GetChatMessa" +
"geInfoResponse\0226\n\010chatInfo\030\001 \003(\0132$.com.l" +
"jsd.jieling.protocols.ChatInfo\"I\n\022SendCh" +
"atInfoReqest\022\020\n\010chatType\030\001 \001(\005\022\017\n\007messag" +
"e\030\002 \001(\t\022\020\n\010friendId\030\003 \001(\005\"N\n\024SendChatInf" +
"oResponse\0226\n\010chatInfo\030\001 \001(\0132$.com.ljsd.j" +
"ieling.protocols.ChatInfo\"^\n\026SendChatInf" +
"oIndication\0226\n\010chatInfo\030\001 \001(\0132$.com.ljsd" +
".jieling.protocols.ChatInfo\022\014\n\004type\030\002 \001(" +
"\005B\002H\001"
"PriorityLevel\030\022 \001(\005\022\021\n\tFrequency\030\023 \001(\005\022\r" +
"\n\005speed\030\024 \001(\005\022\020\n\010multiple\030\025 \001(\005\"@\n\031GetCh",
"atMessageInfoRequest\022\020\n\010chatType\030\001 \001(\005\022\021" +
"\n\tmessageId\030\002 \001(\004\"T\n\032GetChatMessageInfoR" +
"esponse\0226\n\010chatInfo\030\001 \003(\0132$.com.ljsd.jie" +
"ling.protocols.ChatInfo\"I\n\022SendChatInfoR" +
"eqest\022\020\n\010chatType\030\001 \001(\005\022\017\n\007message\030\002 \001(\t" +
"\022\020\n\010friendId\030\003 \001(\005\"N\n\024SendChatInfoRespon" +
"se\0226\n\010chatInfo\030\001 \001(\0132$.com.ljsd.jieling." +
"protocols.ChatInfo\"^\n\026SendChatInfoIndica" +
"tion\0226\n\010chatInfo\030\001 \001(\0132$.com.ljsd.jielin" +
"g.protocols.ChatInfo\022\014\n\004type\030\002 \001(\005B\002H\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@ -5583,7 +5777,7 @@ public final class ChatProto {
internal_static_com_ljsd_jieling_protocols_ChatInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_com_ljsd_jieling_protocols_ChatInfo_descriptor,
new java.lang.String[] { "SenderId", "SenderName", "Senderlevel", "Sendervip", "Times", "Msg", "Head", "Frame", "SoulVal", "MessageId", "MessageType", "ItemId", "Type", "StartTime", "EndTime", "PriorityLevel", "Frequency", });
new java.lang.String[] { "SenderId", "SenderName", "Senderlevel", "Sendervip", "Times", "Msg", "Head", "Frame", "SoulVal", "MessageId", "MessageType", "ItemId", "Type", "StartTime", "EndTime", "PriorityLevel", "Frequency", "Speed", "Multiple", });
internal_static_com_ljsd_jieling_protocols_GetChatMessageInfoRequest_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_com_ljsd_jieling_protocols_GetChatMessageInfoRequest_fieldAccessorTable = new

View File

@ -2701,6 +2701,18 @@ public final class MessageTypeProto {
* <code>VIP_TAKE_REWARD_RESPONSE = 12105;</code>
*/
VIP_TAKE_REWARD_RESPONSE(429, 12105),
/**
* <code>VIEW_HERO_INFO_REQUEST = 12106;</code>
*
* <pre>
*
* </pre>
*/
VIEW_HERO_INFO_REQUEST(430, 12106),
/**
* <code>VIEW_HERO_INFO_RESPONSE = 12107;</code>
*/
VIEW_HERO_INFO_RESPONSE(431, 12107),
/**
* <code>WORKSHOP_FOUNDATION_REQUEST = 12200;</code>
*
@ -2708,11 +2720,11 @@ public final class MessageTypeProto {
* W 12200
* </pre>
*/
WORKSHOP_FOUNDATION_REQUEST(430, 12200),
WORKSHOP_FOUNDATION_REQUEST(432, 12200),
/**
* <code>WORKSHOP_FOUNDATION_RESPONSE = 12201;</code>
*/
WORKSHOP_FOUNDATION_RESPONSE(431, 12201),
WORKSHOP_FOUNDATION_RESPONSE(433, 12201),
/**
* <code>WORKSHOP_EQUIP_CREATE_REQUEST = 12202;</code>
*
@ -2720,11 +2732,11 @@ public final class MessageTypeProto {
*
* </pre>
*/
WORKSHOP_EQUIP_CREATE_REQUEST(432, 12202),
WORKSHOP_EQUIP_CREATE_REQUEST(434, 12202),
/**
* <code>WORKSHOP_EQUIP_CREATE_RESPONSE = 12203;</code>
*/
WORKSHOP_EQUIP_CREATE_RESPONSE(433, 12203),
WORKSHOP_EQUIP_CREATE_RESPONSE(435, 12203),
/**
* <code>WORKSHOP_REBUILD_REQUEST = 12204;</code>
*
@ -2732,11 +2744,11 @@ public final class MessageTypeProto {
*
* </pre>
*/
WORKSHOP_REBUILD_REQUEST(434, 12204),
WORKSHOP_REBUILD_REQUEST(436, 12204),
/**
* <code>WORKSHOP_REBUILD_RESPONSE = 12205;</code>
*/
WORKSHOP_REBUILD_RESPONSE(435, 12205),
WORKSHOP_REBUILD_RESPONSE(437, 12205),
/**
* <code>WORKSHOP_REBUILD_CONFIRM_REQUEST = 12206;</code>
*
@ -2744,11 +2756,11 @@ public final class MessageTypeProto {
*
* </pre>
*/
WORKSHOP_REBUILD_CONFIRM_REQUEST(436, 12206),
WORKSHOP_REBUILD_CONFIRM_REQUEST(438, 12206),
/**
* <code>WORKSHOP_REBUILD_CONFIRM_RESONSE = 12207;</code>
*/
WORKSHOP_REBUILD_CONFIRM_RESONSE(437, 12207),
WORKSHOP_REBUILD_CONFIRM_RESONSE(439, 12207),
/**
* <code>WORKSHOP_LEVELUP_REQUEST = 12208;</code>
*
@ -2756,11 +2768,11 @@ public final class MessageTypeProto {
*
* </pre>
*/
WORKSHOP_LEVELUP_REQUEST(438, 12208),
WORKSHOP_LEVELUP_REQUEST(440, 12208),
/**
* <code>WORKSHOP_LEVELUP_RESPONSE = 12209;</code>
*/
WORKSHOP_LEVELUP_RESPONSE(439, 12209),
WORKSHOP_LEVELUP_RESPONSE(441, 12209),
/**
* <code>WORKSHOP_TECHNOLOGY_LEVEL_REQUEST = 12210;</code>
*
@ -2768,11 +2780,11 @@ public final class MessageTypeProto {
*
* </pre>
*/
WORKSHOP_TECHNOLOGY_LEVEL_REQUEST(440, 12210),
WORKSHOP_TECHNOLOGY_LEVEL_REQUEST(442, 12210),
/**
* <code>WORKSHOP_TECHNOLOGY_RESPONSE = 12211;</code>
*/
WORKSHOP_TECHNOLOGY_RESPONSE(441, 12211),
WORKSHOP_TECHNOLOGY_RESPONSE(443, 12211),
/**
* <code>WORKSHOP_TECHNOLOGY_RESET_REQUEST = 12212;</code>
*
@ -2780,11 +2792,11 @@ public final class MessageTypeProto {
*
* </pre>
*/
WORKSHOP_TECHNOLOGY_RESET_REQUEST(442, 12212),
WORKSHOP_TECHNOLOGY_RESET_REQUEST(444, 12212),
/**
* <code>WORKSHOP_TECHNOLOGY_RESET_RESPONSE = 12213;</code>
*/
WORKSHOP_TECHNOLOGY_RESET_RESPONSE(443, 12213),
WORKSHOP_TECHNOLOGY_RESET_RESPONSE(445, 12213),
;
/**
@ -5475,6 +5487,18 @@ public final class MessageTypeProto {
* <code>VIP_TAKE_REWARD_RESPONSE = 12105;</code>
*/
public static final int VIP_TAKE_REWARD_RESPONSE_VALUE = 12105;
/**
* <code>VIEW_HERO_INFO_REQUEST = 12106;</code>
*
* <pre>
*
* </pre>
*/
public static final int VIEW_HERO_INFO_REQUEST_VALUE = 12106;
/**
* <code>VIEW_HERO_INFO_RESPONSE = 12107;</code>
*/
public static final int VIEW_HERO_INFO_RESPONSE_VALUE = 12107;
/**
* <code>WORKSHOP_FOUNDATION_REQUEST = 12200;</code>
*
@ -5995,6 +6019,8 @@ public final class MessageTypeProto {
case 12103: return VIP_LEVELUP_RESPONSE;
case 12104: return VIP_TAKE_REWARD_REQUEST;
case 12105: return VIP_TAKE_REWARD_RESPONSE;
case 12106: return VIEW_HERO_INFO_REQUEST;
case 12107: return VIEW_HERO_INFO_RESPONSE;
case 12200: return WORKSHOP_FOUNDATION_REQUEST;
case 12201: return WORKSHOP_FOUNDATION_RESPONSE;
case 12202: return WORKSHOP_EQUIP_CREATE_REQUEST;
@ -6070,7 +6096,7 @@ public final class MessageTypeProto {
static {
java.lang.String[] descriptorData = {
"\n\026MessageTypeProto.proto\022\032com.ljsd.jieli" +
"ng.protocols*\202o\n\013MessageType\022\027\n\022HEART_BE" +
"ng.protocols*\275o\n\013MessageType\022\027\n\022HEART_BE" +
"AT_REQUEST\020\350\007\022\030\n\023HEART_BEAT_RESPONSE\020\351\007\022" +
"\036\n\031ACTIVITE_WORKSHOP_REQUEST\020\224N\022\037\n\032ACTIV" +
"ITE_WORKSHOP_RESPONSE\020\225N\022\027\n\022ARENA_INFO_R" +
@ -6413,19 +6439,21 @@ public final class MessageTypeProto {
"SPONSE\020\305^\022\030\n\023VIP_LEVELUP_REQEUST\020\306^\022\031\n\024V" +
"IP_LEVELUP_RESPONSE\020\307^\022\034\n\027VIP_TAKE_REWAR" +
"D_REQUEST\020\310^\022\035\n\030VIP_TAKE_REWARD_RESPONSE" +
"\020\311^\022 \n\033WORKSHOP_FOUNDATION_REQUEST\020\250_\022!\n" +
"\034WORKSHOP_FOUNDATION_RESPONSE\020\251_\022\"\n\035WORK" +
"SHOP_EQUIP_CREATE_REQUEST\020\252_\022#\n\036WORKSHOP" +
"_EQUIP_CREATE_RESPONSE\020\253_\022\035\n\030WORKSHOP_RE" +
"BUILD_REQUEST\020\254_\022\036\n\031WORKSHOP_REBUILD_RES" +
"PONSE\020\255_\022%\n WORKSHOP_REBUILD_CONFIRM_REQ",
"UEST\020\256_\022%\n WORKSHOP_REBUILD_CONFIRM_RESO" +
"NSE\020\257_\022\035\n\030WORKSHOP_LEVELUP_REQUEST\020\260_\022\036\n" +
"\031WORKSHOP_LEVELUP_RESPONSE\020\261_\022&\n!WORKSHO" +
"P_TECHNOLOGY_LEVEL_REQUEST\020\262_\022!\n\034WORKSHO" +
"P_TECHNOLOGY_RESPONSE\020\263_\022&\n!WORKSHOP_TEC" +
"HNOLOGY_RESET_REQUEST\020\264_\022\'\n\"WORKSHOP_TEC" +
"HNOLOGY_RESET_RESPONSE\020\265_B\002H\001"
"\020\311^\022\033\n\026VIEW_HERO_INFO_REQUEST\020\312^\022\034\n\027VIEW" +
"_HERO_INFO_RESPONSE\020\313^\022 \n\033WORKSHOP_FOUND" +
"ATION_REQUEST\020\250_\022!\n\034WORKSHOP_FOUNDATION_" +
"RESPONSE\020\251_\022\"\n\035WORKSHOP_EQUIP_CREATE_REQ" +
"UEST\020\252_\022#\n\036WORKSHOP_EQUIP_CREATE_RESPONS" +
"E\020\253_\022\035\n\030WORKSHOP_REBUILD_REQUEST\020\254_\022\036\n\031W",
"ORKSHOP_REBUILD_RESPONSE\020\255_\022%\n WORKSHOP_" +
"REBUILD_CONFIRM_REQUEST\020\256_\022%\n WORKSHOP_R" +
"EBUILD_CONFIRM_RESONSE\020\257_\022\035\n\030WORKSHOP_LE" +
"VELUP_REQUEST\020\260_\022\036\n\031WORKSHOP_LEVELUP_RES" +
"PONSE\020\261_\022&\n!WORKSHOP_TECHNOLOGY_LEVEL_RE" +
"QUEST\020\262_\022!\n\034WORKSHOP_TECHNOLOGY_RESPONSE" +
"\020\263_\022&\n!WORKSHOP_TECHNOLOGY_RESET_REQUEST" +
"\020\264_\022\'\n\"WORKSHOP_TECHNOLOGY_RESET_RESPONS" +
"E\020\265_B\002H\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {

View File

@ -1765,7 +1765,7 @@ public class MapLogic {
if (hero == null) {
continue;
}
heroForces += HeroLogic.getInstance().calHeoForce(user, hero, true);
heroForces += HeroLogic.getInstance().calHeoForce(user, hero);
crossInfo.getHeroIds().add(hero.getTemplateId());
}

View File

@ -0,0 +1,19 @@
package com.ljsd.jieling.handler.player;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
public class ViewHeroInfoHandler extends BaseHandler<PlayerInfoProto.ViewHeroInfoRequest> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.VIEW_HERO_INFO_REQUEST;
}
@Override
public void processWithProto(ISession iSession, PlayerInfoProto.ViewHeroInfoRequest proto) throws Exception {
PlayerLogic.getInstance().viewHeroInfo(iSession,proto.getTargetUid(),proto.getHeroId());
}
}

View File

@ -1300,7 +1300,7 @@ public class HeroLogic {
}
public int calHeoForce(User user, Hero hero,boolean isMyself){
public int calHeoForce(User user, Hero hero){
Map<Integer, Integer> heroAllAttribute;
heroAllAttribute = calHeroNotBufferAttribute(user, hero,true,0);
//战力保存
@ -1309,7 +1309,7 @@ public class HeroLogic {
}
private int calForce( Map<Integer, Integer> heroAllAttribute ){
public int calForce( Map<Integer, Integer> heroAllAttribute ){
double result = 0;
for(Map.Entry<Integer, Integer> item : heroAllAttribute.entrySet()){
Integer propertyId = item.getKey();
@ -1806,7 +1806,7 @@ public class HeroLogic {
if (hero == null) {
continue;
}
totalForce +=calHeoForce(targetUser, hero,isMyself);
totalForce +=calHeoForce(targetUser, hero);
}
return totalForce;
}
@ -2054,7 +2054,7 @@ public class HeroLogic {
for(TeamPosHeroInfo teamPosHeroInfo: teamPosHeroInfoList){
String heroId = teamPosHeroInfo.getHeroId();
Hero hero = heroMap.get(heroId);
heroPosMap.put(teamPosHeroInfo.getPosition(),calHeoForce(user,hero,false));
heroPosMap.put(teamPosHeroInfo.getPosition(),calHeoForce(user,hero));
}
for(int i=1;i<6;i++){
Integer force = heroPosMap.get(i);

View File

@ -35,6 +35,7 @@ import manager.STableManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import util.MathUtils;
import util.StringUtil;
import util.TimeUtils;
import java.util.*;
@ -470,6 +471,40 @@ public class PlayerLogic {
}
public void viewHeroInfo(ISession session,int uid,String heroId) throws Exception {
User userInMem = UserManager.getUserInMem(uid);
int resMsgId = MessageTypeProto.MessageType.VIEW_HERO_INFO_RESPONSE_VALUE;
if(userInMem == null){
MessageUtil.sendErrorResponse(session,0,resMsgId,"not allowed");
return;
}
Hero hero = userInMem.getHeroManager().getHeroMap().get(heroId);
if(hero == null){
MessageUtil.sendErrorResponse(session,0,resMsgId,"hero no");
return;
}
PlayerInfoProto.ViewHeroInfoResponse.Builder builder = PlayerInfoProto.ViewHeroInfoResponse.newBuilder();
Map<Integer, Integer> heroNotBufferAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(userInMem, hero, true, 0);
for(Map.Entry<Integer,Integer> item : heroNotBufferAttribute.entrySet()){
builder.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(item.getKey()).setPropertyValue(item.getValue()).build());
}
EquipManager equipManager = userInMem.getEquipManager();
Map<String, Equip> equipMap = equipManager.getEquipMap();
for(String equipId : hero.getEquipByPositionMap().values()){
builder.addEquip(CBean2Proto.getEquipProto(equipMap.get(equipId)));
}
Map<String, SoulEquip> soulEquipMap = equipManager.getSoulEquipMap();
for(String equipId : hero.getSoulEquipByPositionMap().values()){
builder.addEquip(CBean2Proto.getEquipProto(soulEquipMap.get(equipId)));
}
String especialEquip = hero.getEspecialEquip();
if(!StringUtil.isEmpty(especialEquip)){
builder.addEquip(CBean2Proto.getEquipProto(equipManager.getEspecialEquipMap().get(especialEquip)));
}
builder.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute));
MessageUtil.sendMessage(session,1,resMsgId,builder.build(),true);
}
public void takeSevenScoreReward(ISession iSession) throws Exception {
User user = UserManager.getUser(iSession.getUid());
int msgId = MessageTypeProto.MessageType.TAKE_SEVEN_HAPPY_REWARD_RESPONSE_VALUE;