Exemplo n.º 1
0
 // Token: 0x0600106F RID: 4207 RVA: 0x00048404 File Offset: 0x00046604
 static PreGameRuleVoteController()
 {
     PreGameController.onServerRecalculatedModifierAvailability += delegate(PreGameController controller)
     {
         PreGameRuleVoteController.UpdateGameVotes();
     };
 }
Exemplo n.º 2
0
        // Token: 0x06001059 RID: 4185 RVA: 0x00047C1C File Offset: 0x00045E1C
        public static void CreateForNetworkUserServer(NetworkUser networkUser)
        {
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/NetworkedObjects/PreGameRuleVoteController"));
            PreGameRuleVoteController component = gameObject.GetComponent <PreGameRuleVoteController>();

            component.networkUserNetworkIdentity = networkUser.GetComponent <NetworkIdentity>();
            component.networkUser = networkUser;
            component.localUser   = networkUser.localUser;
            NetworkServer.Spawn(gameObject);
        }
Exemplo n.º 3
0
 // Token: 0x0600105E RID: 4190 RVA: 0x00047CDC File Offset: 0x00045EDC
 private void Start()
 {
     if (this.localUser != null)
     {
         PreGameRuleVoteController.LocalUserBallotPersistenceManager.ApplyPersistentBallotIfPresent(this.localUser, this.votes);
     }
     if (NetworkServer.active)
     {
         PreGameRuleVoteController.UpdateGameVotes();
     }
 }
 // Token: 0x06001347 RID: 4935 RVA: 0x0005E34F File Offset: 0x0005C54F
 private void Start()
 {
     if (RoR2Application.isInSinglePlayer)
     {
         this.SetVotesFromRuleBookForSinglePlayer();
     }
     if (NetworkServer.active)
     {
         PreGameRuleVoteController.UpdateGameVotes();
     }
 }
Exemplo n.º 5
0
 // Token: 0x06001030 RID: 4144 RVA: 0x00047215 File Offset: 0x00045415
 private void GenerateRuleVoteController(NetworkUser networkUser)
 {
     if (NetworkServer.active)
     {
         if (PreGameRuleVoteController.FindForUser(networkUser))
         {
             return;
         }
         PreGameRuleVoteController.CreateForNetworkUserServer(networkUser);
     }
 }
Exemplo n.º 6
0
        public static void ServerHandleClientVoteUpdate(NetworkMessage netMsg)
        {
            string format = "Received vote from {0}";

            object[]    array       = new object[1];
            int         num         = 0;
            NetworkUser networkUser = NetworkUser.readOnlyInstancesList.FirstOrDefault((NetworkUser v) => v.connectionToClient == netMsg.conn);

            array[num] = ((networkUser != null) ? networkUser.userName : null);
            Debug.LogFormat(format, array);
            GameObject gameObject = netMsg.reader.ReadGameObject();

            if (!gameObject)
            {
                Debug.Log("PreGameRuleVoteController.ServerHandleClientVoteUpdate() failed: preGameRuleVoteControllerObject=null");
                return;
            }
            PreGameRuleVoteController component = gameObject.GetComponent <PreGameRuleVoteController>();

            if (!component)
            {
                Debug.Log("PreGameRuleVoteController.ServerHandleClientVoteUpdate() failed: preGameRuleVoteController=null");
                return;
            }
            NetworkIdentity networkUserNetworkIdentity = component.networkUserNetworkIdentity;

            if (!networkUserNetworkIdentity)
            {
                Debug.Log("PreGameRuleVoteController.ServerHandleClientVoteUpdate() failed: No NetworkIdentity");
                return;
            }
            NetworkUser component2 = networkUserNetworkIdentity.GetComponent <NetworkUser>();

            if (!component2)
            {
                Debug.Log("PreGameRuleVoteController.ServerHandleClientVoteUpdate() failed: No NetworkUser");
                return;
            }
            if (component2.connectionToClient != netMsg.conn)
            {
                Debug.LogFormat("PreGameRuleVoteController.ServerHandleClientVoteUpdate() failed: {0}!={1}", new object[]
                {
                    component.connectionToClient,
                    netMsg.conn
                });
                return;
            }
            Debug.LogFormat("Accepting vote from {0}", new object[]
            {
                component2.userName
            });
            component.ReadVotes(netMsg.reader);
        }
Exemplo n.º 7
0
 // Token: 0x0600131A RID: 4890 RVA: 0x0005D830 File Offset: 0x0005BA30
 private void GenerateRuleVoteController(NetworkUser networkUser)
 {
     if (NetworkServer.active)
     {
         if (PreGameRuleVoteController.FindForUser(networkUser))
         {
             return;
         }
         GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/NetworkedObjects/PreGameRuleVoteController"), base.transform);
         gameObject.GetComponent <PreGameRuleVoteController>().networkUserNetworkIdentity = networkUser.GetComponent <NetworkIdentity>();
         NetworkServer.Spawn(gameObject);
     }
 }
Exemplo n.º 8
0
 // Token: 0x0600105F RID: 4191 RVA: 0x00047D04 File Offset: 0x00045F04
 private void Update()
 {
     if (NetworkServer.active && !this.networkUserNetworkIdentity)
     {
         UnityEngine.Object.Destroy(base.gameObject);
         return;
     }
     if (this.clientShouldTransmit)
     {
         this.clientShouldTransmit = false;
         this.ClientTransmitVotesToServer();
     }
     if (PreGameRuleVoteController.shouldUpdateGameVotes)
     {
         PreGameRuleVoteController.shouldUpdateGameVotes = false;
         PreGameRuleVoteController.UpdateGameVotes();
     }
 }