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


C# ClientMessage.ToString方法代码示例

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


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

示例1: HandlePacket

 public static void HandlePacket(GameClientMessageHandler handler, ClientMessage message)
 {
     if (handlers.ContainsKey(message.Id))
     {
         Logging.WriteLine("Handled Header: " + message.ToString(), ConsoleColor.Green);
         StaticRequestHandler currentHandler = (StaticRequestHandler)handlers[message.Id];
         currentHandler.Invoke(handler);
     }
     else
     {
         if (System.Diagnostics.Debugger.IsAttached)
         {
             Logging.WriteLine("Unhandled Header: " + message.ToString(), ConsoleColor.Red);
         }
     }
 }
开发者ID:BjkGkh,项目名称:07052014,代码行数:16,代码来源:StaticClientMessageHandler.cs

示例2: HandlePacket

 public static void HandlePacket(GameClientMessageHandler handler, ClientMessage message)
 {
     if (handlers.ContainsKey(message.Id))
     {
         Logging.WriteLine("Cargado -> " + message.ToString(), ConsoleColor.White);
         StaticRequestHandler currentHandler = (StaticRequestHandler)handlers[message.Id];
         currentHandler.Invoke(handler);
     }
     else
     {
         if (System.Diagnostics.Debugger.IsAttached)
         {
             Logging.WriteLine("Error -> " + message.ToString(), ConsoleColor.Magenta);
         }
     }
 }
开发者ID:BjkGkh,项目名称:Plus-Jamal,代码行数:16,代码来源:StaticClientMessageHandler.cs

示例3: AddIfNeeded

        public void AddIfNeeded(uint GroupId, ClientMessage Request, ServerMessage Response)
        {
            lock (mCachedResponses)
            {
                foreach (ResponseCacheItem Item in mCachedResponses)
                {
                    if (Item.GroupId == GroupId && Item.Request.ToString() == Request.ToString())
                    {
                        return;
                    }
                }

                ResponseCacheItem NewItem = new ResponseCacheItem(GroupId, Request, Response);
                mCachedResponses.Add(NewItem);
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:16,代码来源:ResponseCacheController.cs

示例4: AddIfNeeded

        public void AddIfNeeded(uint GroupId, ClientMessage Request, ServerMessage Response)
        {
            lock (mCachedResponses)
            {
                if (mCachedResponses.Count > mCacheMaxCapacity)
                {
                    // capacity has been reached, to protect overflow remove the oldest element in the cache immediatly..
                    mCachedResponses.RemoveAt(mCachedResponses.Count - 1);
                }

                foreach (ResponseCacheItem Item in mCachedResponses)
                {
                    if (Item.GroupId == GroupId && Item.Request.ToString() == Request.ToString())
                    {
                        return;
                    }
                }

                ResponseCacheItem NewItem = new ResponseCacheItem(GroupId, Request, Response);
                mCachedResponses.Add(NewItem);
            }
        }
开发者ID:rayooh,项目名称:Snowlight,代码行数:22,代码来源:ResponseCacheController.cs

示例5: TryGetResponse

        public ServerMessage TryGetResponse(uint GroupId, ClientMessage Request)
        {
            lock (mCachedResponses)
            {
                foreach (ResponseCacheItem Item in mCachedResponses)
                {
                    if (Item.GroupId == GroupId && Item.Request.ToString() == Request.ToString())
                    {
                        return Item.Response;
                    }
                }
            }

            return null;
        }
开发者ID:rayooh,项目名称:Snowlight,代码行数:15,代码来源:ResponseCacheController.cs


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