Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions console/console.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion console/console.proto
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ message GroupExport {
// The group details.
api.Group group = 1;
// The group's list of members.
repeated api.GroupUserList.GroupUser members = 2;
repeated api.GroupUserList_GroupUser members = 2;
}

// A list of realtime matches, with their node names.
Expand Down
68 changes: 34 additions & 34 deletions console/console.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4343,7 +4343,7 @@
"state": {
"type": "integer",
"format": "int32",
"description": "The friend status.\n\none of \"Friend.State\"."
"description": "The friend status.\n\none of \"Friend_State\"."
},
"update_time": {
"type": "string",
Expand Down Expand Up @@ -4444,36 +4444,21 @@
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/GroupUser"
"$ref": "#/definitions/GroupUserList_GroupUser"
},
"description": "The group's list of members."
}
},
"description": "An export of all information stored for a group."
},
"GroupUser": {
"type": "object",
"properties": {
"user": {
"$ref": "#/definitions/api.User",
"description": "User."
},
"state": {
"type": "integer",
"format": "int32",
"description": "Their relationship to the group."
}
},
"description": "A single user-role pair."
},
"GroupUserList": {
"type": "object",
"properties": {
"group_users": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/GroupUser"
"$ref": "#/definitions/GroupUserList_GroupUser"
},
"description": "User-role pairs for a group."
},
Expand All @@ -4484,6 +4469,21 @@
},
"description": "A list of users belonging to a group, along with their role."
},
"GroupUserList_GroupUser": {
"type": "object",
"properties": {
"user": {
"$ref": "#/definitions/api.User",
"description": "User."
},
"state": {
"type": "integer",
"format": "int32",
"description": "Their relationship to the group."
}
},
"description": "A single user-role pair."
},
"HiroSystems": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -5616,29 +5616,14 @@
},
"description": "Request to update an existing user."
},
"UserGroup": {
"type": "object",
"properties": {
"group": {
"$ref": "#/definitions/Group",
"description": "Group."
},
"state": {
"type": "integer",
"format": "int32",
"description": "The user's relationship to the group."
}
},
"description": "A single group-role pair."
},
"UserGroupList": {
"type": "object",
"properties": {
"user_groups": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/UserGroup"
"$ref": "#/definitions/UserGroupList_UserGroup"
},
"description": "Group-role pairs for a user."
},
Expand All @@ -5649,6 +5634,21 @@
},
"description": "A list of groups belonging to a user, along with the user's role in each group."
},
"UserGroupList_UserGroup": {
"type": "object",
"properties": {
"group": {
"$ref": "#/definitions/Group",
"description": "Group."
},
"state": {
"type": "integer",
"format": "int32",
"description": "The user's relationship to the group."
}
},
"description": "A single group-role pair."
},
"UserList": {
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.3
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4
github.com/heroiclabs/nakama-common v1.44.1
github.com/heroiclabs/nakama-common v1.44.2-0.20260202090149-1af4154f9e6a
github.com/heroiclabs/sql-migrate v0.0.0-20241125131053-95a7949783b0
github.com/jackc/pgerrcode v0.0.0-20250907135507-afb5586c32a6
github.com/jackc/pgx/v5 v5.8.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4/go.mod h1:6Nz966r3vQYCqIzWsuEl
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/heroiclabs/nakama-common v1.44.1 h1:+2kc87K57lMltVNyxG4JzQdlq0XHe3NVby2ww5E09vg=
github.com/heroiclabs/nakama-common v1.44.1/go.mod h1:/KLxEy4+JdasHJLPt+tAXJJ8eXywWr/J+Q+KY+/vg7E=
github.com/heroiclabs/nakama-common v1.44.2-0.20260202081213-ff8cd5b0ec06 h1:qyytZl6obZC7VVMuAYTI7xB+GqWq/2QuVv3GpfD+Rk4=
github.com/heroiclabs/nakama-common v1.44.2-0.20260202081213-ff8cd5b0ec06/go.mod h1:/KLxEy4+JdasHJLPt+tAXJJ8eXywWr/J+Q+KY+/vg7E=
github.com/heroiclabs/nakama-common v1.44.2-0.20260202090149-1af4154f9e6a h1:Brl9cKYAkiEwRRiX705V1jqTHumKNrlNqSE4bsTUHQM=
github.com/heroiclabs/nakama-common v1.44.2-0.20260202090149-1af4154f9e6a/go.mod h1:/KLxEy4+JdasHJLPt+tAXJJ8eXywWr/J+Q+KY+/vg7E=
github.com/heroiclabs/sql-migrate v0.0.0-20241125131053-95a7949783b0 h1:hHJcYOP6L2/wZIEnYjjkJM+rOk/bK0uaYkDAejYpLhI=
github.com/heroiclabs/sql-migrate v0.0.0-20241125131053-95a7949783b0/go.mod h1:uwcmopkVQIfb/JQqul5zmGI9ounclRC08j9S9lLcpRQ=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
Expand Down
2 changes: 1 addition & 1 deletion server/console_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ RETURNING state`
}

var newState sql.NullInt64
if err := tx.QueryRowContext(ctx, query, groupID, uid, myState, api.GroupUserList_GroupUser_MEMBER).Scan(&newState); err != nil {
if err := tx.QueryRowContext(ctx, query, groupID, uid, myState, api.GroupRoleStatus_MEMBER).Scan(&newState); err != nil {
if err == sql.ErrNoRows {
return ErrEmptyMemberDemote
}
Expand Down
12 changes: 6 additions & 6 deletions server/core_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,13 @@ func LeaveGroup(ctx context.Context, logger *zap.Logger, db *sql.DB, tracker Tra
}

// Only count proper members, not banned edges or join requests.
switch api.GroupUserList_GroupUser_State(state.Int64) {
case api.GroupUserList_GroupUser_SUPERADMIN:
switch api.GroupRoleStatus(state.Int64) {
case api.GroupRoleStatus_SUPERADMIN:
otherSuperadminCount += count.Int64
fallthrough
case api.GroupUserList_GroupUser_ADMIN:
case api.GroupRoleStatus_ADMIN:
fallthrough
case api.GroupUserList_GroupUser_MEMBER:
case api.GroupRoleStatus_MEMBER:
otherMemberCount += count.Int64
}
}
Expand Down Expand Up @@ -1184,7 +1184,7 @@ OR
RETURNING state`

var newState sql.NullInt64
if err := tx.QueryRowContext(ctx, query, groupID, uid, myState, api.GroupUserList_GroupUser_MEMBER).Scan(&newState); err != nil {
if err := tx.QueryRowContext(ctx, query, groupID, uid, myState, api.GroupRoleStatus_MEMBER).Scan(&newState); err != nil {
if errors.Is(err, sql.ErrNoRows) {
continue
}
Expand Down Expand Up @@ -1331,7 +1331,7 @@ RETURNING state`
}

var newState sql.NullInt64
if err := tx.QueryRowContext(ctx, query, groupID, uid, myState, api.GroupUserList_GroupUser_MEMBER).Scan(&newState); err != nil {
if err := tx.QueryRowContext(ctx, query, groupID, uid, myState, api.GroupRoleStatus_MEMBER).Scan(&newState); err != nil {
if errors.Is(err, sql.ErrNoRows) {
continue
}
Expand Down