Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     //Get network view
     _lockStepManager         = GetComponent <LockStepManager>();
     _networkInterface        = GetComponent <NetworkInterface>();
     _buttonOfPlayersSelected = _numberOfPlayers - 1;
 }
Esempio n. 2
0
    void Start()
    {
        test = GameObject.Find("LockstepManager").GetComponent <LockStepManager>();
        List <byte> data = SerializationCtrl.Serialize(new byte[10000]);

        testArr = data.ToArray();
    }
Esempio n. 3
0
 //Initialize all the arrays
 public PendingActions(LockStepManager lsm)
 {
     this._lockStepManager = lsm;
     currentActions        = new Dictionary <int, Action>();
     _nextActions          = new Dictionary <int, Action>();
     _nextNextActions      = new Dictionary <int, Action>();
     _nextNextNextActions  = new Dictionary <int, Action>();
 }
 public void Init(int clientId, GameObject clientAssets)
 {
     this.ID             = clientId;
     this.m_clientAssets = clientAssets;
     LoadClientAssets();
     InitReadyBtn();
     this.m_lockStepManager = new LockStepManager();
 }
    public ConfirmedActions(LockStepManager lsm)
    {
        this._lockStepManager = lsm;
        _confirmedCurrent     = new Dictionary <int, bool>();
        _confirmedPrior       = new Dictionary <int, bool>();

        _currentSW = new Stopwatch();
        _priorSW   = new Stopwatch();
    }
    // Use this for initialization
    void Start()
    {
        enabled = false;

        Instance       = this;
        nv             = GetComponent <NetworkView>();
        networkManager = FindObjectOfType(typeof(NetworkManager)) as NetworkManager;

        networkManager.OnGameStart += PrepGameStart;
    }
Esempio n. 7
0
    void Start()

    {
        MessageReceived += ServiceLocator.GetService <NetworkingManager>().DecodeServerMessage;
        clients          = new List <ServerClient>();
        ClientAccepted  += SendMessage;
        _lockStepManager = gameObject.AddComponent <LockStepManager>();
        //OnAllPlayersConnected += SendTestMsg;
        AllPlayersConnected      += _lockStepManager.StartGame;
        LockStepManager.NextTurn += incTurns;
        RunServer();
    }
Esempio n. 8
0
    public PendingActions(LockStepManager lsm)
    {
        this.lsm = lsm;

        CurrentActions      = new IAction[lsm.numberOfPlayers];
        NextActions         = new IAction[lsm.numberOfPlayers];
        NextNextActions     = new IAction[lsm.numberOfPlayers];
        NextNextNextActions = new IAction[lsm.numberOfPlayers];

        currentActionsCount      = 0;
        nextActionsCount         = 0;
        nextNextActionsCount     = 0;
        nextNextNextActionsCount = 0;
    }
Esempio n. 9
0
    public PendingActions(LockStepManager lsm)
    {
        this.lsm = lsm;

        CurrentActions = new Action[lsm.numberOfPlayers];
        NextActions = new Action[lsm.numberOfPlayers];
        NextNextActions = new Action[lsm.numberOfPlayers];
        NextNextNextActions = new Action[lsm.numberOfPlayers];

        currentActionsCount = 0;
        nextActionsCount = 0;
        nextNextActionsCount = 0;
        nextNextNextActionsCount = 0;
    }
Esempio n. 10
0
    public ConfirmedActions(LockStepManager lsm)
    {
        this.lsm         = lsm;
        confirmedCurrent = new bool[lsm.numberOfPlayers];
        confirmedPrior   = new bool[lsm.numberOfPlayers];

        ResetArray(confirmedCurrent);
        ResetArray(confirmedPrior);

        confirmedCurrentCount = 0;
        confirmedPriorCount   = 0;

        currentSW = new Stopwatch();
        priorSW   = new Stopwatch();
    }
