AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Cross servers chat (No database) (https://forums.alliedmods.net/showthread.php?t=270475)

Arkarr 08-22-2015 06:36

[ANY] Cross servers chat (No database)
 
40 Attachment(s)

Description :
As the title say, this plugin send the message from your servers to other one !
This plugin also supprot MORECOLORS !
Original request : https://forums.alliedmods.net/showthread.php?t=269627

For the developers who don't know how to use sockets, or a just intersted on how I did that, I wrote this :
https://forums.alliedmods.net/showthread.php?p=2336943


Screenshots & Videos :

http://puu.sh/jKjrE/a06ba32295.PNG
If someone wanna do a video / pictures about this plugin, you can send me the link and I will post it here.

Cvar & installation

Cvar : READ IT PLEASE ! Carefully.

"sm_csc_is_master_server" "0"
Is this server the master chat server ? 1 = yes | 0 = no
Note : ONLY 1 SERVER SHOULD HAVE THIS VALUE TO 1, others should have 0. It doesn't matter wich server have the value 1.

"sm_csc_master_chat_server_ip" "123.467.89.10"
IP of the master chat server, the server who have 'sm_csc_is_master_server' to 1.

"sm_csc_connection_port" "2001"
On wich port should the plugin read & send the messages ? This value should be the same on ALL servers. Also, the port need to be forwarded. CAN NOT ME THE SERVER PORT (usually, 27015)

"sm_csc_message_key" "[PASSWORD]" //Exemple of good password : 786%*ç%)=)&/, you don't need to remember it.
Wich key should the plugin use to send messages, KEEP PRIVATE !!!

"sm_csc_reconnect_time" "45.00"
After how much time a connection should try to reconnect disconnected sockets ?

"sm_csc_server_tag" "[REMOTE MSG]" //Support more colors ! Use {green} or what you prefer !
Tag before messages coming from outside of the actual server

"sm_csc_mark_to_send" "+"
Tag before chat messages to send to all other servers

"sm_csc_admin_flag" "NONE"
Putting a flag as value will restrict the usage to all players who hvae this flag, putting NONE don't restrict the acces.

"sm_csc_message_format" "{red}[SERVER TAG] {purple}->{default} {pink}[SENDER NAME]{default} {purple}said{default} [MESSAGE]"
Format of the message. Use the tag [SERVER TAG] to represent the value of 'CVAR_ServerTag', [SENDER NAME] for the player name who send the message, and [MESSAGE] to represent the message of teh player.

Commands :

sm_msg [MESSAGE] - Send a message to all servers produce smae effect as +[message] but, +[message] doesn't work on some servers 'cause of simple chat processor.
Exemple : sm_msg Hello everybody :3 !
Admin command :

sm_cscgag [TARGET] - Block / Unblock a player from sending messages to other servers.

Installation :

1) Put CrossServerChat.smx in your plugins folder.
2) Download and install the socket extension. Update if you already have it installed.
3) Read and configure the config file 'CrossServerChat.cfg' and put it in your cfg/sourcemod folder !
4) Restart all your servers.

For those who wanna compille the plugin manually, you will need :
  • Socket extension
  • Multicolors

Configuration

A configuration file is created at the first start, in the cfg/sourcemod/ folder ! The same as the attached one, below.

Bugs :


When a socket fail to connect, produce strange things on reconnect. -> FIXED !

Request & to do:


Nothing, feel free to ask.

Logs :
------
1.0 : First public release.
1.1 : Added the tag support thing.
1.2 : Added a new command, sm_cscgag. ( See admin command )
1.3 : Added a new CVAR, to restrict who can send messages, and who can't.
1.4 : Removed the start order restriciton. cleaned a bit the code.
1.5 : Even more clean up, also, fixed some strange bugs occuring rarelly.
1.6 : Added a new command.
-------

IMPORTANT NOTE:
Take a very good look at the cvar.

BatyaMedic 08-22-2015 09:00

Re: [ANY] Cross servers chat (No database)
 
