Commit 0e67a1f8 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

DB defaults update, friend and group state cleanup.

parent eae1877f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -4,7 +4,17 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org).

## [Unreleased]
### Added
- New runtime function to send raw realtime envelope data through streams.

### Changed
- Change error message on database errors raised during authentication operations.
- New default for maximum number of open database connections.
- Friend state indicators are no longer offset when sent to clients.
- Group state indicators are no longer offset when sent to clients.

### Fixed
- Correctly handle optional parameters in runtime functions to update account information.
- Correctly handle context cancellation in single-statement database operations.

## [2.1.3] - 2018-11-02
+261 −274

File changed.

Preview size limit exceeded, changes collapsed.

+17 −23
Original line number Diff line number Diff line
@@ -292,22 +292,20 @@ message DeleteStorageObjectsRequest {
message Friend {
  // The friendship status.
  enum State {
    // Default case. Assumed as FRIEND state.
    STATE_UNSPECIFIED = 0;
    // The user is a friend of the current user.
    FRIEND = 1;
    // The user has sent an invite to the current user.
    INVITE_SENT = 2;
    // The current user has sent an invite to this user.
    INVITE_RECEIVED = 3;
    FRIEND = 0;
    // The current user has sent an invite to the user.
    INVITE_SENT = 1;
    // The current user has received an invite from this user.
    INVITE_RECEIVED = 2;
    // The current user has blocked this user.
    BLOCKED = 4;
    BLOCKED = 3;
  }

  // The user object.
  User user = 1;
  // The friend status.
  int32 state = 2; // one of "Friend.State".
  google.protobuf.Int32Value state = 2; // one of "Friend.State".
}

// A collection of zero or more friends of the user.
@@ -368,22 +366,20 @@ message GroupUserList {
  message GroupUser {
    // The group role status.
    enum State {
      // Default case. Assumed as SUPERADMIN state.
      STATE_UNSPECIFIED = 0;
      // The user is a superadmin with full control of the group.
      SUPERADMIN = 1;
      SUPERADMIN = 0;
      // The user is an admin with additional privileges.
      ADMIN = 2;
      ADMIN = 1;
      // The user is a regular member.
      MEMBER = 3;
      MEMBER = 2;
      // The user has requested to join the group
      JOIN_REQUEST = 4;
      JOIN_REQUEST = 3;
    }

    // User.
    User user = 1;
    // Their relationship to the group.
    int32 state = 2;
    google.protobuf.Int32Value state = 2;
  }

  // User-role pairs for a group.
@@ -872,22 +868,20 @@ message UserGroupList {
  message UserGroup {
    // The group role status.
    enum State {
      // Default case. Assumed as SUPERADMIN state.
      STATE_UNSPECIFIED = 0;
      // The user is a superadmin with full control of the group.
      SUPERADMIN = 1;
      SUPERADMIN = 0;
      // The user is an admin with additional privileges.
      ADMIN = 2;
      ADMIN = 1;
      // The user is a regular member.
      MEMBER = 3;
      MEMBER = 2;
      // The user has requested to join the group
      JOIN_REQUEST = 4;
      JOIN_REQUEST = 3;
    }

    // Group.
    Group group = 1;
    // The user's relationship to the group.
    int32 state = 2;
    google.protobuf.Int32Value state = 2;
  }

  // Group-role pairs for a user.
+6 −0
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ type NakamaClient interface {
	ImportFacebookFriends(ctx context.Context, in *api.ImportFacebookFriendsRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Immediately join an open group, or request to join a closed one.
	JoinGroup(ctx context.Context, in *api.JoinGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Attempt to join an open and running tournament.
	JoinTournament(ctx context.Context, in *api.JoinTournamentRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Kick a set of users from a group.
	KickGroupUsers(ctx context.Context, in *api.KickGroupUsersRequest, opts ...grpc.CallOption) (*empty.Empty, error)
@@ -240,6 +241,7 @@ type NakamaClient interface {
	ListGroupUsers(ctx context.Context, in *api.ListGroupUsersRequest, opts ...grpc.CallOption) (*api.GroupUserList, error)
	// List leaderboard records.
	ListLeaderboardRecords(ctx context.Context, in *api.ListLeaderboardRecordsRequest, opts ...grpc.CallOption) (*api.LeaderboardRecordList, error)
	// List leaderboard records that belong to a user.
	ListLeaderboardRecordsAroundOwner(ctx context.Context, in *api.ListLeaderboardRecordsAroundOwnerRequest, opts ...grpc.CallOption) (*api.LeaderboardRecordList, error)
	// Fetch list of running matches.
	ListMatches(ctx context.Context, in *api.ListMatchesRequest, opts ...grpc.CallOption) (*api.MatchList, error)
@@ -251,6 +253,7 @@ type NakamaClient interface {
	ListTournaments(ctx context.Context, in *api.ListTournamentsRequest, opts ...grpc.CallOption) (*api.TournamentList, error)
	// List tournament records.
	ListTournamentRecords(ctx context.Context, in *api.ListTournamentRecordsRequest, opts ...grpc.CallOption) (*api.TournamentRecordList, error)
	// List tournament records for a given owner.
	ListTournamentRecordsAroundOwner(ctx context.Context, in *api.ListTournamentRecordsAroundOwnerRequest, opts ...grpc.CallOption) (*api.TournamentRecordList, error)
	// List groups the current user belongs to.
	ListUserGroups(ctx context.Context, in *api.ListUserGroupsRequest, opts ...grpc.CallOption) (*api.UserGroupList, error)
@@ -869,6 +872,7 @@ type NakamaServer interface {
	ImportFacebookFriends(context.Context, *api.ImportFacebookFriendsRequest) (*empty.Empty, error)
	// Immediately join an open group, or request to join a closed one.
	JoinGroup(context.Context, *api.JoinGroupRequest) (*empty.Empty, error)
	// Attempt to join an open and running tournament.
	JoinTournament(context.Context, *api.JoinTournamentRequest) (*empty.Empty, error)
	// Kick a set of users from a group.
	KickGroupUsers(context.Context, *api.KickGroupUsersRequest) (*empty.Empty, error)
@@ -898,6 +902,7 @@ type NakamaServer interface {
	ListGroupUsers(context.Context, *api.ListGroupUsersRequest) (*api.GroupUserList, error)
	// List leaderboard records.
	ListLeaderboardRecords(context.Context, *api.ListLeaderboardRecordsRequest) (*api.LeaderboardRecordList, error)
	// List leaderboard records that belong to a user.
	ListLeaderboardRecordsAroundOwner(context.Context, *api.ListLeaderboardRecordsAroundOwnerRequest) (*api.LeaderboardRecordList, error)
	// Fetch list of running matches.
	ListMatches(context.Context, *api.ListMatchesRequest) (*api.MatchList, error)
@@ -909,6 +914,7 @@ type NakamaServer interface {
	ListTournaments(context.Context, *api.ListTournamentsRequest) (*api.TournamentList, error)
	// List tournament records.
	ListTournamentRecords(context.Context, *api.ListTournamentRecordsRequest) (*api.TournamentRecordList, error)
	// List tournament records for a given owner.
	ListTournamentRecordsAroundOwner(context.Context, *api.ListTournamentRecordsAroundOwnerRequest) (*api.TournamentRecordList, error)
	// List groups the current user belongs to.
	ListUserGroups(context.Context, *api.ListUserGroupsRequest) (*api.UserGroupList, error)
+3 −0
Original line number Diff line number Diff line
@@ -1371,6 +1371,7 @@
    },
    "/v2/leaderboard/{leaderboard_id}/owner/{owner_id}": {
      "get": {
        "summary": "List leaderboard records that belong to a user.",
        "operationId": "ListLeaderboardRecordsAroundOwner",
        "responses": {
          "200": {
@@ -1947,6 +1948,7 @@
    },
    "/v2/tournament/{tournament_id}/join": {
      "post": {
        "summary": "Attempt to join an open and running tournament.",
        "operationId": "JoinTournament",
        "responses": {
          "200": {
@@ -1972,6 +1974,7 @@
    },
    "/v2/tournament/{tournament_id}/owner/{owner_id}": {
      "get": {
        "summary": "List tournament records for a given owner.",
        "operationId": "ListTournamentRecordsAroundOwner",
        "responses": {
          "200": {
Loading