public uint Execute(PacketDistributed ipacket) { CG_SEND_GUILDMAIL packet = (CG_SEND_GUILDMAIL )ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } //enter your logic return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
void SendGuildMail() { if (Singleton <ObjManager> .Instance.MainPlayer == null) { return; } if (m_GuildMailInput.value == "") { return; } int nGuildJob = GameManager.gameManager.PlayerDataPool.GuildInfo.GetMemberJob(Singleton <ObjManager> .Instance.MainPlayer.GUID); if (nGuildJob != (int)Games.GlobeDefine.GameDefine_Globe.GUILD_JOB.CHIEF && nGuildJob != (int)Games.GlobeDefine.GameDefine_Globe.GUILD_JOB.VICE_CHIEF) { Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{3554}"); return; } int nPlayerCoin = GameManager.gameManager.PlayerDataPool.Money.GetMoney_Coin(); if (nPlayerCoin < GUILDMAIL_COSTCOIN) { Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{3552}"); return; } if (Encoding.UTF8.GetBytes(m_GuildMailInput.value).Length > 180) { // 邮件正文不能超过60个字符。 MessageBoxLogic.OpenOKBox(1259, 1000); return; } if (null != Utils.GetStrFilter(m_GuildMailInput.value, (int)Games.GlobeDefine.GameDefine_Globe.STRFILTER_TYPE.STRFILTER_CHAT)) { // 邮件包含非法字符 MessageBoxLogic.OpenOKBox(1278, 1000); return; } CG_SEND_GUILDMAIL pak = (CG_SEND_GUILDMAIL)PacketDistributed.CreatePacket(MessageID.PACKET_CG_SEND_GUILDMAIL); pak.TextContent = m_GuildMailInput.value; pak.SendPacket(); m_GuildMailInput.value = ""; }