Skip to content

Conversation

@shacharrr
Copy link

No description provided.

@tslashd tslashd marked this pull request as draft January 13, 2024 12:33
@tslashd tslashd added the enhancement New feature or request label Jan 13, 2024
@tslashd
Copy link
Owner

tslashd commented Jan 13, 2024

Table for storing the replays:

CREATE TABLE `MapTimeReplay` (
	`player_id` INT(10) NOT NULL,
	`maptime_id` INT(10) NOT NULL,
	`map_id` INT(10) NOT NULL,
	`replay_frames` LONGBLOB NOT NULL,
	UNIQUE INDEX `maptime_id` (`maptime_id`) USING BTREE,
	INDEX `FK1_PID` (`player_id`) USING BTREE,
	INDEX `map_id` (`map_id`) USING BTREE,
	CONSTRAINT `FK1_PID` FOREIGN KEY (`player_id`) REFERENCES `MapTimes` (`player_id`) ON UPDATE NO ACTION ON DELETE CASCADE,
	CONSTRAINT `FK2_MapTimeID` FOREIGN KEY (`maptime_id`) REFERENCES `MapTimes` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE,
	CONSTRAINT `FK3_MapID` FOREIGN KEY (`map_id`) REFERENCES `MapTimes` (`map_id`) ON UPDATE NO ACTION ON DELETE CASCADE
);

Unsure whether we should set player_id to reference the Player table instead of MapTimes 🤔

@1zc
Copy link

1zc commented Jan 14, 2024

Table for storing the replays:

CREATE TABLE `MapTimeReplay` (
	`player_id` INT(10) NOT NULL,
	`maptime_id` INT(10) NOT NULL,
	`map_id` INT(10) NOT NULL,
	`replay_frames` LONGBLOB NOT NULL,
	UNIQUE INDEX `maptime_id` (`maptime_id`) USING BTREE,
	INDEX `FK1_PID` (`player_id`) USING BTREE,
	INDEX `map_id` (`map_id`) USING BTREE,
	CONSTRAINT `FK1_PID` FOREIGN KEY (`player_id`) REFERENCES `MapTimes` (`player_id`) ON UPDATE NO ACTION ON DELETE CASCADE,
	CONSTRAINT `FK2_MapTimeID` FOREIGN KEY (`maptime_id`) REFERENCES `MapTimes` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE,
	CONSTRAINT `FK3_MapID` FOREIGN KEY (`map_id`) REFERENCES `MapTimes` (`map_id`) ON UPDATE NO ACTION ON DELETE CASCADE
);

Unsure whether we should set player_id to reference the Player table instead of MapTimes 🤔

  1. We don't need player_id and map_id if we're linking to maptime_id, as that links to a table that has both.
  2. replay_frames can be a JSON data type, no need for blobs - would be better as JSON

@tslashd
Copy link
Owner

tslashd commented Jan 14, 2024

Table for storing the replays:

CREATE TABLE `MapTimeReplay` (
	`player_id` INT(10) NOT NULL,
	`maptime_id` INT(10) NOT NULL,
	`map_id` INT(10) NOT NULL,
	`replay_frames` LONGBLOB NOT NULL,
	UNIQUE INDEX `maptime_id` (`maptime_id`) USING BTREE,
	INDEX `FK1_PID` (`player_id`) USING BTREE,
	INDEX `map_id` (`map_id`) USING BTREE,
	CONSTRAINT `FK1_PID` FOREIGN KEY (`player_id`) REFERENCES `MapTimes` (`player_id`) ON UPDATE NO ACTION ON DELETE CASCADE,
	CONSTRAINT `FK2_MapTimeID` FOREIGN KEY (`maptime_id`) REFERENCES `MapTimes` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE,
	CONSTRAINT `FK3_MapID` FOREIGN KEY (`map_id`) REFERENCES `MapTimes` (`map_id`) ON UPDATE NO ACTION ON DELETE CASCADE
);

Unsure whether we should set player_id to reference the Player table instead of MapTimes 🤔

  1. We don't need player_id and map_id if we're linking to maptime_id, as that links to a table that has both.
  2. replay_frames can be a JSON data type, no need for blobs - would be better as JSON

Might as well just add replay_frames column to MapTimes table in that case, no?

- Fixed bot spamming errors with the TriggerStartZone/TriggerEndZone
- Added reverse/pause replay (!rr/!rp)
Still need to fix more bots than wanted joining, and make DB queries async
@shacharrr
Copy link
Author

shacharrr commented Jan 15, 2024

Table for storing the replays:

CREATE TABLE `MapTimeReplay` (
	`player_id` INT(10) NOT NULL,
	`maptime_id` INT(10) NOT NULL,
	`map_id` INT(10) NOT NULL,
	`replay_frames` LONGBLOB NOT NULL,
	UNIQUE INDEX `maptime_id` (`maptime_id`) USING BTREE,
	INDEX `FK1_PID` (`player_id`) USING BTREE,
	INDEX `map_id` (`map_id`) USING BTREE,
	CONSTRAINT `FK1_PID` FOREIGN KEY (`player_id`) REFERENCES `MapTimes` (`player_id`) ON UPDATE NO ACTION ON DELETE CASCADE,
	CONSTRAINT `FK2_MapTimeID` FOREIGN KEY (`maptime_id`) REFERENCES `MapTimes` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE,
	CONSTRAINT `FK3_MapID` FOREIGN KEY (`map_id`) REFERENCES `MapTimes` (`map_id`) ON UPDATE NO ACTION ON DELETE CASCADE
);

Unsure whether we should set player_id to reference the Player table instead of MapTimes 🤔

  1. We don't need player_id and map_id if we're linking to maptime_id, as that links to a table that has both.
  2. replay_frames can be a JSON data type, no need for blobs - would be better as JSON

As for json, the replay data Is really large and json didnt let me just insert it, I needed to use LONGBLOB and to compress as gzip just to add this, I might doing something wrong here

@shacharrr shacharrr changed the title Wa wa, it dont working well Replay bot Jan 15, 2024
TODO: Add stage/bonuses/etc support when done, update bot_quota to change upon loading map time
Added cool HUD when spectating replays.
Added css_spec/css_replaybotpause/css_replaybotflip
@shacharrr shacharrr marked this pull request as ready for review January 16, 2024 16:05
@tslashd tslashd merged commit 4fe1c9e into tslashd:personal-best Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants