Beispiel #1
0
        private static IEnumerator UpdateUsername(NetworkUser userToUpdate, NetworkUserId realId)
        {
            yield return(new WaitForSeconds(1));

            userToUpdate.Network_id = realId;
            userToUpdate.SetDirtyBit(1u);
        }
Beispiel #2
0
        private static void SyncNetworkUserVarTest(NetworkUser currentNetworkUser)
        {
            var tmp = currentNetworkUser.Network_id;
            var nid = NetworkUserId.FromIp("000.000.000.1", 255);

            currentNetworkUser.Network_id = nid;
            currentNetworkUser.SetDirtyBit(1u);
            PluginEntry.Instance.StartCoroutine(UpdateUsernameDelayed(currentNetworkUser, tmp));
        }
Beispiel #3
0
        private static void SyncNetworkUserVarTest(NetworkUser currentNetworkUser, bool shouldPrefixId)
        {
            if (shouldPrefixId)
            {
                var networkIndex = Util.Networking.GetPlayerIndexFromNetworkUser(currentNetworkUser);
                currentNetworkUser.userName = $"[{networkIndex}] {currentNetworkUser.userName}";
            }
            var tmp = currentNetworkUser.Network_id;
            var nid = NetworkUserId.FromIp("000.000.000.1", 255);

            currentNetworkUser.Network_id = nid;
            currentNetworkUser.SetDirtyBit(1u);
            //UpdateUsername(currentNetworkUser, tmp);
            PluginEntry.Instance.StartCoroutine(UpdateUsername(currentNetworkUser, tmp));
        }