public static CChatEntity Build_4_SelectHero(COMDT_CHAT_MSG_BATTLE data) { CChatEntity entity = new CChatEntity { ullUid = data.stFrom.ullUid, iLogicWorldID = (uint)data.stFrom.iLogicWorldID }; if (entity.ullUid == Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID) { entity.type = EChaterType.Self; } else { entity.type = EChaterType.Strenger; } if (data.bChatType == 1) { CChatModel.HeroChatTemplateInfo info = Singleton <CChatController> .instance.model.Get_HeroSelect_ChatTemplate((int)data.stChatInfo.stContentID.dwTextID); if (info.isValid()) { entity.text = info.templateString; } } if (data.bChatType == 2) { entity.text = UT.Bytes2String(data.stChatInfo.stContentStr.szContent); } GetUser(entity.type, entity.ullUid, entity.iLogicWorldID, out entity.name, out entity.level, out entity.head_url, out entity.stGameVip); return(entity); }
public void Load_HeroSelect_ChatTemplate() { if (this.selectHeroTemplateList.get_Count() == 0) { DatabinTable <ResHeroSelectTextData, uint> selectHeroChatDatabin = GameDataMgr.m_selectHeroChatDatabin; if (selectHeroChatDatabin == null) { return; } Dictionary <long, object> .Enumerator enumerator = selectHeroChatDatabin.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <long, object> current = enumerator.get_Current(); ResHeroSelectTextData resHeroSelectTextData = (ResHeroSelectTextData)current.get_Value(); CChatModel.HeroChatTemplateInfo heroChatTemplateInfo = new CChatModel.HeroChatTemplateInfo(0); heroChatTemplateInfo.dwID = (int)resHeroSelectTextData.dwID; heroChatTemplateInfo.dwGroupID = (int)resHeroSelectTextData.dwGroupID; heroChatTemplateInfo.dwTag = (int)resHeroSelectTextData.dwTag; heroChatTemplateInfo.templateString = StringHelper.UTF8BytesToString(ref resHeroSelectTextData.szContent); this.selectHeroTemplateList.Add(heroChatTemplateInfo); } } }