<?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[preventing client from creating rooms on the server]]></title><description><![CDATA[<p>If your server is fully responsible for the creation and deletion of rooms and the matchmaking of players into them and...<br />
if your server will give the client a room reservation in some way and...<br />
if your client will only connect to the server with a room reservation using <code>client.consumeSeatReservation</code> and...<br />
if you want to prevent any client from ever creating a room on the server and...<br />
if you do not mind to use a dirty workaround...</p>
<p>...you can override the private (D'OH) property <code>exposedMethods</code> of the <code>Server</code> class:</p>
<pre><code>const gameServer = new Server();
const tempServer = gameServer as any; // force access to private property by casting to any
tempServer.exposedMethods = []; // override property with empty array to not expose those methods anymore
gameServer.listen(port);
</code></pre>
<p>Yes, it is dirty, it might break in the future, it might not work for you, but it works perfectly for me and it made me giggle maniacally.</p>
]]></description><link>http://discuss.colyseus.io/topic/472/preventing-client-from-creating-rooms-on-the-server</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 17:00:45 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/472.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Jun 2021 21:37:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to preventing client from creating rooms on the server on Wed, 02 Jun 2021 21:46:51 GMT]]></title><description><![CDATA[<p>If your server is fully responsible for the creation and deletion of rooms and the matchmaking of players into them and...<br />
if your server will give the client a room reservation in some way and...<br />
if your client will only connect to the server with a room reservation using <code>client.consumeSeatReservation</code> and...<br />
if you want to prevent any client from ever creating a room on the server and...<br />
if you do not mind to use a dirty workaround...</p>
<p>...you can override the private (D'OH) property <code>exposedMethods</code> of the <code>Server</code> class:</p>
<pre><code>const gameServer = new Server();
const tempServer = gameServer as any; // force access to private property by casting to any
tempServer.exposedMethods = []; // override property with empty array to not expose those methods anymore
gameServer.listen(port);
</code></pre>
<p>Yes, it is dirty, it might break in the future, it might not work for you, but it works perfectly for me and it made me giggle maniacally.</p>
]]></description><link>http://discuss.colyseus.io/post/1520</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1520</guid><dc:creator><![CDATA[TeeTeeHaa]]></dc:creator><pubDate>Wed, 02 Jun 2021 21:46:51 GMT</pubDate></item></channel></rss>