Ejemplo n.º 1
0
 public ApianVoteMachine(long timeoutMs, long cleanupMs, UniLogger logger = null)
 {
     TimeoutMs = timeoutMs;
     CleanupMs = cleanupMs;
     Logger    = logger ?? UniLogger.GetLogger("ApianVoteMachine");
     _voteDict = new Dictionary <T, VoteData>();
 }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 public BeamCliFrontend(BeamUserSettings startupSettings)
 {
     _feModeHelper = new BeamCliModeHelper(this);
     feBikes       = new Dictionary <string, FrontendBike>();
     userSettings  = startupSettings;
     logger        = UniLogger.GetLogger("Frontend");
 }
Ejemplo n.º 3
0
 private int MaxSyncCmdsPerUpdate;  //
 public ServerOnlyData(ApianBase apInst, Dictionary <string, string> config)
 {
     Logger       = UniLogger.GetLogger("ApianGroup"); // re-use same logger (put class name in msgs)
     ApianInst    = apInst;
     syncingPeers = new Dictionary <string, SyncingPeerData>();
     _LoadConfig(config);
 }
Ejemplo n.º 4
0
 public virtual void Setup(IBike beBike, IBeamApplication appl, IBeamAppCore core)
 {
     Logger  = UniLogger.GetLogger("Frontend"); // use the FE logger
     appCore = core;
     bb      = beBike;
     CreateControl();
     control.Setup(appl, core, beBike);
 }
Ejemplo n.º 5
0
 //
 // IAppMode
 //
 public void Setup(AppModeManager mgr, IModalApp gInst = null)
 {
     // Called by manager before Start()
     // Not virtual
     manager = mgr;
     appl    = gInst as AceApplication;
     logger  = UniLogger.GetLogger("AceCoreMode");
 }
Ejemplo n.º 6
0
 public BeamApplication(BeamGameNet bgn, IBeamFrontend fe)
 {
     gameNet = bgn;
     gameNet.SetClient(this);
     frontend = fe;
     Logger   = UniLogger.GetLogger("BeamBackendInstance");
     modeMgr  = new ModeManager(new BeamModeFactory(), this);
 }
Ejemplo n.º 7
0
 protected void Init(AceUserSettings settings)
 {
     Logger = UniLogger.GetLogger("CliDriver");
     fe     = new AceCliFrontend(settings);
     gn     = new AceGameNet();
     appl   = new AceApplication(gn, fe);
     appl.Start(settings.startMode);
 }
Ejemplo n.º 8
0
    void Start()       // Monobehavior start
    {
        logger      = UniLogger.GetLogger("GameCamera");
        feMain      = BeamMain.GetInstance();
        _thisCamera = (Camera)GetComponent("Camera");
        ModeNormal mode = (ModeNormal)SetMode(CamModeID.kNormal);

        mode.init(this);
    }
Ejemplo n.º 9
0
 public void Setup(AppModeManager mgr, IModalApp gInst = null)
 {
     // Called by manager before Start()
     // Not virtual
     // TODO: this should be the engine and not the modeMgr - but what IS an engine...
     manager = mgr;
     appl    = gInst as AceApplication;
     logger  = UniLogger.GetLogger("AceGameMode");
 }
Ejemplo n.º 10
0
        protected Dictionary <int, BeamPlace> _reportedTimedOutPlaces; // places that have been reported as timed out, but not removed yet

        public BeamCoreState(IBeamFrontend fep)
        {
            Logger  = UniLogger.GetLogger("GameState");
            Players = new Dictionary <string, BeamPlayer>();
            Bikes   = new Dictionary <string, IBike>();
            Ground  = new Ground();
            InitPlaces();

            _bikeIdsToRemoveAfterLoop = new List <string>();
        }
Ejemplo n.º 11
0
    // Start is called before the first frame update
    void Start()
    {
        userSettings = UserSettingsMgr.Load(kSettingsFileBaseName);
        //userSettings = BeamUserSettings.CreateDefault();
        userSettings.localPlayerCtrlType = BikeFactory.LocalPlayerCtrl; // Kinda hackly

        mainObj       = BeamMain.GetInstance();
        _feModeHelper = new BeamFeModeHelper(mainObj);
        feBikes       = new Dictionary <string, GameObject>();
        logger        = UniLogger.GetLogger("Frontend");
    }
Ejemplo n.º 12
0
 void UpdateValues()
 {
     foreach (LevelEntry le in levelEntries)
     {
         if ((le.LoggerName.Length > 0))
         {
             UniLogger.GetLogger(le.LoggerName).LogLevel     = le.level;
             UniLogger.GetLogger(le.LoggerName).ThrowOnError = throwOnError;
         }
     }
 }
Ejemplo n.º 13
0
        public AceApplication(AceGameNet agn, IAceFrontend fe)
        {
            Logger = UniLogger.GetLogger("AceApplication");
            Logger.Verbose($"Ctor: AceApplication({agn}, {fe})");
            aceGameNet = agn;
            aceGameNet.AddClient(this);
            frontend   = fe;
            appModeMgr = new FsmModeManager(new AceModeFactory(), this);

            frontend.SetAceApplication(this);
        }
