Beispiel #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>();
 }
 // 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");
 }
 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);
 }
Beispiel #4
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);
 }
Beispiel #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");
 }
 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);
 }
 public BeamApplication(BeamGameNet bgn, IBeamFrontend fe)
 {
     gameNet = bgn;
     gameNet.SetClient(this);
     frontend = fe;
     Logger   = UniLogger.GetLogger("BeamBackendInstance");
     modeMgr  = new ModeManager(new BeamModeFactory(), this);
 }
Beispiel #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);
    }
Beispiel #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");
 }
Beispiel #10
0
        static void Main(string[] args)
        {
            AceUserSettings settings = GetSettings(args);

            UniLogger.SetupLevels(settings.logLevels);
            CliDriver drv = new CliDriver();

            drv.Run(settings);
        }
Beispiel #11
0
        static void Main(string[] args)
        {
            BeamUserSettings settings = GetSettings(args);

            UniLogger.DefaultLevel = UniLogger.LevelFromName(settings.defaultLogLevel);
            UniLogger.SetupLevels(settings.logLevels);
            CliDriver drv = new CliDriver();

            drv.Run(settings);
        }
Beispiel #12
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>();
        }
Beispiel #13
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");
    }
Beispiel #14
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;
         }
     }
 }
Beispiel #15
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);
        }
        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);
        }
Beispiel #17
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");
 }
Beispiel #18
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),
            };
        }
Beispiel #19
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);
        }
 public BikeControlBase()
 {
     Logger = UniLogger.GetLogger("BikeCtrl");
 }
Beispiel #21
0
 // Start is called before the first frame update
 public AceCliFrontend(AceUserSettings startupSettings)
 {
     userSettings = startupSettings;
     logger       = UniLogger.GetLogger("Frontend");
 }
Beispiel #22
0
 public ApianGroupManagerBase(ApianBase apianInst)
 {
     Logger    = UniLogger.GetLogger("ApianGroup");
     ApianInst = apianInst;
     Members   = new Dictionary <string, ApianGroupMember>();
 }
Beispiel #23
0
 public async Task TwoClientsShouldTalk()
 {
     UniLogger.GetLogger("P2pNet").LogLevel = UniLogger.Level.Debug;
     await TestGuts._TwoClientsShouldTalk(clientActiveMqConnectionStr);
 }
Beispiel #24
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");
        }