void Start() { re = GameObject.Find("RoundEvents").GetComponent<RoundEvents>(); if(re == null) { Debug.LogError("Couldn't find RoundEvents!"); } InvokeRepeating("UpdateKills", 0, 1); }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddServerSideBlazor(); services.AddSingleton <WeatherForecastService>(); services.AddSingleton(_ => { var settings = EventStoreClientSettings.Create( "esdb://*****:*****@localhost:2113?tls=false"); settings.DefaultCredentials = new UserCredentials("admin", "changeit"); settings.ConnectionName = "Golf"; var client = new EventStoreClient(settings); return(client); }); services.AddSingleton <IEventStore, EsDbEventStore>(); services.AddSingleton(_ => DefaultEventSerializer.Instance); services.AddSingleton <IAggregateStore, AggregateStore>(); services.AddSingleton <IRoundViewModel, RoundViewModel>(); services.AddSingleton <RoundService>(); RoundEvents.Register(); services.AddSingleton(_ => new MongoClient( "mongodb://*****:*****@localhost:27017/?authSource=admin&readPreference=primary&appname=MongoDB%20Compass&ssl=false") .GetDatabase("Golf")) .AddSingleton <ICheckpointStore, MongoCheckpointStore>(); services.AddSingleton(o => new StatsSubscriber( o.GetService <EventStoreClient>(), "Stats", o.GetService <ICheckpointStore>(), o.GetService <IEventSerializer>(), new IEventHandler[] { new StatsEventHandler(o.GetService <IMongoDatabase>(), "Stats", o.GetService <ILoggerFactory>()) }, o.GetService <ILoggerFactory>() )); services.AddHostedService(o => o.GetService <StatsSubscriber>()); }
public override void OnStartClient(){ base.OnStartClient(); Debug.Log("DictID is " + dictId); nIdentity = GetComponent<NetworkIdentity>(); nm = (PlanetsNetworkManager)NetworkManager.singleton; ppi = PersonalPlayerInfo.singleton; pm = PlayerManager.singleton; rb = GetComponent<Rigidbody>(); invertControls = nm.isSplitScreen(); reflectionMatrix = genRefMatrix(90 * Mathf.Deg2Rad); roundEvents = GameObject.Find("RoundEvents").GetComponent<RoundEvents>(); //Sets reference to RoundEvents object resourcePowerUpManager = GameObject.FindGameObjectWithTag("Planet").GetComponent<ResourcePowerUpManager>(); needsReflection = gameObject.CompareTag("PlayerSuperCorp"); //Debug.Log("Player + " + PlayerManager.singleton.getPlayer(dictId)); if (pm.checkIfExists(dictId)) { playerDetails.setPlayerDetails(dictId, pm.getPlayer(dictId)); } else { playerDetails.setPlayerDetails(dictId, ppi.getPlayer()); } Debug.Log("Setting teardrop id to " + playerDetails.getObsId().ToString()); //BUG tearDropId.text = playerDetails.getObsId().ToString(); }