Commit 31873b2b authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Add presence join and leave reason.

parent f721c5e6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package server
import (
	"context"
	"fmt"
	"github.com/heroiclabs/nakama-common/runtime"
	"time"

	"github.com/gofrs/uuid"
@@ -69,6 +70,9 @@ func (m *MatchDataMessage) GetReliable() bool {
func (m *MatchDataMessage) GetReceiveTime() int64 {
	return m.ReceiveTime
}
func (m *MatchDataMessage) GetReason() runtime.PresenceReason {
	return runtime.PresenceReasonUnknown
}

type MatchHandler struct {
	logger          *zap.Logger
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ import (
	"sync"

	"github.com/gofrs/uuid"
	"github.com/heroiclabs/nakama-common/runtime"
	"go.uber.org/atomic"
)

@@ -27,6 +28,7 @@ type MatchPresence struct {
	UserID    uuid.UUID
	SessionID uuid.UUID
	Username  string
	Reason    runtime.PresenceReason
}

func (p *MatchPresence) GetUserId() string {
@@ -50,6 +52,9 @@ func (p *MatchPresence) GetUsername() string {
func (p *MatchPresence) GetStatus() string {
	return ""
}
func (p *MatchPresence) GetReason() runtime.PresenceReason {
	return p.Reason
}

// Used to monitor when match presences begin and complete their match join process.
type MatchJoinMarker struct {
+3 −0
Original line number Diff line number Diff line
@@ -70,6 +70,9 @@ func (p *MatchmakerPresence) GetUsername() string {
func (p *MatchmakerPresence) GetStatus() string {
	return ""
}
func (p *MatchmakerPresence) GetReason() runtime.PresenceReason {
	return runtime.PresenceReasonUnknown
}

type MatchmakerEntry struct {
	Ticket     string                 `json:"ticket"`
+1 −2
Original line number Diff line number Diff line
@@ -16,14 +16,13 @@ package server

import (
	"bytes"
	"database/sql"
	"encoding/json"
	"fmt"
	"regexp"
	"time"
	"unicode/utf8"

	"database/sql"

	"github.com/gofrs/uuid"
	"github.com/golang/protobuf/ptypes/timestamp"
	"github.com/golang/protobuf/ptypes/wrappers"
+1 −2
Original line number Diff line number Diff line
@@ -15,10 +15,9 @@
package server

import (
	"crypto"
	"fmt"
	"strings"

	"crypto"
	"time"

	"github.com/dgrijalva/jwt-go"
Loading