Esempio n. 1
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteInt64(SourceInventoryId);
     messageStream.WriteByte(SourceSlot);
     messageStream.WriteInt64(TargetInventoryId);
     messageStream.WriteByte(TargetSlot);
 }
Esempio n. 2
0
 private void WriteBulletEffects(IOutgoingMessageStream messageStream)
 {
     foreach (var item in BulletEffects)
     {
         messageStream.Write(item.EndPoint);
         messageStream.WriteFloat(item.Rotation);
         messageStream.WriteByte(item.Effect);
     }
 }
        protected override void SerializeImpl(IOutgoingMessageStream messageStream)
        {
            messageStream.WriteBool(PartialUpdate);

            if (!PartialUpdate)
            {
                messageStream.WriteByte(InventorySize);
            }

            messageStream.WriteInt64(InventoryId);
            messageStream.WriteInt16((short)InventoryType);
            Write(messageStream, InventoryContent);
        }
Esempio n. 4
0
        protected override void SerializeImpl(IOutgoingMessageStream messageStream)
        {
            base.SerializeImpl(messageStream);

            if (_maxBulletCount == 1 && _minBulletCount == 1)
            {
                Debug.Assert(BulletEffects.Count == 1);
            }
            else
            {
                messageStream.WriteByte((byte)BulletEffects.Count);
            }
            WriteBulletEffects(messageStream);
        }
        static void Write(IOutgoingMessageStream stream, IEnumerable <KeyValuePair <byte, InventoryItem> > data)
        {
            var toSend = data.ToList();

            var count = (short)toSend.Count;

            stream.WriteInt16(count);

            Logger.Write(string.Format("Writing {0} inventory items", count));

            var i = 0;

            foreach (var item in toSend)
            {
                Logger.Write(string.Format("Writing inventory item {0}", i));
                stream.WriteByte(item.Key);
                WriteInventoryItem(stream, item.Value);
                i++;
            }
        }
Esempio n. 6
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteInt64(InventoryId);
     messageStream.WriteByte(InventorySlotId);
 }
Esempio n. 7
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteUInt16(ClientId);
     messageStream.WriteByte(GameTimeHour);
     messageStream.WriteByte(GameTimeMinute);
 }