當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。