Audit_Chat

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: Audit_Chat

Post by demolish » Wed Oct 23, 2013 2:36 pm

dunno :P
Attachments
audit_chat(1).patch
(4.63 KiB) Downloaded 197 times
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

User avatar
tagban
Posts: 352
Joined: Fri Dec 28, 2012 11:31 am
Location: Pennsylvania, USA

Re: Audit_Chat

Post by tagban » Wed Oct 23, 2013 2:52 pm

The only other thing that would be awesome to be configurable in that particular source file, would be yell as world chat on/off... But that might be asking too much to be committed. lol I just think its awesome for smaller servers like mine.

I currently have it on mine so maybe.. I dunno, I'll commit your patch, then re-modify the yell as world chat, again, but how hard is it to add something to the config? Just adding the line you used for this?

Currently this is how that is setup:
(packetsystem.cpp)

Code: Select all

                case MESSAGE_YELL:
					{
						if (map_config.audit_chat == 1 && map_config.audit_yell == 1)
							for (uint16 zone = 0; zone < 284; ++zone)
							{
								zoneutils::GetZone(zone)->PushPacket(
									PChar, 
									CHAR_INZONE, 
									new CChatMessagePacket(PChar, MESSAGE_SHOUT, data+6));
							}
					}break;

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: Audit_Chat

Post by demolish » Wed Oct 23, 2013 3:29 pm

Mostly correct but you missed the "{" after the audit check and the "}" for the end.
EDIT: Didn't realise the audit code disappeared
Last edited by demolish on Wed Oct 23, 2013 4:06 pm, edited 1 time in total.
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

User avatar
tagban
Posts: 352
Joined: Fri Dec 28, 2012 11:31 am
Location: Pennsylvania, USA

Re: Audit_Chat

Post by tagban » Wed Oct 23, 2013 3:32 pm

Lol when I did it, I over-wrote the code that tells it to add to audit_chat. I gotta re-do it anyway.

Code: Select all

                case MESSAGE_YELL:
					{
						if (map_config.audit_chat == 1 && map_config.audit_yell == 1)
						{
							std::string qStr = ("INSERT into audit_chat (speaker,type,message,datetime) VALUES('");
							qStr +=PChar->GetName();
							qStr +="','WORLD','";
							qStr += escape(data+6);
							qStr +="',current_timestamp());";
							const char * cC = qStr.c_str();
							Sql_QueryStr(SqlHandle, cC);
						}
						for (uint16 zone = 0; zone < 284; ++zone)
						 {
							zoneutils::GetZone(zone)->PushPacket(
							   PChar, 
							   CHAR_INZONE, 
							   new CChatMessagePacket(PChar, MESSAGE_SHOUT, data+6));
						 }
					
					}break;
Last edited by tagban on Wed Oct 23, 2013 4:00 pm, edited 1 time in total.

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: Audit_Chat

Post by demolish » Wed Oct 23, 2013 3:53 pm

Good point o.o
Didn't notice that haha
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

User avatar
tagban
Posts: 352
Joined: Fri Dec 28, 2012 11:31 am
Location: Pennsylvania, USA

Re: Audit_Chat

Post by tagban » Wed Oct 23, 2013 3:58 pm

Got it. :)

http://bnet.cc/ffxi/chat.php

Thanks!

Code: Select all

<?php
	mysql_connect("ipaddressOfSQL", "sqlUserName", "sqlPassWord") or die(mysql_error());
	mysql_select_db("dspdb") or die(mysql_error());
		$querySay = "SELECT * FROM audit_chat WHERE type = 'SAY' order by lineid desc limit 10";
		$resultSay = mysql_query($querySay) or die(mysql_error());
		
		$queryShout = "SELECT * FROM audit_chat WHERE type = 'SHOUT' order by lineid desc limit 10";
		$resultShout = mysql_query($queryShout) or die(mysql_error());
		
		$queryYell = "SELECT * FROM audit_chat WHERE type = 'WORLD' order by lineid desc limit 10";
		$resultYell = mysql_query($queryYell) or die(mysql_error());
		
		$queryLS = "SELECT * FROM audit_chat WHERE type = 'LINKSHELL' order by lineid desc limit 10";
		$resultLS = mysql_query($queryLS) or die(mysql_error());

		// Show last 10 SAY Chats 
		echo"<b>Say</b><hr>";
		while($row = mysql_fetch_array($resultSay)){
			echo $row['speaker']. " : ". $row['message'];
			echo "<br />";
		}	
		// Show last 10 LINKSHELL Chats 
		echo"<hr><b>Linkshell</b><hr>";
		while($row = mysql_fetch_array($resultLS)){
			echo $row['speaker']. " : ". $row['message'];
			echo "<br />";
		}	
				// Show last 10 WORLD Chats 
		echo"<hr><b>World (/yell)</b><hr>";
		while($row = mysql_fetch_array($resultYell)){
			echo $row['speaker']. " : ". $row['message'];
			echo "<br />";
		}	
				// Show last 10 SHOUT Chats 
		echo"<hr><b>Shout</b><hr>";
		while($row = mysql_fetch_array($resultShout)){
			echo $row['speaker']. " : ". $row['message'];
			echo "<br />";
		}	
?>
I am POSITIVE, there is something more efficient than this to do this, but whatever, it works for now, I just want to make sure that beyond 10 messages, it doesn't keep them. :) Mostly just a proof of concept page. :)

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Audit_Chat

Post by kjLotus » Wed Oct 23, 2013 4:02 pm

not sure if the client lets you /yell outside of the actual /yell zones (jeunos, adoulins, whitegate) but other than that it would be fun. hell, if it does, i'll probably just fix the packet and trunk it

User avatar
tagban
Posts: 352
Joined: Fri Dec 28, 2012 11:31 am
Location: Pennsylvania, USA

Re: Audit_Chat

Post by tagban » Wed Oct 23, 2013 4:07 pm

kjLotus wrote:not sure if the client lets you /yell outside of the actual /yell zones (jeunos, adoulins, whitegate) but other than that it would be fun. hell, if it does, i'll probably just fix the packet and trunk it
It actually does entirely. I'm in SGusta and everyone can see my chat. :)

Join me to try if you want:
ffxi.bnet.cc

Im now looking into adding events to the system, IE: when someone logs onto the server a 'world' announcement "Kjlotus has logged in" or something.. But I'm happy with what I'm messing with right now. :) And not a pro at any of this, so learning as I go/tweak/break stuff.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Audit_Chat

Post by kjLotus » Wed Oct 23, 2013 4:55 pm

ah, sweet

you could make a character named Server, and have the server spoof a packet from that character (assuming the packet needs charid - if not, you just spoof a packet with that name) and hook that into the login function (or char building or whatever)

once i'm done midterms maybe i'll get yell in the trunk haha

User avatar
tagban
Posts: 352
Joined: Fri Dec 28, 2012 11:31 am
Location: Pennsylvania, USA

Re: Audit_Chat

Post by tagban » Wed Oct 23, 2013 5:07 pm

Sounds legit, You should trunk in the Audit_chat settings also. :) Since by default they are off, shouldn't hurt anything.

Post Reply