コード例 #1
0
        private int sendOsu(SerializationWriter sw)
        {
            bSerializable bPayload = payload as bSerializable;

            if (type == RequestType.Irc_Only)
            {
                return(0);
            }

            long sentBytes = 0;

            //set the position to after the header..
            MemoryStream payloadBuffer = (MemoryStream)sw.BaseStream;

            sw.Seek(HEADER_LEN, SeekOrigin.Begin);


            int payloadSize = 0;

            if (bPayload != null)
            {
                bPayload.WriteToStream(sw);
                payloadSize = (int)payloadBuffer.Position - HEADER_LEN;
            }

            sw.Seek(0, SeekOrigin.Begin);

            sw.Write((ushort)type);
            sw.Write((byte)0);
            sw.Write((uint)payloadSize);

            return(HEADER_LEN + payloadSize);
        }
コード例 #2
0
ファイル: Command.cs プロジェクト: sub2900/osu-server-fail
 public Command(short id, object serializable)
 {
     this.Id        = id;
     this.noHasData = serializable == null;
     if (this.noHasData)
     {
         this.Serializable = null;
         this.RegularType  = null;
         return;
     }
     this.Serializable = serializable as bSerializable;
     //If it isn't an bSerializable, then it should be a regulartype
     this.RegularType = this.Serializable == null ? serializable : null;
 }
コード例 #3
0
 public RequestGeneric(RequestType type, bSerializable payload)
 {
     this.type    = type;
     this.payload = payload;
 }
コード例 #4
0
ファイル: BanchoClient.cs プロジェクト: Crystallinqq/osu-2005
 internal static void SendRequest(RequestType resType, bSerializable obj)
 {
     SendRequest(new RequestGeneric(resType, obj));
 }