Пример #1
0
    private IEnumerator DoJoin()
    {
        yield return(client.MakeSession(Username.Value, "", true));

        client.Connect();

        client.SendSession();

        yield return(client.WaitForOk());

        if (!client.IsOk)
        {
            Debug.LogError("Did not get OK from server..");
            yield break;
        }

        client.ConnectUDP();

        yield return(client.WaitForOk());

        if (!client.IsOk)
        {
            Debug.LogError("Did not get OK from server..");
            yield break;
        }

        Debug.Log("Connected!");

        if (OnJoin != null)
        {
            OnJoin.Invoke();
        }
    }
Пример #2
0
        public static void Main(string[] args)
        {
            AgentCommandLineOptions options = CommandLineParser.ParseArgs <AgentCommandLineOptions>(args, new AgentCommandLineOptions());

            PlayerSettings settings = Configuration.FromFile <PlayerSettings>(options.Conf);

            PlayerClient client           = new PlayerClient(new Connection(options.Address, options.Port), settings, options, new Game());
            IController  playerController = new Controller().Possess(client);

            client.Connect();
            client.Disconnect();
        }