當前位置: 首頁>>代碼示例>>C#>>正文


C# Plasma.hsStream類代碼示例

本文整理匯總了C#中Plasma.hsStream的典型用法代碼示例。如果您正苦於以下問題:C# hsStream類的具體用法?C# hsStream怎麽用?C# hsStream使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


hsStream類屬於Plasma命名空間,在下文中一共展示了hsStream類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: WriteRGBA

 public static void WriteRGBA(hsStream s, Color c)
 {
     s.WriteFloat(Convert.ToSingle(c.R) / 255.0f);
     s.WriteFloat(Convert.ToSingle(c.G) / 255.0f);
     s.WriteFloat(Convert.ToSingle(c.B) / 255.0f);
     s.WriteFloat(Convert.ToSingle(c.A) / 255.0f);
 }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:Color.cs

示例2: Read

        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fSecsRunning = s.ReadDouble();
            fSession = (SessionTypes)s.ReadByte();
        }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:NetMsgPing.cs

示例3: WriteRGBA8

 public static void WriteRGBA8(hsStream s, Color c)
 {
     s.WriteByte(c.R);
     s.WriteByte(c.G);
     s.WriteByte(c.B);
     s.WriteByte(c.A);
 }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:Color.cs

示例4: Write

        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteDouble(fSecsRunning);
            s.WriteByte((byte)fSession);
        }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:NetMsgPing.cs

示例5: IReadNetCliConnect

        /// <summary>
        /// Reads in a NetCliConnect message from the stream
        /// </summary>
        /// <param name="s">Stream to read the message from</param>
        /// <returns>Connection YData (an array of 64 bytes) or NULL if the message is malformed</returns>
        protected byte[] IReadNetCliConnect(hsStream s)
        {
            byte[] y_data = null;
            try {
                if (s.ReadByte() != plNetCore.kNetCliConnect) return null;
                int size = (int)s.ReadByte() - 2;
                y_data = s.ReadBytes(size);
            } catch (Exception e) {
            #if DEBUG
                throw e;
            #else
                return null;
            #endif
            }

            // Truncate the YData if it's too large
            if (y_data.Length > 64) {
                byte[] old = y_data;
                y_data = new byte[64];
                Buffer.BlockCopy(old, 0, y_data, 0, 64);
            }

            // The client sends us the YData in Little Endian, but
            // BigNum wants Big Endian (because OpenSSL). Let's fix that.
            Array.Reverse(y_data);

            return y_data;
        }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:33,代碼來源:NetServer.cs

示例6: Write

        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteInt((int)fCommand);
            s.WriteStdString(fString);
        }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:ConsoleMsg.cs

示例7: Read

 public void Read(hsStream s)
 {
     fX = s.ReadFloat();
     fY = s.ReadFloat();
     fZ = s.ReadFloat();
     fW = s.ReadFloat();
 }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:Quaternion.cs

示例8: Read

        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fCommand = (Cmd)s.ReadInt();
            fString = s.ReadStdString();
        }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:ConsoleMsg.cs

示例9: Read

        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fSynchFlags = (Flags)s.ReadInt();
            if (s.Version.IsPlasma21)
                fSynchFlags &= (Flags)~0x8;

            if (s.Version.IsPlasma21 && (((int)fSynchFlags & 0x06) != 0) ||
               (s.Version.IsPlasma20 && ExcludeStates)) {
                short count = s.ReadShort();
                for (short i = 0; i < count; i++)
                    fExcludeStates.Add((States)Enum.Parse(typeof(States), s.ReadStdString()));
            }

            //Plasma 2.1+ ends here...
            if (s.Version.IsPlasma21) {
                fSynchFlags = 0; // Synch Flags are pretty useless in Plasma21
                return;
            } else if (s.Version.IsPlasma20) {
                if (VolatileStates) {
                    short count = s.ReadShort();
                    for (short i = 0; i < count; i++)
                        fVolatileStates.Add((States)Enum.Parse(typeof(States), s.ReadStdString()));
                }
            }
        }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:27,代碼來源:SynchedObject.cs

示例10: ReadKey

        /// <summary>
        /// Reads a key reference from the stream
        /// </summary>
        /// <param name="s">Stream containing a key reference</param>
        /// <returns>The key referenced in the stream or null (if null reference)</returns>
        public plKey ReadKey(hsStream s)
        {
            if (!s.Version.IsPlasma21)
                if (!s.ReadBool()) return null;

            return ReadUoid(s);
        }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:12,代碼來源:ResManager.cs

示例11: Write

 public void Write(hsStream s)
 {
     s.WriteFloat(fX);
     s.WriteFloat(fY);
     s.WriteFloat(fZ);
     s.WriteFloat(fW);
 }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:Quaternion.cs

示例12: ReadCreatable

 /// <summary>
 /// Reads an arbitrary Creatable from the current position in the stream
 /// </summary>
 /// <param name="s">Stream to read from</param>
 /// <returns></returns>
 public plCreatable ReadCreatable(hsStream s)
 {
     plCreatable pCre = plFactory.Create(plManagedType.Read(s));
     if (pCre != null)
         pCre.Read(s, this);
     return pCre;
 }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:12,代碼來源:ResManager.cs

示例13: Write

 public override void Write(hsStream s, hsResMgr mgr)
 {
     if (s.Version.IsMystOnline)
         mgr.WriteKey(s, fpKey);
     else
         mgr.WriteUoid(s, fpKey);
 }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:7,代碼來源:KeyedObject.cs

示例14: Write

 public override void Write(hsStream s)
 {
     s.WriteUInt(fTransID);
     pnHelpers.WriteString(s, fAccount, 64);
     s.WriteBytes(fHash);
     s.WriteUInt(fSrvChg);
     s.WriteUInt(fCliChg);
 }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:8,代碼來源:Cli2Vault.cs

示例15: Write

        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteBool(fDeliveryTime.HasValue);
            if (fDeliveryTime.HasValue)
                plUnifiedTime.Write(s, fDeliveryTime.Value);
        }
開發者ID:branan,項目名稱:PlasmaDotNet,代碼行數:8,代碼來源:NetMsgGameMessage.cs


注:本文中的Plasma.hsStream類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。