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


C# MemoryStream.ReadPackable方法代码示例

本文整理汇总了C#中System.IO.MemoryStream.ReadPackable方法的典型用法代码示例。如果您正苦于以下问题:C# MemoryStream.ReadPackable方法的具体用法?C# MemoryStream.ReadPackable怎么用?C# MemoryStream.ReadPackable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.MemoryStream的用法示例。


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

示例1: Read

 public bool Read(MemoryStream pStream)
 {
     EMessageKeyType type = EMessageKeyType.Variable;
     uint tag = 0;
     while (pStream.ReadKey(out type, out tag))
     {
         switch (tag)
         {
             case ImportedServiceHashTag:
                 {
                     MemoryStream stream = null;
                     if (!pStream.ReadPrefixed(out stream)) return false;
                     uint hash = 0;
                     while (stream.ReadFixed32(out hash)) mImportedServiceHashes.Add(hash);
                     break;
                 }
             case ExportedServiceTag:
                 {
                     BoundService boundService = new BoundService();
                     if (!pStream.ReadPackable(boundService)) return false;
                     mExportedServices.Add(boundService);
                     break;
                 }
             default: return false;
         }
     }
     return true;
 }
开发者ID:Astaelan,项目名称:Tristram,代码行数:28,代码来源:BindRequest.cs

示例2: Read

 public bool Read(MemoryStream pStream)
 {
     EMessageKeyType type = EMessageKeyType.Variable;
     uint tag = 0;
     while (pStream.ReadKey(out type, out tag))
     {
         switch (tag)
         {
             case ErrorCodeTag:
                 if (!pStream.ReadVariable(out mErrorCode)) return false;
                 break;
             case AccountTag:
                 mHasAccount = true;
                 if (!pStream.ReadPackable(mAccount)) return false;
                 break;
             case GameAccountTag:
                 {
                     EntityId entityId = new EntityId();
                     if (!pStream.ReadPackable(entityId)) return false;
                     mGameAccounts.Add(entityId);
                     break;
                 }
             default: return false;
         }
     }
     return true;
 }
开发者ID:Astaelan,项目名称:Tristram,代码行数:27,代码来源:LogonResult.cs

示例3: Read

        public bool Read(MemoryStream pStream)
        {
            EMessageKeyType type = EMessageKeyType.Variable;
            uint tag = 0;
            while (pStream.ReadKey(out type, out tag))
            {
                switch (tag)
                {
                    case ObjectAddressTag:
                        if (!pStream.ReadPackable(mObjectAddress)) return false;
                        break;
                    case StatusTag:
                        if (!pStream.ReadVariable(out mStatus)) return false;
                        break;
                    case ServiceHashTag:
                        if (!pStream.ReadVariable(out mServiceHash)) return false;
                        break;
                    case MethodIdTag:
                        if (!pStream.ReadVariable(out mMethodId)) return false;
                        break;
                    default: return false;
                }
            }

            return true;
        }
开发者ID:Astaelan,项目名称:Tristram,代码行数:26,代码来源:ErrorInfo.cs

示例4: Read

 public bool Read(MemoryStream pStream)
 {
     EMessageKeyType type = EMessageKeyType.Variable;
     uint tag = 0;
     while (pStream.ReadKey(out type, out tag))
     {
         switch (tag)
         {
             case ClientIdTag:
                 mHasClientId = true;
                 if (!pStream.ReadPackable(mClientId)) return false;
                 break;
             case BindRequestTag:
                 mHasBindRequest = true;
                 if (!pStream.ReadPackable(mBindRequest)) return false;
                 break;
             default: return false;
         }
     }
     return true;
 }
开发者ID:Astaelan,项目名称:Tristram,代码行数:21,代码来源:ConnectRequest.cs

示例5: Read

 public bool Read(MemoryStream pStream)
 {
     EMessageKeyType type = EMessageKeyType.Variable;
     uint tag = 0;
     while (pStream.ReadKey(out type, out tag))
     {
         switch (tag)
         {
             case ContentHandleTag:
                 {
                     ContentHandle contentHandle = new ContentHandle();
                     if (!pStream.ReadPackable(contentHandle)) return false;
                     mContentHandles.Add(contentHandle);
                     break;
                 }
             default: return false;
         }
     }
     return true;
 }
开发者ID:Astaelan,项目名称:Tristram,代码行数:20,代码来源:ConnectionMeteringContentHandles.cs

示例6: Read

 public bool Read(MemoryStream pStream)
 {
     EMessageKeyType type = EMessageKeyType.Variable;
     uint tag = 0;
     while (pStream.ReadKey(out type, out tag))
     {
         switch (tag)
         {
             case HostTag:
                 if (!pStream.ReadPackable(mHost)) return false;
                 break;
             case ObjectIdTag:
                 mHasObjectId = true;
                 if (!pStream.ReadVariable(out mObjectId)) return false;
                 break;
             default: return false;
         }
     }
     return true;
 }
开发者ID:Astaelan,项目名称:Tristram,代码行数:20,代码来源:ObjectAddress.cs

示例7: Read

 public bool Read(MemoryStream pStream)
 {
     EMessageKeyType type = EMessageKeyType.Variable;
     uint tag = 0;
     while (pStream.ReadKey(out type, out tag))
     {
         switch (tag)
         {
             case ServiceIdTag:
                 if (!pStream.ReadVariable(out mServiceId)) return false;
                 break;
             case MethodIdTag:
                 mHasMethodId = true;
                 if (!pStream.ReadVariable(out mMethodId)) return false;
                 break;
             case TokenTag:
                 if (!pStream.ReadVariable(out mToken)) return false;
                 break;
             case ObjectIdTag:
                 mHasObjectId = true;
                 if (!pStream.ReadVariable(out mObjectId)) return false;
                 break;
             case SizeTag:
                 mHasSize = true;
                 if (!pStream.ReadVariable(out mSize)) return false;
                 break;
             case StatusTag:
                 mHasStatus = true;
                 if (!pStream.ReadVariable(out mStatus)) return false;
                 break;
             case ErrorTag:
                 {
                     ErrorInfo errorInfo = new ErrorInfo();
                     if (!pStream.ReadPackable(errorInfo)) return false;
                     mErrors.Add(errorInfo);
                     break;
                 }
             default: return false;
         }
     }
     return true;
 }
开发者ID:Astaelan,项目名称:Tristram,代码行数:42,代码来源:Header.cs

示例8: Read

 public bool Read(MemoryStream pStream)
 {
     EMessageKeyType type = EMessageKeyType.Variable;
     uint tag = 0;
     while (pStream.ReadKey(out type, out tag))
     {
         switch (tag)
         {
             case ServerIdTag:
                 if (!pStream.ReadPackable(mServerId)) return false;
                 break;
             case ClientIdTag:
                 mHasClientId = true;
                 if (!pStream.ReadPackable(mClientId)) return false;
                 break;
             case BindResultTag:
                 mHasBindResult = true;
                 if (!pStream.ReadVariable(out mBindResult)) return false;
                 break;
             case BindResponseTag:
                 mHasBindResponse = true;
                 if (!pStream.ReadPackable(mBindResponse)) return false;
                 break;
             case ConnectionMeteringContentHandlesTag:
                 mHasConnectionMeteringContentHandles = true;
                 if (!pStream.ReadPackable(mConnectionMeteringContentHandles)) return false;
                 break;
             default: return false;
         }
     }
     return true;
 }
开发者ID:Astaelan,项目名称:Tristram,代码行数:32,代码来源:ConnectResponse.cs


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