当前位置: 首页>>代码示例>>C#>>正文


C# StreamHandler类代码示例

本文整理汇总了C#中StreamHandler的典型用法代码示例。如果您正苦于以下问题:C# StreamHandler类的具体用法?C# StreamHandler怎么用?C# StreamHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StreamHandler类属于命名空间,在下文中一共展示了StreamHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ElementRead

 protected override void ElementRead(StreamHandler reader, int index)
 {
     if (index == -1)
         this.ChangeCounter = reader.ReadUInt32();
     else
         throw new InvalidOperationException("Unknown read element: " + index);
 }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:7,代码来源:ForcePacket.cs

示例2: ElementRead

 protected override void ElementRead(StreamHandler reader, int index)
 {
     if (index == -2)
         this.NewValue = reader.ReadUInt32();
     else
         base.ElementRead(reader, index);
 }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:7,代码来源:ForceSetVehicleId.cs

示例3: GetNetworkLog

        public static NetworkLog GetNetworkLog(string filename)
        {
            if (!s_initialized)
                Initialize();

            var ext = Path.GetExtension(filename);

            var extFittingDumps = new List<NetworkLogWrapper>();
            foreach (var info in s_logs)
            {
                if (info.FileExtension == ext)
                    extFittingDumps.Add(info);
            }

            if (extFittingDumps.Count == 0)
                extFittingDumps = s_logs;
            else if (extFittingDumps.Count == 1)
                return extFittingDumps[0].Activate(NetworkLogMode.Reading);

            byte[] header;
            using (var sh = new StreamHandler(filename, FileMode.Open))
                header = sh.ReadBytes(Math.Min((int)sh.Length, s_maxHeaderLength));

            foreach (var wrapper in extFittingDumps)
            {
                if (wrapper.Fits(header))
                    return wrapper.Activate(NetworkLogMode.Reading);
            }

            return null;
        }
开发者ID:CarlosX,项目名称:Kamilla,代码行数:31,代码来源:NetworkLogFactory.cs

示例4: ElementRead

 protected override void ElementRead(StreamHandler reader, int index)
 {
     if (index == -5)
         this.Unk = reader.ReadUInt32();
     else
         this.Data[-index - 1] = reader.ReadBytes(reader.ReadInt32());
 }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:7,代码来源:SetPhaseShift.cs

