- add: redis cache refresh function sets the ttl for a key

- update: session service refresh session function now just updates the ttl of the session instead of calling set
This commit is contained in:
2025-03-09 17:08:56 -04:00
parent 0dc69bcfcf
commit 14c6aa485a
7 changed files with 81 additions and 67 deletions

View File

@@ -9,7 +9,7 @@ service AuthService {
rpc Logout(LogoutRequest) returns (common.Empty);
rpc ValidateToken(ValidateTokenRequest) returns (ValidateTokenResponse);
rpc ValidateSession(ValidateSessionRequest) returns (ValidateSessionResponse);
rpc RefreshSession(ValidateSessionRequest) returns (ValidateSessionResponse);
rpc RefreshSession(ValidateSessionRequest) returns (RefreshSessionResponse);
rpc Register (RegisterRequest) returns (RegisterResponse);
rpc RequestPasswordReset (PasswordResetRequest) returns (PasswordResetResponse);
rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse);
@@ -51,6 +51,10 @@ message ValidateSessionResponse {
string user_id = 3;
}
message RefreshSessionResponse {
bool valid = 1;
}
message RegisterRequest {
string username = 1;
string email = 2;

View File

@@ -7,7 +7,7 @@ import "common.proto";
service SessionService {
rpc CreateSession (CreateSessionRequest) returns (SessionResponse);
rpc GetSession (GetSessionRequest) returns (SessionResponse);
rpc RefreshSession (GetSessionRequest) returns (SessionResponse);
rpc RefreshSession (GetSessionRequest) returns (RefreshSessionResponse);
rpc DeleteSession (DeleteSessionRequest) returns (common.Empty);
}
@@ -36,3 +36,7 @@ message SessionResponse {
string ip_address = 6;
}
message RefreshSessionResponse {
bool valid = 1;
}

View File

@@ -3,65 +3,66 @@ syntax = "proto3";
package world;
service WorldService {
rpc GetCharacter(CharacterRequest) returns (CharacterResponse);
rpc ChangeMap(ChangeMapRequest) returns (ChangeMapResponse);
rpc MoveCharacter(CharacterMoveRequest) returns (CharacterMoveResponse);
rpc GetCharacter(CharacterRequest) returns (CharacterResponse);
rpc ChangeMap(ChangeMapRequest) returns (ChangeMapResponse);
rpc MoveCharacter(CharacterMoveRequest) returns (CharacterMoveResponse);
rpc GetTargetHp(ObjectHpRequest) returns (ObjectHpResponse);
}
message CharacterRequest {
string token = 1;
string user_id = 2;
string char_id = 3;
string session_id = 4;
string token = 1;
string user_id = 2;
string char_id = 3;
string session_id = 4;
}
message CharacterResponse {
int32 count = 1;
int32 count = 1;
}
message CharacterMoveRequest {
string session_id = 1;
uint32 target_id = 2;
float x = 3;
float y = 4;
float z = 5;
string session_id = 1;
uint32 target_id = 2;
float x = 3;
float y = 4;
float z = 5;
}
message CharacterMoveResponse {
int32 id = 1;
int32 target_id = 2;
int32 distance = 3;
float x = 4;
float y = 5;
float z = 6;
int32 id = 1;
int32 target_id = 2;
int32 distance = 3;
float x = 4;
float y = 5;
float z = 6;
}
message ChangeMapRequest {
int32 id = 1;
float x = 2;
float y = 3;
int32 id = 1;
float x = 2;
float y = 3;
}
message ChangeMapResponse {
int32 id = 1;
int32 map_id = 2;
float x = 3;
float y = 4;
int32 move_mode = 5;
int32 ride_mode = 6;
int32 id = 1;
int32 map_id = 2;
float x = 3;
float y = 4;
int32 move_mode = 5;
int32 ride_mode = 6;
}
message AttackRequest {
string session_id = 1;
uint32 target_id = 2;
string session_id = 1;
uint32 target_id = 2;
}
message ObjectHpRequest {
string session_id = 1;
uint32 target_id = 2;
string session_id = 1;
uint32 target_id = 2;
}
message ObjectHpResponse {
uint32 target_id = 1;
int32 hp = 2;
uint32 target_id = 1;
int32 hp = 2;
}