public NetworkActorProvider(ActorSystem actorSystem, IUnitOfWork unitOfWork, IHttpService httpService, ILogger <NetworkActorProvider> logger)
        {
            this.logger = logger;

            var actorProps = NetworkActor.Props(unitOfWork, httpService).WithRouter(new RoundRobinPool(5));

            actor = actorSystem.ActorOf(actorProps, "network-actor");
        }
Example #2
0
    public static void RegisterActor(NetworkActor obj)
    {
        var index = obj.actor_id;

        if (index >= Objects.Length)
        {
            var size       = Math.Min(Objects.Length * 2, NetworkActor.MaxId);
            var newObjects = new NetworkActor[size];
            Array.Copy(Objects, newObjects, Objects.Length);
            Objects = newObjects;
        }

        MaxIndex       = Math.Max(MaxIndex, index);
        Objects[index] = obj;
        ++Count;
    }
    public static void RegisterActor(NetworkActor obj)
    {
        var index = obj.actor_id;

        if (index >= Objects.Length)
        {
            var size = Math.Min(Objects.Length * 2, NetworkActor.MaxId);
            var newObjects = new NetworkActor[size];
            Array.Copy(Objects, newObjects, Objects.Length);
            Objects = newObjects;
        }

        MaxIndex = Math.Max(MaxIndex, index);
        Objects[index] = obj;
        ++Count;
    }
Example #4
0
 public static void UnregisterActor(NetworkActor obj)
 {
     Objects[obj.actor_id] = null;
     --Count;
 }
Example #5
0
 public BettingActor(NetworkActor networkActor)
 {
     Rules        = new List <BettingRule>();
     NetworkActor = networkActor;
 }
 public static void UnregisterActor(NetworkActor obj)
 {
     Objects[obj.actor_id] = null;
     --Count;
 }