Ejemplo n.º 1
0
        public TestClient(string name, int port)
        {
            this.roomlist = new NetClientRoomListController(new Common.Models.UserId()
            {
                GUID = Guid.NewGuid(),
                Name = name,
            }, "localhost", port);

            this.hooks = new DebugHooks("Client " + name, roomlist, (msg) => Console.WriteLine(msg));
            this.roomlist.RoomCreatedEvent += OnRoomCreated;
        }
Ejemplo n.º 2
0
    private void OnMultiPlayerClicked()
    {
        this.joined = false;
        this.prefabs.SelectGameTypeFrame.SetActive(false);

        this.roomlist = new NetClientRoomListController(currentUserId, "localhost", 12345);
        this.roomlist.RoomListUpdatedEvent              += OnRoomListUpdated;
        this.roomlist.LocalUserJoinRoomEvent            += OnJoinedRoom;
        this.roomlist.Client.Router.PacketReceivedEvent += (s, p) => Debug.Log("recv: " + p.GetType().Name + " " + p.ToString());
        this.roomlist.Client.Router.PacketSentEvent     += (s, p) => Debug.Log("send: " + p.GetType().Name + " " + p.ToString());
        this.roomlist.Connect();
    }