Renegade Public Forums
C&C: Renegade -- Dead since 2012!™
Home » Renegade Discussions » Mod Release Forum » [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin
[SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492581] Wed, 11 October 2017 13:17 Go to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Slap this plugin in your server and start with your NSA practices. This plugin will enable ALL plugins to receive private chat messages in the OnChat event.

It comes with settings in SSGM.ini/da.ini:
[PrivateChatHookPlugin]
ShowPrivateChatInConsole=1
LogEveryone=1
ChatEventAddress=0
ChatHookEventVectorAddress=0
VanillaHasPrivateChatCheck=0

ChatEventAddress, ChatHookEventVectorAddress and VanillaHasPrivateChatCheck should not be added or set to anything other than 0 in ssgm.ini/da.ini unless you know what you're doing.

Set ShowPrivateChatInConsole to true to let it output the private chat to the console via this format:
SenderPlayerName -> ReceiverPlayerName: Message

Set LogEveryone to true to log everyone, else log everybody flagged with the PCH command, see below:

New console commands:
PCHALL - Prints all names for players currently being logged
PCHADD <clientId> - Enables private chat logging for client
PCHREMOVE <clientId> - Disables private chat logging for client

This plugin will also log the private messages in the SSGM log with almost the same format as the normal chat log: CHAT;PRIVATE;SenderPlayerObjId;ReceiverPlayerObjId;Message

WARNING:
This plugin uses function hooking and variable hooking. I cannot guarantee that it will still work when a new update of TT comes along. So only use this specific version mentioned in this post/title

SOURCE: https://github.com/Neijwiert/C-C-Renegade-PrivateChatHookPlugin

EDIT: Also compatible with Dragonade of that specific version. Will not do the SSGM Log if Dragonade is running

EDIT 2: Now compatible with stock/vanilla 4.3/4.4/4.5 and DA 1.9/1.92

EDIT 3: Now compatible with stock/vanilla 4.2.4 and DA 1.8.1

[Updated on: Wed, 18 October 2017 07:30]

Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492582] Thu, 12 October 2017 08:07 Go to previous messageGo to next message
PGS-PC  
Messages: 14
Registered: September 2011
Recruit
From: 140.114.185*
Doesn't work with DA. Only shows when you PM yourself and not others.
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492583] Thu, 12 October 2017 11:22 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: 143.179.81*
PGS-PC wrote on Thu, 12 October 2017 08:07

Doesn't work with DA. Only shows when you PM yourself and not others.


Hmm I need someone to test this with then. Admitted, I did only test this while pming myself. i assumed that to others would work as well.
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492584] Thu, 12 October 2017 14:30 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Ok I now see what's going on. Without Dragonade this plugin works just fine. Apparently Dragonade does some stuff with the messaging in da.dll. Need to hook that shit too in case of dragonade and then call the dragonade chat event i guess?
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492585] Thu, 12 October 2017 15:08 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Well I know how to 'fix' it, correct me if I'm wrong, but seeing the source code of Dragonade kind of tells me that all legacy SSGM plugins already receive private messages in the OnChat event when Dragonade is running. So you'd only need this plugin when Dragonade is not running on the server and you want to see private chat.

EDIT: Ignore what I've said it doesn't...

 if ( receiverPlayerClass && (PlayerID != receiverID_1 || (unsigned __int8)DAEventManager::Chat_Event(v5, 2, v15, receiverID_1)) )


I will make the fix...

[Updated on: Thu, 12 October 2017 15:13]

Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492586] Fri, 13 October 2017 04:50 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Ok so here's the thing. I updated it to work with both SSGM and Dragonade at the same time. It will detect Dragonade and will then perform the appropriate steps. But the funny thing is I discovered this weird 'glitch' where in normal 'vanilla' fds it would output the private message twice. Well turns out this isn't a glitch and vanilla fds 4.5 just puts all private messages through.

@JonWil I don't know if this is a mistake on your side, but if it is, you should take a look at the function at address 0x1217D3D0 at the bottom. You forgot to check if the message type is of type TEXT_MESSAGE_PRIVATE

I updated the dll, re-download if you had the previous version. Still update even though you didn't use Dragonade. I also fixed some bugs.

EDIT:
In fact I'm pretty sure its a mistake. SSGM can't even handle private chat:

SSGMGameLog::Log_Gamelog("CHAT;%s;%d;%ls", type, Commands->Get_ID(player), Message);

Where type = char type[8];
It is never initialized, so this is a serious bug.

[Updated on: Fri, 13 October 2017 05:20]

Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492587] Fri, 13 October 2017 06:36 Go to previous messageGo to next message
jonwil  is currently offline jonwil  
Messages: 3529
Registered: February 2003
General (3 Stars)

From: *tpgi.com.au
Because our build infrastructure and symbol server is down, I have no way to know what function that address matches to so I cant see what its doing, why its doing it or who made it do what its doing.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492588] Fri, 13 October 2017 06:40 Go to previous messageGo to next message
jonwil  is currently offline jonwil  
Messages: 3529
Registered: February 2003
General (3 Stars)

From: *tpgi.com.au
Actually after checking the chat hook code a bit, it looks like it was WhiteDragon who was responsible for removing the private message check although I have no clue why he did it (it happened as part of his work to make all those hooks support multiple instances and its unclear if it was intentional or if it was unintentional)


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492589] Fri, 13 October 2017 08:51 Go to previous messageGo to next message
Gen_Blacky  is currently offline Gen_Blacky  
Messages: 3233
Registered: September 2006
General (3 Stars)
From: *cpe.cableone.net
Pretty sure it was intentional. I never asked him about it but don't think he liked people being able to see private messages. Private chat would only trigger pm to ones self and the Host.


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492591] Fri, 13 October 2017 10:05 Go to previous messageGo to next message
Jerad Gray  is currently offline Jerad Gray  
Messages: 3738
Registered: July 2006
Location: USA
General (3 Stars)
From: 199.167.204*
Personally I was never a fan of it either when you could spy on people's private messages.


Head Level editor and coder of ECW/Rp2. #2142::COOL#
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492594] Fri, 13 October 2017 10:57 Go to previous messageGo to next message
shaitan  is currently offline shaitan  
Messages: 720
Registered: April 2005
Location: Pennsylvania
Colonel

From: *hfc.comcastbusiness.net
It was removed this whole time because of that reasoning? That makes sense now, prior to DA we were able to turn that on or off. If you remember Blacky, you had your own working brenbot version you'd added too.

That was always a moderator tool that in extreme circumstances came in handy. There's PM abuse that goes on and unless someone has their own proof...we can't deal with it. There's been shitloads of times that would've come in handy to turn on for 2 players.

Are any of you able to bypass that particular section so it works again?


Aircraftkiller wrote on Sun, 18 Jan 2004 07:38

I get along with people fine, so long as they aren't rejects who promised things that they couldn't
deliver on, or forum trolls who contribute nothing except to bloat the fragile egos of the same
rejects I despise.

Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492595] Fri, 13 October 2017 12:11 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: 143.179.81*
Either way something needs to be done. SSGM cant handle the private chat and it probably reads beyond the buffer. It is really weird that Dragonade is less free in capabilities than vanilla imo. So what is it going to be now allowed or not allowed?
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492597] Fri, 13 October 2017 12:25 Go to previous messageGo to next message
shaitan  is currently offline shaitan  
Messages: 720
Registered: April 2005
Location: Pennsylvania
Colonel

From: 107.77.253*
Right now the whole thing is moot, rencorner DA is on 4.3 scripts still.
Yes, I'd like to be able to have that as a functionality.
It can be done different ways at showing up: logs, console, secret channel, turn on/off per players as I mentioned.


Aircraftkiller wrote on Sun, 18 Jan 2004 07:38

I get along with people fine, so long as they aren't rejects who promised things that they couldn't
deliver on, or forum trolls who contribute nothing except to bloat the fragile egos of the same
rejects I despise.

Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492598] Fri, 13 October 2017 13:26 Go to previous messageGo to next message
dblaney1  is currently offline dblaney1  
Messages: 340
Registered: March 2014
Location: United States
Recruit
From: 130.156.81*
I think blacky updated your da to 4.5 actually. I ported DA to 4.5.
Re: [SSGM 4.5 Plugin] PrivateChatHookPlugin [message #492599] Fri, 13 October 2017 13:32 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Updated plugin. It now does version checking. Compatible with stock/vanilla 4.3/4.4/4.5 and DA 1.9/1.92

Added new option in SSGM.ini/da.ini
LogEveryone = 1

Set LogEveryone to true to log everyone, else log everybody flagged with the PCH command, see below:

New console command PCH <clientId> - Enables or disables private chat logging for client (ignored when LogEveryone is set to 1)

Redownload to take effect, obviously...
Re: [SSGM 4.3/4.4/4.5 | DA 1.9/1.92 Plugin] PrivateChatHookPlugin [message #492600] Fri, 13 October 2017 16:06 Go to previous messageGo to next message
shaitan  is currently offline shaitan  
Messages: 720
Registered: April 2005
Location: Pennsylvania
Colonel

From: *hsd1.pa.comcast.net
That sneaky bugger, I'd made a copy of it last week for testing, it was 4.3.


Aircraftkiller wrote on Sun, 18 Jan 2004 07:38

I get along with people fine, so long as they aren't rejects who promised things that they couldn't
deliver on, or forum trolls who contribute nothing except to bloat the fragile egos of the same
rejects I despise.

Re: [SSGM 4.3/4.4/4.5 | DA 1.9/1.92 Plugin] PrivateChatHookPlugin [message #492602] Fri, 13 October 2017 17:30 Go to previous messageGo to next message
Gen_Blacky  is currently offline Gen_Blacky  
Messages: 3233
Registered: September 2006
General (3 Stars)
From: *bois.qwest.net
Yea I did. I posted a changelog guess you didn't even read that Angry.

If you throw this on the server all the old private chat logging and commands should work without changing anything.


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492603] Sat, 14 October 2017 11:20 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Previous version was completely broken and I somehow did not notice that in my tests. Updates plugin to work correctly with version checking and it is now compatible with vanilla/stock TT 4.2.4 and Dragonade 1.8.1.

Also added 2 new ini settings: ChatEventAddress and ChatHookEventVectorAddress.
Do not add these to your ini or set them to anything other than 0 unless you know what you're doing.

Also added functionality to PCH command: pch all. Will print out all players currently being logged when used with pch <playerId>.

@JonWil it seems that the transition from TT v4.2.4 to 4.3 removed the TEXT_MESSAGE_PRIVATE check.

Redownload in original post.

EDIT: Ignore last minute bug found. Download removed until fixed, don't have time now.

EDIT 2: Fixed.

[Updated on: Sat, 14 October 2017 11:39]

Re: [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492605] Sun, 15 October 2017 05:39 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Another update that does not affect anything for the people that didn't use ChatEventAddress and ChatHookEventVectorAddress. I made it more reliable for the address checking.

Added another variable: VanillaHasPrivateChatCheck. Also should not be added to ssgm.ini/da.ini or always set to 0 if you don't know what you're doing.
Re: [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492606] Sun, 15 October 2017 10:47 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Updated plugin:

Split the console command into 3 separate commands:
PCHALL - Prints all names for players currently being logged
PCHADD <clientId> - Enables private chat logging for client
PCHREMOVE <clientId> - Disables private chat logging for client

And made source available. see original post.
Re: [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492607] Tue, 17 October 2017 15:20 Go to previous messageGo to next message
shaitan  is currently offline shaitan  
Messages: 720
Registered: April 2005
Location: Pennsylvania
Colonel

From: *hsd1.pa.comcast.net
[17:06:21] PrivateChatHookPlugin: Failed to version check

I only see that in the renlog, nothing shows in the console with pages. It shows the people in the pchall, you can add/remove, but that's it.
Current settings: [PrivateChatHookPlugin]
ShowPrivateChatInConsole=1
LogEveryone=1

I've tried setting it to 0 and 1, same thing of not showing pages. It's in ssgm.ini, da.ini and our other just to see if any would work.
It's your latest download link in the top post.

[Updated on: Tue, 17 October 2017 15:21]


Aircraftkiller wrote on Sun, 18 Jan 2004 07:38

I get along with people fine, so long as they aren't rejects who promised things that they couldn't
deliver on, or forum trolls who contribute nothing except to bloat the fragile egos of the same
rejects I despise.

Re: [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492608] Tue, 17 October 2017 15:26 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: 143.179.123*
Are you running a custom build for scrips.dll? For either stock or dragonade? If so then obviously it fails to version check. You need to manually enter the address.
Re: [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492609] Wed, 18 October 2017 07:41 Go to previous messageGo to next message
Neijwiert  is currently offline Neijwiert  
Messages: 121
Registered: October 2009
Recruit
From: *direct-adsl.nl
Some information when you are running a custom Scripts.dll for either Stock or Dragonade:

You will need to manually enter the address in ssgm.ini/da.ini for the ChatHookEventVectorAddress variable.

How do I get this address if I don't have any knowledge about reverse engineering:

- Stock
Add these lines anywhere in SSGMGameManager::Init
DWORD_PTR moduleBase = reinterpret_cast<DWORD_PTR>(GetModuleHandleW(NULL));
DWORD_PTR registeredEventsEventChatHookCountOffset = reinterpret_cast<DWORD_PTR>(&(RegisteredEvents[EVENT_CHAT_HOOK])) - moduleBase;
Console_Output("Chat Event Hook Address: %d\n", static_cast<int>(registeredEventsEventChatHookCountOffset));


- Dragonade
Add these lines anywhere in DAEventManager::Init
DWORD_PTR moduleBase = reinterpret_cast<DWORD_PTR>(GetModuleHandleW(NULL));
DWORD_PTR registeredEventsEventChatHookCountOffset = reinterpret_cast<DWORD_PTR>(&(Events[DAEvent::CHAT])) - moduleBase;
Console_Output("Chat Event Hook Address: %d\n", static_cast<int>(registeredEventsEventChatHookCountOffset));


Whatever it outputs put it in ssgm.ini/da.ini at ChatHookEventVectorAddress

Now last step: If you're running an older version than TT 4.3 (so not including 4.3) and you're NOT running Dragonade set VanillaHasPrivateChatCheck=1 in ssgm.ini

Redownload latest file, I fixed an issue with it not using the address specified in ssgm.ini/da.ini
Re: [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492610] Thu, 19 October 2017 14:23 Go to previous messageGo to next message
Gen_Blacky  is currently offline Gen_Blacky  
Messages: 3233
Registered: September 2006
General (3 Stars)
From: *bois.qwest.net
@Shai
You should of not of gotten that message it should be using the scripts.dll from dblaney1 port of 4.5 to Dragonade DA 1.9.2.

http://www.renegadeforums.com/index.php?t=msg&th=41164&start=0&

I might of accidentally put a test build I guess.

We had WD tests builds on there but those should of been removed.

@Neijwiert
Very good. When I get a chance I'm going to make a Brenbot support plugin for this.


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: [SSGM 4.2.4/4.3/4.4/4.5 | DA 1.8.1/1.9/1.92 Plugin] PrivateChatHookPlugin [message #492622] Sat, 28 October 2017 00:41 Go to previous messageGo to previous message
Gen_Blacky  is currently offline Gen_Blacky  
Messages: 3233
Registered: September 2006
General (3 Stars)
From: *bois.qwest.net
For those that use brenbot here is a support plugin. I made sure it was compatible with brenbot 1.53.
Throw this in the brenbot plugins folder. And use !plugin_load PrivateChatHookPlugin in the admin channel.

Used to only log private messages that mods have a reason to monitor.
This plugin will remember players added with the !pch command and stores them in a database. Matches name or ip on join.
Outputs private messages to irc admin channel or private channel.

Usage !pch <command> <player> | ALL, ADD, REMOVE, DEL, LIST
Command ALL capture renlog output of PCHALL
Command ADD add ingame player to database and use PCHADD
Command REMOVE del ingame player from database and use PCREMOVE
Command DEL is used to delete a player from the database.
Command LIST is used to list everyone in the database

Intended to be used with LogEveryone off.
[PrivateChatHookPlugin]
ShowPrivateChatInConsole=0
LogEveryone=0
ChatEventAddress=0
ChatHookEventVectorAddress=0
VanillaHasPrivateChatCheck=0

@Neijwiert
It would be better if you sent the player id instead of the object id in the CHAT gamelog. At least the way that brenbot 1.53 works, If the bot started while the server is running the bot will not know about an existing player object id until they die.

[Updated on: Sat, 28 October 2017 01:16]


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Previous Topic:Singleplayer scripts
Next Topic:Dragonade 1.92 for Scripts 4.5
Goto Forum:
  


Current Time: Sun Dec 17 14:19:51 MST 2017
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7RC2.
Copyright ©2001-2007 FUD Forum Bulletin Board Software