<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help ! Creating Card Game , Create new (table) room in Unity]]></title><description><![CDATA[<p>i'm creating multiplayer card game. i want make a private table (room) , but when i'm connecting to server it all connect to same room.</p>
<p>my code:</p>
<pre><code>public string serverName = &quot;localhost&quot;;
public string port = &quot;3553&quot;;
public string roomName = &quot;chat&quot;;
</code></pre>
<p>public IEnumerator Start()<br />
{<br />
String uri = &quot;ws://&quot; + serverName + &quot;:&quot; + port;<br />
Debug.Log(uri);<br />
client = new Client(uri);</p>
<pre><code>    client.OnOpen += OnOpenHandler;
    client.OnClose += (object sender, EventArgs e) =&gt; Debug.Log(&quot;CONNECTION CLOSED&quot;);

    Debug.Log(&quot;Let's connect the client!&quot;);
    yield return StartCoroutine(client.Connect());
    room = client.Join(roomName);
}

public void Join()//button event
{
    StartCoroutine(ConnectToRoom(rname.text));
    rname.text = &quot;&quot;;
}

public void Create()//button event
{
    StartCoroutine(ConnectToRoom(rname.text));
    rname.text = &quot;&quot;;
}

IEnumerator ConnectToRoom(String Room_Name)
{
    Debug.Log(&quot;Let's join the room!&quot;);

    //if Client Dose not Set room name;
    if (Room_Name.Equals(&quot;&quot;))
    {
        Room_Name = &quot;NO ROOM NAME&quot;;
    }

    //Client Connect to Existing room
    if (!isExistingRoom)
    {
        room = client.Join(roomName, new Dictionary&lt;string, object&gt;()
        {
            { &quot;create&quot;, true },
            { &quot;name&quot;, Room_Name }
        });
    }
    else
    {
        room = client.Join(Room_Name);
        isExistingRoom = false;
    }

    room.OnReadyToConnect += (sender, e) =&gt;
    {
        Debug.Log(&quot;Ready to connect to room!&quot;);
        StartCoroutine(room.Connect());
    };
    room.OnJoin += OnRoomJoined;
    room.OnStateChange += OnStateChangeHandler;

    room.Listen(&quot;players/:id&quot;, this.OnPlayerChange);//players array
    room.Listen(&quot;players/:id/:axis&quot;, this.OnPlayerMove);//x and y coridinates
    room.Listen(&quot;messages/:number&quot;, this.OnMessageAdded);//message array
    room.Listen(this.OnChangeFallback);

    room.OnMessage += OnMessage;

    while (true)
    {
        client.Recv();
        yield return 0;
    }
}</code></pre>
]]></description><link>http://discuss.colyseus.io/topic/135/help-creating-card-game-create-new-table-room-in-unity</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 17:51:57 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/135.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Aug 2018 12:45:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help ! Creating Card Game , Create new (table) room in Unity on Invalid Date]]></title><description><![CDATA[<p>i'm creating multiplayer card game. i want make a private table (room) , but when i'm connecting to server it all connect to same room.</p>
<p>my code:</p>
<pre><code>public string serverName = &quot;localhost&quot;;
public string port = &quot;3553&quot;;
public string roomName = &quot;chat&quot;;
</code></pre>
<p>public IEnumerator Start()<br />
{<br />
String uri = &quot;ws://&quot; + serverName + &quot;:&quot; + port;<br />
Debug.Log(uri);<br />
client = new Client(uri);</p>
<pre><code>    client.OnOpen += OnOpenHandler;
    client.OnClose += (object sender, EventArgs e) =&gt; Debug.Log(&quot;CONNECTION CLOSED&quot;);

    Debug.Log(&quot;Let's connect the client!&quot;);
    yield return StartCoroutine(client.Connect());
    room = client.Join(roomName);
}

public void Join()//button event
{
    StartCoroutine(ConnectToRoom(rname.text));
    rname.text = &quot;&quot;;
}

public void Create()//button event
{
    StartCoroutine(ConnectToRoom(rname.text));
    rname.text = &quot;&quot;;
}

IEnumerator ConnectToRoom(String Room_Name)
{
    Debug.Log(&quot;Let's join the room!&quot;);

    //if Client Dose not Set room name;
    if (Room_Name.Equals(&quot;&quot;))
    {
        Room_Name = &quot;NO ROOM NAME&quot;;
    }

    //Client Connect to Existing room
    if (!isExistingRoom)
    {
        room = client.Join(roomName, new Dictionary&lt;string, object&gt;()
        {
            { &quot;create&quot;, true },
            { &quot;name&quot;, Room_Name }
        });
    }
    else
    {
        room = client.Join(Room_Name);
        isExistingRoom = false;
    }

    room.OnReadyToConnect += (sender, e) =&gt;
    {
        Debug.Log(&quot;Ready to connect to room!&quot;);
        StartCoroutine(room.Connect());
    };
    room.OnJoin += OnRoomJoined;
    room.OnStateChange += OnStateChangeHandler;

    room.Listen(&quot;players/:id&quot;, this.OnPlayerChange);//players array
    room.Listen(&quot;players/:id/:axis&quot;, this.OnPlayerMove);//x and y coridinates
    room.Listen(&quot;messages/:number&quot;, this.OnMessageAdded);//message array
    room.Listen(this.OnChangeFallback);

    room.OnMessage += OnMessage;

    while (true)
    {
        client.Recv();
        yield return 0;
    }
}</code></pre>
]]></description><link>http://discuss.colyseus.io/post/444</link><guid isPermaLink="true">http://discuss.colyseus.io/post/444</guid><dc:creator><![CDATA[hardik_sl]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>