コード例 #1
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            string placard = packet.ReadString();
            if (System.Text.Encoding.Default.GetByteCount(placard) > 300)
            {
                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("ConsortiaPlacardUpdateHandler.Long"));
                return 1;
            }
            bool result = false;
            string msg = "ConsortiaPlacardUpdateHandler.Failed";
            using (ConsortiaBussiness db = new ConsortiaBussiness())
            {
                if (db.UpdateConsortiaPlacard(client.Player.PlayerCharacter.ConsortiaID, client.Player.PlayerCharacter.ID, placard, ref msg))
                {
                    msg = "ConsortiaPlacardUpdateHandler.Success";
                    result = true;
                }
            }
            packet.WriteBoolean(result);
            packet.WriteString(LanguageMgr.GetTranslation(msg));
            client.Out.SendTCP(packet);

            return 0;
        }