示例5: Write

        public void Write(StreamHandler Writer)
        {
            Writer.WriteUInt32((uint)Flags);

            if ((Flags & (
                SpellCastTargetFlags.Unit | SpellCastTargetFlags.Unk2 |
                SpellCastTargetFlags.Object |
                SpellCastTargetFlags.Corpse | SpellCastTargetFlags.PvPCorpse
                )) != 0)
                Writer.WritePackedGuid(TargetUnit);

            if ((Flags & (SpellCastTargetFlags.Item | SpellCastTargetFlags.TradeItem)) != 0)
                Writer.WritePackedGuid(TargetItem);

            if ((Flags & SpellCastTargetFlags.SourceLocation) != 0)
            {
                Writer.WritePackedGuid(SourceTransportGuid);
                Writer.WriteStruct<Vector3>(SourceLocation);
            }

            if ((Flags & SpellCastTargetFlags.DestLocation) != 0)
            {
                Writer.WritePackedGuid(DestTransportGuid);
                Writer.WriteStruct<Vector3>(DestLocation);
            }

            if ((Flags & SpellCastTargetFlags.String) != 0)
                Writer.WriteCString(StringTarget);
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:29,代码来源:SpellCasting.cs

示例6: RemoteConnection

        internal RemoteConnection(Stream pipeIn, Stream pipeOut, bool isClient)
        {
            this.pipeIn = pipeIn;
            this.pipeOut = pipeOut;
            this.isClient = isClient;

            localProcessId = Process.GetCurrentProcess().Id;
            callStack = new RemoteCallStack();

            streamHandler = new StreamHandler(pipeIn, pipeOut);

            if(!isClient) {
                CfxRuntime.OnCfxShutdown += new Action(CfxRuntime_OnCfxShutdown);
            }

            writer = new Thread(WriteLoopEntry);
            reader = new Thread(ReadLoopEntry);

            writer.Name = "cfx_rpc_writer";
            reader.Name = "cfx_rpc_reader";

            writer.IsBackground = true;
            reader.IsBackground = true;

            writer.Start();
            reader.Start();
        }
开发者ID:xmcy0011,项目名称:NanUI,代码行数:27,代码来源:RemoteConnection.cs

示例7: Read

 public override void Read(StreamHandler Reader)
 {
     this.Count = Reader.ReadByte();
     this.Seed = Reader.ReadUInt32();
     this.ClientSeed = Reader.ReadBytes(16);
     this.ServerSeed = Reader.ReadBytes(16);
 }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:7,代码来源:Authentication.cs

示例8: ElementRead

 protected override void ElementRead(StreamHandler reader, int index)
 {
     if (index == -3)
         this.UnkByte = reader.UnalignedReadTinyInt(2);
     else
         base.ElementRead(reader, index);
 }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:7,代码来源:ForceSetCollisionHeight.cs

示例9: ElementWrite

 protected override void ElementWrite(StreamHandler writer, int index)
 {
     if (index == -3)
         writer.UnalignedWriteInt(this.UnkByte, 2);
     else
         base.ElementWrite(writer, index);
 }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:7,代码来源:ForceSetCollisionHeight.cs

示例10: Save

        public override void Save(StreamHandler writer)
        {
            writer.WritePackedGuid(this.Unit);

            foreach (var update in this.Auras)
                update.Save(writer);
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:7,代码来源:AuraUpdates.cs

示例11: ReadElement

 protected override void ReadElement(StreamHandler reader, MovementStatusElements element, MovementStatus status, byte[] guid, byte[] tguid)
 {
     if (element == MovementStatusElements.GenericDword0)
         this.ChangeCounter = reader.ReadUInt32();
     else
         base.ReadElement(reader, element, status, guid, tguid);
 }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:7,代码来源:ForceAckPacket.cs

示例12: Read

 public override void Read(StreamHandler reader)
 {
     Entity = reader.ReadGuid();
     Model = reader.ReadUInt32();
     Race = (Races)reader.ReadByte();
     Gender = (Genders)reader.ReadByte();
     Class = (Classes)reader.ReadByte();
     Skin = reader.ReadByte();
     Face = reader.ReadByte();
     Hair = reader.ReadByte();
     HairColor = reader.ReadByte();
     FaceFeatures = reader.ReadByte();
     Guild = reader.ReadGuid();
     Head = reader.ReadUInt32();
     Shoulders = reader.ReadUInt32();
     Body = reader.ReadUInt32();
     Chest = reader.ReadUInt32();
     Waist = reader.ReadUInt32();
     Legs = reader.ReadUInt32();
     Feet = reader.ReadUInt32();
     Wrists = reader.ReadUInt32();
     Hands = reader.ReadUInt32();
     Back = reader.ReadUInt32();
     Tabard = reader.ReadUInt32();
 }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:25,代码来源:MirrorImageData.cs

示例13: Read

        public void Read(StreamHandler Reader)
        {
            Flags = (SpellCastTargetFlags)Reader.ReadUInt32();

            if ((Flags & (
                SpellCastTargetFlags.Unit   | SpellCastTargetFlags.Unk2 |
                SpellCastTargetFlags.Object |
                SpellCastTargetFlags.Corpse | SpellCastTargetFlags.PvPCorpse
                )) != 0)
                TargetUnit = Reader.ReadPackedGuid();

            if ((Flags & (SpellCastTargetFlags.Item | SpellCastTargetFlags.TradeItem)) != 0)
                TargetItem = Reader.ReadPackedGuid();

            if ((Flags & SpellCastTargetFlags.SourceLocation) != 0)
            {
                SourceTransportGuid = Reader.ReadPackedGuid();
                SourceLocation = Reader.ReadVector3();
            }

            if ((Flags & SpellCastTargetFlags.DestLocation) != 0)
            {
                DestTransportGuid = Reader.ReadPackedGuid();
                DestLocation = Reader.ReadVector3();
            }

            if ((Flags & SpellCastTargetFlags.String) != 0)
                StringTarget = Reader.ReadCString();
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:29,代码来源:SpellCasting.cs

示例14: ObjectBus

 public ObjectBus(StreamHandler streamHandler)
 {
     if (streamHandler == null)
         throw new ArgumentNullException ("streamHandler");
     this.streamHandler = streamHandler;
     streamHandler.RegisterCallback (streamHandlerCallback);
 }
开发者ID:vebin,项目名称:BD2,代码行数:7,代码来源:ObjectBus.cs

示例15: ReadElement

 protected override void ReadElement(StreamHandler reader, MovementStatusElements element, MovementStatus status, byte[] guid, byte[] tguid)
 {
     if (element == MovementStatusElements.GenericDword2)
         this.NewValue = reader.ReadSingle();
     else
         base.ReadElement(reader, element, status, guid, tguid);
 }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:7,代码来源:ForceChangeAckPacket.cs


注:本文中的StreamHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。