GetInstance() 공개 정적인 메소드

public static GetInstance ( ) : HFTGameManager
리턴 HFTGameManager
예제 #1
0
        void HandleCmdPing(HttpListenerRequest req, HttpListenerResponse res)
        {
            // Yes reaching up this far is shit :(
            if (!HFTGameManager.GetInstance().HaveGame())
            {
                res.StatusCode = (int)HttpStatusCode.NotFound;
            }

            m_webServerUtils.SendJsonBytes(res, m_ping);
        }
예제 #2
0
 protected override void OnOpen()
 {
     log_.Info("open");
     try
     {
         HFTGameManager.GetInstance().AddPlayer(this);
     }
     catch (System.Exception ex)
     {
         log_.Error(ex.StackTrace);
     }
 }
예제 #3
0
 void HandleCmdPing(HttpListenerRequest req, HttpListenerResponse res)
 {
     // Yes reaching up this far is shit :(
     if (!HFTGameManager.GetInstance().HaveGame())
     {
         res.ContentType = "application/json";
         res.StatusCode  = (int)HttpStatusCode.BadRequest;
         res.WriteContent(System.Text.Encoding.UTF8.GetBytes("{\"error\":\"game not ready:\"}"));
     }
     else
     {
         m_webServerUtils.SendJsonBytes(res, m_ping);
     }
 }
예제 #4
0
 public void StopListening()
 {
     // It's not clear to me where this belongs. Ideally I'd like to pass in the HFTGameManager
     // but how to pass it to new connections I have no idea.
     HFTGameManager.GetInstance().Close();
 }