Loading runtime/runtime.go +1 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,7 @@ type NakamaModule interface { StreamCount(mode uint8, subject, descriptor, label string) (int, error) StreamClose(mode uint8, subject, descriptor, label string) error StreamSend(mode uint8, subject, descriptor, label, data string) error StreamSendRaw(mode uint8, subject, descriptor, label string, msg *rtapi.Envelope) error MatchCreate(ctx context.Context, module string, params map[string]interface{}) (string, error) MatchList(ctx context.Context, limit int, authoritative bool, label string, minSize, maxSize int, query string) ([]*api.Match, error) Loading server/runtime_go_nakama.go +27 −0 Original line number Diff line number Diff line Loading @@ -627,6 +627,33 @@ func (n *RuntimeGoNakamaModule) StreamSend(mode uint8, subject, descriptor, labe return nil } func (n *RuntimeGoNakamaModule) StreamSendRaw(mode uint8, subject, descriptor, label string, msg *rtapi.Envelope) error { stream := PresenceStream{ Mode: mode, Label: label, } var err error if subject != "" { stream.Subject, err = uuid.FromString(subject) if err != nil { return errors.New("stream subject must be a valid identifier") } } if descriptor != "" { stream.Descriptor, err = uuid.FromString(descriptor) if err != nil { return errors.New("stream descriptor must be a valid identifier") } } if msg == nil { return errors.New("expects a valid message") } n.router.SendToStream(n.logger, stream, msg) return nil } func (n *RuntimeGoNakamaModule) MatchCreate(ctx context.Context, module string, params map[string]interface{}) (string, error) { if module == "" { return "", errors.New("expects module name") Loading Loading
runtime/runtime.go +1 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,7 @@ type NakamaModule interface { StreamCount(mode uint8, subject, descriptor, label string) (int, error) StreamClose(mode uint8, subject, descriptor, label string) error StreamSend(mode uint8, subject, descriptor, label, data string) error StreamSendRaw(mode uint8, subject, descriptor, label string, msg *rtapi.Envelope) error MatchCreate(ctx context.Context, module string, params map[string]interface{}) (string, error) MatchList(ctx context.Context, limit int, authoritative bool, label string, minSize, maxSize int, query string) ([]*api.Match, error) Loading
server/runtime_go_nakama.go +27 −0 Original line number Diff line number Diff line Loading @@ -627,6 +627,33 @@ func (n *RuntimeGoNakamaModule) StreamSend(mode uint8, subject, descriptor, labe return nil } func (n *RuntimeGoNakamaModule) StreamSendRaw(mode uint8, subject, descriptor, label string, msg *rtapi.Envelope) error { stream := PresenceStream{ Mode: mode, Label: label, } var err error if subject != "" { stream.Subject, err = uuid.FromString(subject) if err != nil { return errors.New("stream subject must be a valid identifier") } } if descriptor != "" { stream.Descriptor, err = uuid.FromString(descriptor) if err != nil { return errors.New("stream descriptor must be a valid identifier") } } if msg == nil { return errors.New("expects a valid message") } n.router.SendToStream(n.logger, stream, msg) return nil } func (n *RuntimeGoNakamaModule) MatchCreate(ctx context.Context, module string, params map[string]interface{}) (string, error) { if module == "" { return "", errors.New("expects module name") Loading