Esempio n. 11
0
        public PendingCommnads()
        {
            _lockStepManager = LockStepManager.Instance;


            CurrentCommands       = new Command[_lockStepManager.NumberOfPlayers];
            _nextCommands         = new Command[_lockStepManager.NumberOfPlayers];
            _nextNextCommands     = new Command[_lockStepManager.NumberOfPlayers];
            _nextNextNextCommands = new Command[_lockStepManager.NumberOfPlayers];

            _currentCommandsCount      = 0;
            _nextCommandsCount         = 0;
            _nextNextCommandsCount     = 0;
            _nextNextNextCommandsCount = 0;
        }
Esempio n. 12
0
    public ConfirmedActions(LockStepManager lsm)
    {
        this.lsm = lsm;
        confirmedCurrent = new bool[lsm.numberOfPlayers];
        confirmedPrior = new bool[lsm.numberOfPlayers];

        ResetArray(confirmedCurrent);
        ResetArray (confirmedPrior);

        confirmedCurrentCount = 0;
        confirmedPriorCount = 0;

        currentSW = new Stopwatch();
        priorSW = new Stopwatch();
    }
Esempio n. 13
0
        public void OnReceive(LockStepManager mngr)
        {
            mngr.PrintDebug(DebugLevel.DATA_ONLY, "RpcNetworkData msgObj={0}", msgObj);
            try
            {
                string nameObject    = msgObj.gameObjName;
                string nameComponent = msgObj.componentName;
                string nameMethod    = msgObj.methodName;

                GameObject obj       = GameObject.Find(nameObject);
                Component  component = obj.GetComponent(nameComponent);
                System.Reflection.MethodInfo method = component.GetType().GetMethod(nameMethod);
                method.Invoke(component, msgObj.parameters);
            }
            catch (System.Exception e)
            {
                mngr.ReactToError("Caught Exception during RPC invocation. Exception={0}", e);
            }
        }
Esempio n. 14
0
    // Use this for initialization
    void Start()
    {
        _networkViewComponent = GetComponent <NetworkView>();
        if (_networkViewComponent == null)
        {
            Debug.Log("Fatal error : didn't find NetworkView");
        }

        _lockStepManager = GetComponent <LockStepManager>();
        if (_lockStepManager == null)
        {
            Debug.Log("Fatal error : didn't find LockStepManager");
        }

        _connectionManager = GetComponent <ConnectionManager>();
        if (_connectionManager == null)
        {
            Debug.Log("Fatal error : didn't find ConnectionManager");
        }
    }
Esempio n. 15
0
    // Use this for initialization
    void Start()
    {
        enabled = false;

        Instance = this;
        nv = GetComponent<NetworkView>();
        gameSetup = FindObjectOfType(typeof(NetworkManager)) as NetworkManager;

        gameSetup.OnGameStart += PrepGameStart;
    }
Esempio n. 16
0
 void Start()
 {
     enabled  = false;
     Instance = this;
 }
Esempio n. 17
0
 public ConfirmedActions(LockStepManager lsm)
 {
     this.lsm = lsm;
     playersConfirmedCurrentAction = new List<NetworkPlayer>(lsm.numberOfPlayers);
     playersConfirmedPriorAction = new List<NetworkPlayer>(lsm.numberOfPlayers);
 }
Esempio n. 18
0
 public void OnReceive(LockStepManager mngr)
 {
     mngr.PrintDebug(DebugLevel.DATA_ONLY, "RawNetworkData rawArr={0}", rawArr);
     mngr.TriggerRawDataCallbacks(rawArr);
 }
Esempio n. 19
0
 public void Init()
 {
     m_lockStepManager = new LockStepManager(this);
     VirtualManager.Instance.ConnectToServer(ID);
 }
 public ConfirmedActions(LockStepManager lsm)
 {
     this.lsm = lsm;
     playersConfirmedCurrentAction = new List <NetworkPlayer>(lsm.numberOfPlayers);
     playersConfirmedPriorAction   = new List <NetworkPlayer>(lsm.numberOfPlayers);
 }
 public ConfirmedActions(LockStepManager lsm)
 {
     this.lsm = lsm;
 }
Esempio n. 22
0
 public void OnReceive(LockStepManager mngr)
 {
     mngr.PrintDebug(DebugLevel.DATA_ONLY, "EventNetworkData eventObj={0}", eventObj);
     CustomEventSystem.EventManager.Instance.HandleEvent(eventObj);
 }