eBot-CSGO icon indicating copy to clipboard operation
eBot-CSGO copied to clipboard

errors in eBot

Open csplkiller opened this issue 8 years ago • 16 comments

i found error in Match.php (sorry i new github user...) please fix...

934 line....

	if ($this->currentMap->getMapName() == "tba" || $this->getStatus() > 2 || strpos($this->currentMap->getMapName(), $message->maps) !== false  ) {

Эта поправка поправляет некоторые проблемы при использовании workshop карт.

Right code:

	if ($this->currentMap->getMapName() == "tba" || $this->getStatus() > 2 || strpos($message->maps, $this->currentMap->getMapName()) !== false  ) {

csplkiller avatar Feb 17 '17 17:02 csplkiller

One more error in Match.php in 1251 / 1252 line

$this->restart["ct"] = false; $this->restart["ct"] = false;

Correct:

$this->restart["ct"] = false; $this->restart["t"] = false;

csplkiller avatar Mar 16 '17 12:03 csplkiller

One more error in Logger.php

replace all - APP_ROOT . DIRECTORY_SEPARATOR to APP_ROOT

csplkiller avatar Mar 30 '17 15:03 csplkiller

One more error in Match.php in 2984 line

private function getLogAdminFilePath() { return Logger::getInstance()->getLogPathAdmin() . "/match-" . $this->matchData["id"] . ".html"; } private function getLogFilePath() { return Logger::getInstance()->getLogPath() . "/match-" . $this->matchData["id"] . ".html"; }

replace by

` private function getLogAdminFilePath() { return Logger::getInstance()->getLogPathAdmin() . "match-" . $this->matchData["id"] . ".html"; }

private function getLogFilePath() {
    return Logger::getInstance()->getLogPath() . "match-" . $this->matchData["id"] . ".html";
}

`

csplkiller avatar Mar 30 '17 15:03 csplkiller

Critical error in ? ebot web ? websocket server ?

If I update the log monitoring page of the match. Then the NODE WEB SERVER falls with a critical error. For example, page: /admin.php/matchs/rcon/open/#MATCH_ID ` TypeError: fn.bind is not a function at Adapter.clients (/ebot/node_modules/socket.io-adapter/index.js:196:31) at Namespace.clients (/ebot/node_modules/socket.io/lib/namespace.js:256:16) at Socket. (/ebot/websocket_server.js:144:29) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at Socket.emit (/ebot/node_modules/socket.io/lib/socket.js:141:10) at Socket.onclose (/ebot/node_modules/socket.io/lib/socket.js:441:8) at Client.onclose (/ebot/node_modules/socket.io/lib/client.js:235:24) at emitTwo (events.js:92:20) at Socket.emit (events.js:172:7)

`

Not a very good way to fix the problem. But in order to do it normally, you need to study the web admin code in detail.

websocket_server.js - fix

Find: socket.on('disconnect', function(data) { if (socket.taggedLogger) { if (io.sockets.clients('loggers').length == 1) { var dgram = new Buffer("__false__"); clientUDP.send(dgram, 0, dgram.length, udp_port, udp_ip); } } }); Replace:

socket.on('disconnect', function(data) { try { if (socket.taggedLogger) { if (io.sockets.clients('loggers').length == 1) { var dgram = new Buffer("__false__"); clientUDP.send(dgram, 0, dgram.length, udp_port, udp_ip); } } }catch(e){ console.error(e.name); console.error(e.message); console.error(e.stack); } });

csplkiller avatar Mar 31 '17 12:03 csplkiller

@csplkiller - Do you have trick for get BO3 working?

mrc4tt avatar Apr 05 '17 20:04 mrc4tt

No

csplkiller avatar Apr 14 '17 11:04 csplkiller

@MikkelDK You can get bo3 to work easily by manually inserting stuff into the database. If you have prepicked maps, set map_selection_mode = 'bo3_modea' and add the maps to the database with maps_for = 'team1' for the first map, 'team2' for the second and 'default' for the third.

gaulzi avatar Apr 24 '17 22:04 gaulzi

@gaulzi - I cant see where i could do that. does i need to insert "extra" database with: "maps_for_team1" ?

I have try like that: map_selection_mode => bo3_modea (correct.) I go to: maps => map_name? or maps_for [there is only 1 into] (eg: de_nuke)

mrc4tt avatar Apr 25 '17 11:04 mrc4tt

@MikkelDK Here's how I do it. I first insert a row in matchs with

INSERT INTO matchs (id, ip, server_id, season_id, team_a, team_a_flag, team_a_name, team_b, team_b_flag, team_b_name, status, max_round, rules, overtime_startmoney, overtime_max_round, config_ot, config_knife_round, config_authkey, map_selection_mode, current_map, startdate, created_at, updated_at) VALUES (:id, :ip, :serverid, :seasonid, :team1id, :team1flag, :team1name, :team2id, :team2flag, :team2name, 0, 15, :cfg, 10000, 3, 1, 1, :authkey, :maptype, NULL, NOW(), NOW(), NOW())

where :maptype = 'bo3_modea', :cfg = 'esl5on5', :authkey is a unique hex string that you generate for the match.

I then insert rows for each map with

INSERT INTO maps (match_id, map_name, current_side, maps_for, identifier_id, tv_record_file, created_at, updated_at) VALUES (:matchid, :mapname, \'ct\', :mapsfor, NULL, NULL, NOW(), NOW()) where :mapsfor = 'team1' for the first map, 'team2' for the second and 'default' for the third. You then need to update the row you inserted in matchs so that the 'current_map' column references the first map of the bo3 series. Here's how I do it:

UPDATE matchs SET status = 1, enable = 1, current_map = :mapid WHERE id = :matchid

where :mapid is the ID of the first map you inserted and :matchid is the ID of the match.

gaulzi avatar Apr 25 '17 13:04 gaulzi

@gaulzi - Does it mean i need (manually) to set that for "new matches" example?

mrc4tt avatar Apr 25 '17 13:04 mrc4tt

@MikkelDK Yes, you can not use the eBot web interface to do this, you will need to write your own code for that. Also, the eBot web interface is quite buggy for managing bo3 matches after you've put them into the database and started the match.

gaulzi avatar Apr 25 '17 13:04 gaulzi

@gaulzi - does i need to delete all matches (before i can perform the new SQL code?)

mrc4tt avatar Apr 25 '17 14:04 mrc4tt

@MikkelDK No, you don't have to delete anything that already exists in the database. I would recommend that you try this out first on an empty database so you don't mess anything up. It might take you a couple of tries before you get it up and running and you might have to restart the eBot daemon in between if you make mistakes.

gaulzi avatar Apr 25 '17 14:04 gaulzi

@gaulzi Exmaple this error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':matchid, :mapname, \'ct\', :mapsfor, NULL, NULL, NOW(), NOW()) (7, 7, 'de_trai' at line 5

Possible for contact you private?

mrc4tt avatar Apr 25 '17 14:04 mrc4tt

@MikkelDK The lines I pasted are taken directly from my code where I use PHP's PDO class to query the database. The strings with a colon prefix (e.g. :matchid, :mapname etc) are variables which you should replace with your own values. Don't forget to add quotes around strings. Where I wrote '\ct\' you should only do 'ct' - in my code I had to escape the quotes since the query string was inside single quotes. I am not available for further discussion on this, you will need to figure the rest out for yourself.

gaulzi avatar Apr 25 '17 20:04 gaulzi

@gaulzi I know this is "outdated" by 3 years.

Maybe you can remember how it should looks (as an example?) since I wanna know, so maybe you remember how?

I have this (as an example):

INSERT INTO `maps` (`id`, `match_id`, `map_name`, `score_1`, `score_2`, `current_side`, `status`, `maps_for`, `nb_ot`, `identifier_id`, `tv_record_file`, `created_at`, `updated_at`) VALUES
(3, 3, 'de_dust2', 0, 0, 'ct', 0, 'default', 0, NULL, '3_test-test2_de_dust2', '2020-10-20 20:04:47', '2020-10-20 20:17:27');

So, where should "maps" or where to insert what, I need to add? - if I want to make BO3 (dunno about BO2 is possible, with 2 maps?

Just more, about you have some idea! :D let's take (as an example: de_dust2, de_nuke, and de_mirage) Thank you! =D

mrc4tt avatar Oct 21 '20 14:10 mrc4tt