Пример #1
0
        public static void SendRPC(string raw)
        {
            Logger.Trace($"Sending {raw}");

            if (handler == null)
            {
                Logger.Debug("Canceling RPC because handler is null");
                return;
            }

            if (moderators > 0)
            {
                Logger.Debug("Canceling RPC because a moderator is in your lobby");
                return;
            }

            // my name is zephoria and i don't know what chronological order is
            handler.TriggerEvent(
                new VrcEvent
            {
                EventType       = VrcEventType.SendRPC,
                Name            = "SendRPC",
                ParameterObject = handler.gameObject,
                ParameterInt    = Player.prop_Player_0.field_Private_VRCPlayerApi_0.playerId,
                ParameterFloat  = 0f,
                ParameterString = "UdonSyncRunProgramAsRPC",
                ParameterBoolOp = VrcBooleanOp.Unused,
                ParameterBytes  = Networking.EncodeParameters(new Il2CppSystem.Object[] {
                    raw
                })
            },
                VrcBroadcastType.AlwaysUnbuffered, VRCPlayer.field_Internal_Static_VRCPlayer_0.gameObject, 0f);
        }