i love it.

Arkarr 08-22-2015 09:05

Re: [ANY] Cross servers chat (No database)
 
Quote:

Originally Posted by BatyaMedic (Post 2335807)
i love it.

No problem mate !

Mr.Halt 08-22-2015 10:48

Re: [ANY] Cross servers chat (No database)
 
This plugin is AWESOME! I really love this plugin.
By the way, does this plugin need to use command when players' chat transfer to other servers?
I mean... when players typed chat, is it should be like '!command chat' when players' chat transfer to other servers?

Actually, if you are busy, you don't need to answer this question.

Arkarr 08-22-2015 10:51

Re: [ANY] Cross servers chat (No database)
 
Quote:

Originally Posted by Mr.Halt (Post 2335841)
This plugin is AWESOME! I really love this plugin.
By the way, does this plugin need to use command when players' chat transfer to other servers?
I mean... when players typed chat, is it should be like '!command chat' when players' chat transfer to other servers?

Actually, if you are busy, you don't need to answer this question.

First, thanks, really appreciate.

Then, yes.
Quote:

"sm_csc_mark_to_send" "+"
Tag before chat messages to send to all other servers
You can define a charactere (here '+') and if it's in the first position of the message, the message will be sent on all connected servers, for exemple :
+send my message to everyone ! YAY!
Will send the message everywhere
do not send my message
Will stay on the server, 'cause the '+' char isn't found.

Hope it helps.

NOTE:
You have to re-download the smx, I updated things. Also, morecolors supported in server tag as well ! (see CVAR)

Mr.Halt 08-22-2015 10:55

Re: [ANY] Cross servers chat (No database)
 
Quote:

Originally Posted by Arkarr (Post 2335843)
First, thanks, really appreciate.

Then, yes.

You can define a charactere (here '+') and if it's in the first position of the message, the message will be sent on all connected servers, for exemple :
+send my message to everyone ! YAY!
Will send the message everywhere
do not send my message
Will stay on the server, 'cause the '+' char isn't found.

Hope it helps.

NOTE:
You have to re-download the smx, I updated things. Also, morecolors supported in server tag as well ! (see CVAR)

Thanks to answer of it. It really helps me.

Arkarr 08-22-2015 10:56

Re: [ANY] Cross servers chat (No database)
 
Quote:

Originally Posted by Mr.Halt (Post 2335845)
Thanks to answer of it. It really helps me.

If you have any other troubles, just message here, I don't have anything else to do... :¬|

404UserNotFound 08-22-2015 11:00

Re: [ANY] Cross servers chat (No database)
 
Looking at the setup instructions, I see that there's a specific startup order required. I was going to try this, but since I use a combination of Dr. McKay's Auto Steam Update plugin, and the Server Crontab plugin (automatic restart of servers on a pushed update + a daily 3AM restart), the servers tend to restart in whatever order they restart in, which is impossible for me to control.

If you can figure out a way for startup order to not be needed for the setup of this, then it'd be perfect.

Arkarr 08-22-2015 11:08

Re: [ANY] Cross servers chat (No database)
 
@abrandnewday
In fact, in this state, the plugin is unbale to send message for X seconds after the server started (X = sm_csc_reconnect_time). Wich is not perfect.
So, why shouldn't we lower the value of sm_csc_reconnect_time to something like 3.0 sec ?
'cause it would create (3.00 * timeout of the first request) connections. Wich is bad.

So, the only thing you can do to fix your problem now, is to set the value of 'sm_csc_reconnect_time' to 60.0 or 90.0 seconds, so you would be sure there is only 1 connection between client server and master server. Wich also means, that after you started your server, the global chat won't be able to be used after those 60-90 seconds.

Working on a better fix.

m_bNightstalker 08-22-2015 11:28

Re: [ANY] Cross servers chat (No database)
 
please use this: https://github.com/Bara20/Multi-Colors

otherwise it's not for [ANY] game


All times are GMT -4. The time now is 16:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.