grpcserver

package
v0.0.0-...-c1868ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOnlineTimeout = 30
	StatusAwayTimeout   = 60
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectedPlayer

type ConnectedPlayer struct {

	//Party details
	PartyDetails *PartyStats

	//NotificationStreams
	NotificationStream chan *ssp_grpc.PlayerNotification
	// contains filtered or unexported fields
}

type PartyStats

type PartyStats struct {
	PartyCode string
	Leader    bool
}

type Server

type Server struct {
	ssp_grpc.SuperServeServer

	//DBs
	MongoDB mongo.MongoDBClient
	RedisDB redis.RedisCacheClient

	//Services
	PlayerService services.PlayerInterface
	FriendService services.FriendInterface
	PartyService  services.PartyInterface
	// contains filtered or unexported fields
}

func ReturnGrpcServer

func ReturnGrpcServer(sd *servermodels.ServerDependencies) (*Server, error)

func (*Server) AcceptInvitation

func (grpc *Server) AcceptInvitation(ctx context.Context, connectedPlayer *ConnectedPlayer, req *ssp_grpc.PartyNotification) (*ssp_grpc.GenericServerResponse, error)

func (*Server) CreateParty

func (grpc *Server) CreateParty(ctx context.Context, connectedPlayer *ConnectedPlayer) (*ssp_grpc.PartyCreationResponse, error)

func (*Server) HandlePartyNotification

func (grpc *Server) HandlePartyNotification(ctx context.Context, connectedPlayer *ConnectedPlayer, req *ssp_grpc.PartyNotification, statusChan chan string) (*ssp_grpc.GenericServerResponse, error)

func (*Server) KickFromParty

func (grpc *Server) KickFromParty(ctx context.Context, connectedPlayer *ConnectedPlayer, req *ssp_grpc.PartyNotification) (*ssp_grpc.GenericServerResponse, error)

func (*Server) LeaveParty

func (grpc *Server) LeaveParty(ctx context.Context, connectedPlayer *ConnectedPlayer, req *ssp_grpc.PartyNotification) (*ssp_grpc.GenericServerResponse, error)

func (*Server) Notifications

func (grpc *Server) Notifications(ctx context.Context, connectedPlayer *ConnectedPlayer, notifications chan *ssp_grpc.Response_PlayerNotification) error

func (*Server) PlayerConnect

func (grpc *Server) PlayerConnect(ctx context.Context, playerID string, read chan string, closeConn chan struct{}) error

func (*Server) SendInvitation

func (grpc *Server) SendInvitation(ctx context.Context, connectedPlayer *ConnectedPlayer, req *ssp_grpc.PartyNotification) (*ssp_grpc.GenericServerResponse, error)

func (*Server) Session

func (grpc *Server) Session(stream ssp_grpc.SuperServe_SessionServer) error

func (*Server) ValidateAndAuthorizePlayer

func (grpc *Server) ValidateAndAuthorizePlayer(ctx context.Context, playerID string) error

type Session

type Session struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL