mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Implement replay sharing (#6066)
* new protos * implement commands on server * add buttons * icons * run formatter * Message on get replay code failure * Add new commands to switch statement * Better failure messages * Fix permission check query * Change hash method * Prevent adding duplicate replays * Clean up TabReplay ui * Copy over replay name * base64 encode the hash * Shorten hash * Better failure messages * change icon back to search icon * check hash before checking if user already has access * update share icon * Update label text
This commit is contained in:
parent
5e88a0f0cc
commit
ab4373d025
12 changed files with 342 additions and 7 deletions
|
|
@ -37,6 +37,8 @@ set(PROTO_FILES
|
|||
command_replay_list.proto
|
||||
command_replay_download.proto
|
||||
command_replay_modify_match.proto
|
||||
command_replay_get_code.proto
|
||||
command_replay_submit_code.proto
|
||||
command_reveal_cards.proto
|
||||
command_reverse_turn.proto
|
||||
command_roll_die.proto
|
||||
|
|
@ -130,6 +132,7 @@ set(PROTO_FILES
|
|||
response_password_salt.proto
|
||||
response_register.proto
|
||||
response_replay_download.proto
|
||||
response_replay_get_code.proto
|
||||
response_replay_list.proto
|
||||
response_viewlog_history.proto
|
||||
response_warn_history.proto
|
||||
|
|
|
|||
9
common/pb/command_replay_get_code.proto
Normal file
9
common/pb/command_replay_get_code.proto
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
syntax = "proto2";
|
||||
import "session_commands.proto";
|
||||
|
||||
message Command_ReplayGetCode {
|
||||
extend SessionCommand {
|
||||
optional Command_ReplayGetCode ext = 1104;
|
||||
}
|
||||
optional sint32 game_id = 1 [default = -1];
|
||||
}
|
||||
9
common/pb/command_replay_submit_code.proto
Normal file
9
common/pb/command_replay_submit_code.proto
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
syntax = "proto2";
|
||||
import "session_commands.proto";
|
||||
|
||||
message Command_ReplaySubmitCode {
|
||||
extend SessionCommand {
|
||||
optional Command_ReplaySubmitCode ext = 1105;
|
||||
}
|
||||
optional string replay_code = 1;
|
||||
}
|
||||
|
|
@ -65,6 +65,7 @@ message Response {
|
|||
GET_ADMIN_NOTES = 1018;
|
||||
REPLAY_LIST = 1100;
|
||||
REPLAY_DOWNLOAD = 1101;
|
||||
REPLAY_GET_CODE = 1102;
|
||||
}
|
||||
required uint64 cmd_id = 1;
|
||||
optional ResponseCode response_code = 2;
|
||||
|
|
|
|||
9
common/pb/response_replay_get_code.proto
Normal file
9
common/pb/response_replay_get_code.proto
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
syntax = "proto2";
|
||||
import "response.proto";
|
||||
|
||||
message Response_ReplayGetCode {
|
||||
extend Response {
|
||||
optional Response_ReplayGetCode ext = 1102;
|
||||
}
|
||||
optional string replay_code = 1;
|
||||
}
|
||||
|
|
@ -31,6 +31,8 @@ message SessionCommand {
|
|||
REPLAY_DOWNLOAD = 1101;
|
||||
REPLAY_MODIFY_MATCH = 1102;
|
||||
REPLAY_DELETE_MATCH = 1103;
|
||||
REPLAY_GET_CODE = 1104;
|
||||
REPLAY_SUBMIT_CODE = 1105;
|
||||
}
|
||||
extensions 100 to max;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue