Exemplo n.º 1
0
        public void SendEffectVotingToGame(bool undetermined = true)
        {
            if (effectVoting.IsEmpty())
            {
                return;
            }

            effectVoting.GetVotes(out string[] effects, out int[] votes, undetermined);

            string voteString = $"votes:{effects[0]};{votes[0]};;{effects[1]};{votes[1]};;{effects[2]};{votes[2]};;{lastChoice}";

            ProcessHooker.SendPipeMessage(voteString);
        }
Exemplo n.º 2
0
        public static bool Read <T>(IntPtr lpBaseAddress, out T value) where T : struct
        {
            if (ProcessHooker.HasExited())
            {
                value = default;
                return(false);
            }

            T[] buffer = new T[Marshal.SizeOf <T>()];
            ReadProcessMemory(ProcessHooker.GetHandle(), lpBaseAddress, buffer, Marshal.SizeOf <T>(), out var _);

            value = buffer.FirstOrDefault();
            return(true);
        }
Exemplo n.º 3
0
        public void SendEffectVotingToGame(bool undetermined = true)
        {
            if (effectVoting.IsEmpty())
            {
                return;
            }

            effectVoting.GetVotes(out string[] effects, out int[] votes, undetermined);

            if (Shared.Multiplayer != null)
            {
                Shared.Multiplayer.SendVotes(effects, votes, lastChoice, !undetermined);
            }
            else
            {
                string voteString = $"votes:{effects[0]};{votes[0]};;{effects[1]};{votes[1]};;{effects[2]};{votes[2]};;{lastChoice}";
                ProcessHooker.SendPipeMessage(voteString);
            }
        }