Jump to content

Recommended Posts

[Mod] Cleaning up chats

 

screenshot_01.png

 

The mod allows GM and HD to delete all messages in players chats (local, world, trade, party, guild, PM, camp). To do this, on the server side for GameServer, the ClearChat(role) lua function is implemented, into which the descriptor of the character controlled by the administrator is passed. Thus, it is possible, for example, to implement a GM command that will clear chats (if there are HandleChat() and GetGmLv() functions present in GameServer.exe).

 

function HandleChat(role, msg)

	if (msg == "&clearchat") then
		
		if (GetGmLv(role) == 99) then
		
			ClearChat(role)
		
		else
		
			SystemNotice(role, "Not enough access!")
		
		end
		
		return 0
		
	end
		
	return 1

end

 

The disadvantage of the mod is that it deletes all chats at once without the ability to specify specific channels. That is, along with the general channels (world, trade, local), the channels with messages to the guild, party, camp and PM will also be cleared.

 

It should also be remembered that the player can remove the .dll mod library from the client and chats will no longer be cleared on command from the server.

 

 

Requirements

 

Installed mod loading system for server and client (PKOdev.NET mod loader).

 

 

Modification information

 

Name: pkodev.mod.clearchat;

Version: 1.0;

Author: V3ct0r;

Type: for client (Game.exe);

Supported executable .exe files: GAME_13X_0, GAME_13X_1, GAME_13X_2, GAME_13X_3, GAME_13X_4, GAME_13X_5.

 

 

Installation

 

Client:

Place the mod DLL file "pkodev.mod.clearchat.client.13x_<ID>.dll" for your version of Game.exe into the "mods" folder of the game client.

 

Server:

1) Create a file named "pkodev.mod.clearchat.lua" in the following server directory:

\GameServer\resource\script\calculate\mods

2) Write the following code into it:

-- Print a log
print("Loading pkodev.mod.clearchat.lua")

-- Clear all chats
function ClearChat(role)
	
	-- Get moderator's name
	local name = GetChaDefaultName(TurnToCha(role))
	
	-- Send system command
	Notice("{system:clearchat}")
	
	-- Send message to all players
	Notice(string.format("Chats have been cleared by moderator [%s]!", name))

end

3) Include the "pkodev.mod.clearchat.lua" file at the beginning of the SkillEffect.lua file (\GameServer\resource\script\calculate) :

dofile(GetResPath("script\\calculate\\mods\\pkodev.mod.clearchat.lua"))

4) Use the ClearChat() function to clear chats as you wish.

 

 

Download

 

1) Binary release (.dll);

2) The source code of the mod for Visual Studio 2019 Community (C++).

 

 

If you encounter any problem, bug or have any questions, then feel free to write in this thread.

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...