コード例 #1
0
 /**
  * Represents a group of games.
  *
  * Normally a group only has 1 game but
  * for situations where we need more than
  * 1 game ...
  *
  */
 public HFTGameGroup(string gameId, HFTGameManager relayServer)
 {
     log_ = new HFTLog("HFTGameGroup[" + gameId + "]");
     gameId_ = gameId;
     //this.runtimeInfo = gameDB.getGameById(gameId);
     relayServer_ = relayServer;
 }
コード例 #2
0
        public HFTPlayerManager(GameServer server, GameObject gameObject, int maxPlayers, int timeoutForDisconnectedPlayerToReconnect, GetGameObject getGameObjectFn)
        {
            m_log = new HFTLog("PlayerManager");
            m_maxPlayers = maxPlayers;
            m_gameObject = gameObject;
            m_getGameObject = getGameObjectFn;
            m_timeoutForDisconnectedPlayersToReconnect = timeoutForDisconnectedPlayerToReconnect;

            server.OnPlayerConnect += StartNewPlayer;

            ResetState();
        }
コード例 #3
0
ファイル: HFTSite.cs プロジェクト: greggman/hft-unity-gamepad
        public void Init(Options options)
        {
            log_ = new HFTLog("HFTSite");
            options_ = options;
            rendezvousUri_ = new System.Uri(options_.rendezvousUrl);

            string[] ipv4Addresses = GetIPAddresses(DNS.Protocol.RecordType.A);
            string[] ipv6Addresses = GetIPAddresses(DNS.Protocol.RecordType.AAAA);
            informers_[0] = new Informer(log_, sharedState_, ipv4Addresses.Length > 0 ? MakeDirectUrl(ipv4Addresses[0]) : null, rendezvousUri_.Host);
            informers_[1] = new Informer(log_, sharedState_, ipv6Addresses.Length > 0 ? MakeDirectUrl(ipv6Addresses[0]) : null, rendezvousUri_.Host);

            checkCoroutine_ = CheckAddresses();
            StartCoroutine(checkCoroutine_);
        }
コード例 #4
0
        public HFTWebServer(HFTRuntimeOptions options, string[] addresses)
        {
            m_log = new HFTLog("HFTWebServer");
            m_options = options;
            m_gamePath = "/";
            m_webServerUtils = new HFTWebServerUtils(m_gamePath);

            // Touch the HFTWebFileDB
            // We do this be because we want it to get the list
            // of files BEFORE run the server. The server will
            // run in a different thread and HFTWebFileDB will
            // not be able to populate its database from that thread.
            HFTWebFileDB.GetInstance();

            // FIX: sysname and gamename
            string sysName = Environment.MachineName;
            if (sysName.EndsWith(".local"))
            {
                sysName = sysName.Substring(0, sysName.Length - 6);
            }
            string gameName = m_options.name;
            string ping = Serializer.Serialize(new HFTPing(sysName + ": " + gameName, "HappyFunTimes"));
            m_ping = System.Text.Encoding.UTF8.GetBytes(ping);
            m_log.Info("Ping: " + ping);

            m_liveSettingsStr = "define([], function() { return " + Serializer.Serialize(new LiveSettings()) + "; })\n";
            m_liveSettings = System.Text.Encoding.UTF8.GetBytes(m_liveSettingsStr);

            if (options.captivePortal || options.installationMode)
            {
                m_captivePortalHandler = new HFTCaptivePortalHandler(m_webServerUtils);
                m_getRouter.Add(m_captivePortalHandler.HandleRequest);
            }

            m_getRouter.Add(HandleRoot);
            m_getRouter.Add(HandleLiveSettings);
            m_getRouter.Add(HandleFile);
            m_getRouter.Add(HandleMissingRoute);
            m_getRouter.Add(HandleNotFound);

            m_addresses = addresses;
        }
コード例 #5
0
 public PlayerConnector()
 {
     m_log = new HFTLog("PlayerConnector");
 }
コード例 #6
0
 HFTGameManager()
 {
     log_ = new HFTLog("HFTGameManager");
 }
コード例 #7
0
 public HFTEventProcessor()
 {
     m_log = new HFTLog("HFTEventProcessor");
 }
コード例 #8
0
ファイル: HFTSite.cs プロジェクト: greggman/hft-unity-gamepad
 public Informer(HFTLog log, SharedState sharedState, string url, string domain)
 {
     sharedState_ = sharedState;
     log_ = log;
     url_ = url;
     domain_ = domain;
 }
コード例 #9
0
 public HFTSocket()
 {
     base.IgnoreExtensions = true;
     log_ = new HFTLog("HFTSocket");
 }