Closed kjnn closed 5 years ago
What if just paste the code in the console? Also, try this code:
var loader = document.createElement('script')
loader.src = 'protocol://path/to/the/code'
document.body.append(loader)
When i said deploy i meant pasting the code in the console and press enter and after the recaptcha and inserting nickname that error is showed. About your code, how should i integrate it with script? im copying the first example here https://github.com/haxball/haxball-issues/wiki/Headless-Host.
Do you have any errors on the host page? I mean haxball.com/headless
.
no
Are other people able to join your room? Try to create a regular (not headless) room and join it. Tell me if you can join.
Yes i don't have any problem with normal room
Paste your code here.
Also try this code:
HBInit({ public: true })
and tell me if the error still appears.
var room = HBInit({ roomName: "My room", maxPlayers: 16 }); room.setDefaultStadium("Big"); room.setScoreLimit(5); room.setTimeLimit(0);
// If there are no admins left in the room give admin to one of the remaining players. function updateAdmins() { // Get all players except the host (id = 0 is always the host) var players = room.getPlayerList().filter((player) => player.id != 0 ); if ( players.length == 0 ) return; // No players left, do nothing. if ( players.find((player) => player.admin) != null ) return; // There's an admin left so do nothing. room.setPlayerAdmin(players[0].id, true); // Give admin to the first non admin player in the list }
room.onPlayerJoin = function(player) { updateAdmins(); }
room.onPlayerLeave = function(player) { updateAdmins(); }
The error still appears even if i type only HBInit({ public: true })
Looks like I cannot help you with this. Wait for @basro's response.
HELP
It was my mistake...i was opening the room in the same window of the headless one, sorry :D
Close the issue, please.
Hello, i have a problem when i deploy the headless javascript(i tested the first script posted on headless documentation) to headless url. The following error are showed mozilla: chrome/opera:
I also tried to disable the "Block scripts loaded via document.write" flag and to try an older version of chrome but the error persists.. I remember that last summer i was able to deploy it without any problem, what do you suggest?