Exemple #1
0
        public static void HandleChat(TNLConnection conn, Packet packet)
        {
            var type = (ChatType) packet.ReadUInteger();
            var isGm = packet.ReadBoolean();
            var recipient = packet.ReadUtf8StringOn(17);
            var sender = packet.ReadUtf8StringOn(17);
            packet.ReadPadding(1);
            var msglen = packet.ReadUShort();

            var msg = packet.ReadUtf8StringOn(msglen);
            if (msg.StartsWith("/"))
            {
                if (msg.Equals("/save"))
                    conn.CurrentCharacter.SaveToDB();

                return;
            }

            var pack = ConstructChatPacket(type, isGm, recipient, sender, msg);

            switch (type)
            {
                default:
                    Logger.WriteLog("Unhandled ChatType in HandleChat: {0}", LogType.Error, type);
                    break;
            }
        }
Exemple #2
0
        public static void AddEntry(TNLConnection session, Packet packet, SocialType type)
        {
            packet.ReadPadding(4);
            var coid = packet.ReadLong();
            /*var name = */packet.ReadUtf8StringOn(17);
            packet.ReadPadding(7);

            DataAccess.Social.AddEntry(session.CurrentCharacter.GetCOID(), coid, type);
        }
Exemple #3
0
        public static void HandleBroadcast(TNLConnection conn, Packet packet)
        {
            var type = (ChatType) packet.ReadUInteger();
            var sendercoid = packet.ReadLong();
            var isGm = packet.ReadBoolean();

            packet.ReadPadding(1);

            var msglen = packet.ReadUShort();
            var sender = packet.ReadUtf8StringOn(17);

            var msg = packet.ReadUtf8StringOn(msglen);
            if (msg.StartsWith("/"))
            {
                if (msg.Equals("/save"))
                    conn.CurrentCharacter.SaveToDB();

                return;
            }

            conn.CurrentCharacter.GetMap().BroadcastChat(type, ConstructBroadcastPacket(type, isGm, sender, sendercoid, msg), conn.CurrentCharacter);
        }
 public static CreateCharacterModel Read(Packet packet)
 {
     return new CreateCharacterModel
     {
         CBid = packet.ReadInteger(),
         AccountName = packet.ReadUtf8StringOn(33),
         CharacterName = packet.ReadUtf8StringOn(51),
         Head = packet.ReadInteger(),
         Body = packet.ReadInteger(),
         HeadDetail = packet.ReadInteger(),
         HeadDetail2 = packet.ReadInteger(),
         Helmet = packet.ReadInteger(),
         Eyes = packet.ReadInteger(),
         Mouth = packet.ReadInteger(),
         Hair = packet.ReadInteger(),
         PrimaryColor = packet.ReadUInteger(),
         SecondaryColor = packet.ReadUInteger(),
         EyeColor = packet.ReadUInteger(),
         HairColor = packet.ReadUInteger(),
         SkinColor = packet.ReadUInteger(),
         SpecialColor = packet.ReadUInteger(),
         ShardId = packet.ReadUInteger(),
         VehiclePrimaryColor = packet.ReadUInteger(),
         VehicleSecondaryColor = packet.ReadUInteger(),
         VehicleTrim = packet.ReadByte(),
         ScaleOffset = packet.ReadPadding(3).ReadSingle(),
         CBidWheelset = packet.ReadInteger(),
         VehicleName = packet.ReadUtf8StringOn(33),
     };
 }