Skip to content

Commit

Permalink
- Reldens - v4.0.0 - Fix bots connection to room by command argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-pastorini committed Oct 8, 2024
1 parent e2fd4a3 commit 0277a18
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions theme/plugins/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Reldens - Load Test Bot
*
* Run with:
* node bot.js --numClients 10 --room room_game --endpoint http://localhost:8080
* node theme/plugins/bot.js --numClients 20 --room reldens-bots --endpoint http://localhost:8080 --output ./logs/bots-console.log
*/

const { cli } = require('@colyseus/loadtest');
Expand All @@ -24,7 +24,7 @@ async function main (options)
};

let gameClient = new GameClient(options.endpoint);
let gameRoom = await gameClient.joinOrCreate(options.roomName, userData);
let gameRoom = await gameClient.joinOrCreate('room_game', userData);

console.log('Joined GameRoom successfully!', randomGuestName);

Expand All @@ -49,10 +49,11 @@ async function main (options)
if(GameConst.CREATE_PLAYER_RESULT === gameMessage.act){
userData.isNewUser = false;
userData.selectedPlayer = gameMessage.player.id;
userData.selectedScene = 'reldens-bots-forest';
userData.selectedScene = options.roomName;

// join the bots room:
let reldensBootsRoom = await gameClient.joinOrCreate('reldens-bots-forest', userData);
console.log('Joining room: '+options.roomName);
let reldensBootsRoom = await gameClient.joinOrCreate(options.roomName, userData);
let canMove = true;
reldensBootsRoom?.onMessage('*', async (roomMessage) => {
// console.log('Message from ReldensBots', roomMessage.act);
Expand Down

0 comments on commit 0277a18

Please sign in to comment.