Ejemplo n.º 14
0
        public static string GetPath(string leafFolder)
        {
#if UNITY_2019_1_OR_NEWER
            string homePath = Application.persistentDataPath;
#else
            string homePath = (Environment.OSVersion.Platform == PlatformID.Unix ||
                               Environment.OSVersion.Platform == PlatformID.MacOSX)
                        ? Environment.GetEnvironmentVariable("HOME")
                        : Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%");
#endif
            UniLogger.GetLogger("UserSettings").Info($"User settings path: {homePath + Path.DirectorySeparatorChar + leafFolder}");
            return(homePath + Path.DirectorySeparatorChar + leafFolder);
        }
Ejemplo n.º 15
0
 public BaseBike(BeamCoreState gData, string _id, string _peerId, string _name, Team _team, string ctrl, long initialTime, Vector2 initialPos, Heading head)
 {
     gameData     = gData;
     bikeId       = _id;
     peerId       = _peerId;
     name         = _name;
     team         = _team;
     basePosition = initialPos;
     baseTime     = initialTime;
     baseHeading  = head;
     ctrlType     = ctrl;
     score        = kStartScore;
     logger       = UniLogger.GetLogger("BaseBike");
 }
Ejemplo n.º 16
0
        public BeamAppCore(IBeamFrontend fep)
        {
            logger   = UniLogger.GetLogger("GameInstance");
            frontend = fep;
            CoreData = new BeamCoreState(frontend);
            OnNewCoreState();

            commandHandlers = new  Dictionary <string, Action <BeamMessage> >()
            {
                [BeamMessage.kNewPlayer]       = (msg) => OnNewPlayerCmd(msg as NewPlayerMsg),
                [BeamMessage.kPlayerLeft]      = (msg) => OnPlayerLeftCmd(msg as PlayerLeftMsg),
                [BeamMessage.kBikeCreateData]  = (msg) => this.OnCreateBikeCmd(msg as BikeCreateDataMsg),
                [BeamMessage.kRemoveBikeMsg]   = (msg) => this.OnRemoveBikeCmd(msg as RemoveBikeMsg),
                [BeamMessage.kBikeTurnMsg]     = (msg) => this.OnBikeTurnCmd(msg as BikeTurnMsg),
                [BeamMessage.kBikeCommandMsg]  = (msg) => this.OnBikeCommandCmd(msg as BikeCommandMsg),
                [BeamMessage.kPlaceClaimMsg]   = (msg) => this.OnPlaceClaimCmd(msg as PlaceClaimMsg),
                [BeamMessage.kPlaceHitMsg]     = (msg) => this.OnPlaceHitCmd(msg as PlaceHitMsg),
                [BeamMessage.kPlaceRemovedMsg] = (msg) => this.OnPlaceRemovedCmd(msg as PlaceRemovedMsg),
            };
        }
Ejemplo n.º 17
0
        public static AceApian Create(string apianGroupType, IAceGameNet aceGameNet, AceAppCore appCore)
        {
            AceApian result;

            switch (apianGroupType)
            {
            case SinglePeerGroupManager.kGroupType:
                result = new AceApianSinglePeer(aceGameNet, appCore);
                break;

            case CreatorSezGroupManager.kGroupType:
                result = new AceApianCreatorSez(aceGameNet, appCore);
                break;

            default:
                UniLogger.GetLogger("Apian").Warn($"AceApianFactory.Create() Unknown GroupType: {apianGroupType}");
                result = null;
                break;
            }
            return(result);
        }
Ejemplo n.º 18
0
 public BikeControlBase()
 {
     Logger = UniLogger.GetLogger("BikeCtrl");
 }
Ejemplo n.º 19
0
 public ApianGroupManagerBase(ApianBase apianInst)
 {
     Logger    = UniLogger.GetLogger("ApianGroup");
     ApianInst = apianInst;
     Members   = new Dictionary <string, ApianGroupMember>();
 }
Ejemplo n.º 20
0
 public async Task TwoClientsShouldTalk()
 {
     UniLogger.GetLogger("P2pNet").LogLevel = UniLogger.Level.Debug;
     await TestGuts._TwoClientsShouldTalk(clientActiveMqConnectionStr);
 }
Ejemplo n.º 21
0
        protected Queue <Action> loopedBackMessageHandlers; // messages that come from this node (loopbacks) get handled at the end of the loop

        public GameNetBase()
        {
            callbacksForNextPoll      = new Queue <Action>();
            loopedBackMessageHandlers = new Queue <Action>();
            logger = UniLogger.GetLogger("GameNet");
        }
Ejemplo n.º 22
0
 // Start is called before the first frame update
 public AceCliFrontend(AceUserSettings startupSettings)
 {
     userSettings = startupSettings;
     logger       = UniLogger.GetLogger("Frontend");
 }