Ejemplo n.º 1
0
 private BulletinResponse Code(BulletinResponseType code)
 {
     return(new BulletinResponse()
     {
         Type = code
     });
 }
 private void ResolveCallbacks(BulletinResponseType code)
 {
     GameThread.InUpdate(() =>
     {
         foreach (var cb in Callbacks)
         {
             cb.Invoke(code);
         }
         Callbacks.Clear();
         Blocked = false;
     });
 }
Ejemplo n.º 3
0
        public override void Deserialize(IoBuffer input, ISerializationContext context)
        {
            Type = input.GetEnum <BulletinResponseType>();
            var numMessages = input.GetInt32();

            Messages = new BulletinItem[numMessages];
            for (int j = 0; j < numMessages; j++)
            {
                var length = input.GetInt32();
                var dat    = new byte[length];
                for (int i = 0; i < length; i++)
                {
                    dat[i] = input.Get();
                }

                using (var str = new MemoryStream(dat))
                {
                    Messages[j] = new BulletinItem(str);
                }
            }
            Message    = input.GetPascalVLCString();
            BanEndDate = input.GetUInt32();
        }