Chat Base


Here you will find the documentation on the features in the Chat Base part of the framework.

Documentation may be incomplete and might need additions, we will update this when we can.

Notice! As Of EM Framework Version 2.3 The Chat Base has Changed a bit and includes the New Chat Base Extended To simplify using the Chat Base.

I have also updated the Documentation here to better reflect all the things you can do in the chat base with better explanations on all the components.

This page has gotten rather long with the new additions so be sure to use the side navigation to get to the part you are looking for.

Usage:

using Eco.EM.Framework.ChatBase;

With the New Chat Base Overhaul we have added in a bunch of new things. In this documentation i have Split it all up into sections for new changes.

If you find the Chat Base a bit too complicated to use, you can use the Chat Base Extended Instead as that is a streamlined Process

How To Use The Chat Base:

When Using the chat base you there is really only one way to use it

The Chat Base can be used anywhere you want to send any kind of notification or Message to any user on the server or all servers without needing to go to the extent of using the attached methods to the User Class or Player Class etc

Here is an Example on Basic Usage:

ChatBase.Send(new ChatBase.MessageType(param));

In this example ChatBase.MessageType is one of the Available Message Types Below:

More Information on Each of these Message Types can be found below, Each one Also has a different set of Parameters and different ways to use them


ChatBase.Announcement

ChatBase.Announcement is a simple little sending method for sending an "Announcement" To all users on the server

ChatBase.Announcement can only be sent to everyone on the server, there is no extra option to send it to a single user

This sending method allows you a few customizable options:

  • Title - This doesn't need to be used, but is Required to use the Info Panel as it has a Title Bar
  • Content - This is your announcement Message, the text that appears as the message in the Ok Box or Info Panel
  • Send To All - This is an option to send the announcement to every user, not just the online users, Offline users get a notification in their Little bell on the right hand side
  • Send To Chat - This is an option to send the announcement to the chat as well as the info panel or Ok Box
  • Message Type - The Message Type here requires you to use only OkBox, InfoPanel or Custom Info Panel Message Types

Send To Chat and Send To All are both Booleans, both are also defaulted to false meaning they will not send to the chat or send too all users offline included by default.

Just Remember you can only use: ChatBase.MessageType.OkBox or ChatBase.MessageType.CustomInfo and ChatBase.MessageType.InfoPanel with ChatBase.Announcement

Here are All the Overloads with a description on each:

//This will only send an Ok Box with the select text which is a string
ChatBase.Send(new ChatBase.Announcement(string content));
//This will send an Ok Box with the select text which is a string as well as leaving the notification for offline users
ChatBase.Send(new ChatBase.Announcement(string content, bool sendtoall));
//This will only send an Ok Box with the select text which is a string and send to the server chat in the general channel to make sure its read!
ChatBase.Send(new ChatBase.Announcement(string content, bool sendtochat));
//This will only send an Ok Box with the select text which is a string and send to the server chat in the general channel to make sure its read
//As well as offline users
ChatBase.Send(new ChatBase.Announcement(string content, bool sendtoall, bool sendtochat));

//This will only send an Info Panel with the select title and message to all users on the server
ChatBase.Send(new ChatBase.Announcement(string title, string content));
//This will only send an Info Panel with the select title and message to all as well as leaving the notification for offline users
ChatBase.Send(new ChatBase.Announcement(string title, string content, bool sendtoall));
//This will only send an Info Panel with the select title and message to all users on the server and 
//send to the server chat in the general channel to make sure its read!
 ChatBase.Send(new ChatBase.Announcement(string title, string content, bool sendtochat));
//This will only send an Info Panel with the select title and message send to all users on the server and 
//send to the server chat in the general channel to make sure its read As well as offline users
ChatBase.Send(new ChatBase.Announcement(string title, string content, bool sendtoall, bool sendtochat));

//This will allow you to choose the Info Panel or The Custom Info Panel, SendToAll and SendToChat are optional params so you can still use
//them here if you like
ChatBase.Send(new ChatBase.Announcement(string title, string content, MessageType messageType, bool sendtoall, bool sendtochat));

Please note! Both SendToAll and SendToChat are optional params so you can specifically set which one you would like to use by doing the following:

//Telling it to use sendtoall specifically
ChatBase.Send(new ChatBase.Announcement(content, sendToAll: true));
//Telling it to use sendtochat specifically
ChatBase.Send(new ChatBase.Announcement(content, sendToChat: true));

ChatBase.Chat

ChatBase.Chat is a simple little sending method for sending a message to the chat to either a single user or all users on the server at that time

ChatBase.Chat will not send too offline users but may stay in the chat logs if you set it as a permanent message

This sending method allows you a few customizable options:

  • Content - This is your Message, the text that appears as the message too all users or the specified user
  • Message Type - This is what you use to specify if it is a temporary message or a Permanent Message ( Check Out Message Types )
  • Default Chat Tags - This is what you use to tell it what chat channel to send it too ( Check out Default Chat Tags )

Temporary Messages will be removed after a short period of time where Permanent Messages won't.

Please note, if you don't specify which channel to send too it will default to the general channel, normally notifications would be the goto but due to requests we have been asked for it to default to general as alot of people turn off the notifications channel.

Chat Messages sent through the chat base default to temporary messages.

Here are All the Overloads with a description on each:

<--Sending Temporary Messages to all users on the server and specific players-->
//This will send a message to all users on the server in the general channel
ChatBase.Send(new ChatBase.Chat(string content));
//This will send a message to a specific user in the general channel
ChatBase.Send(new ChatBase.Chat(string content, User user));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Chat(string content, Player player));

<--Specify Sending Permanent/Temp Messages to all users on the server and specific players-->
//This will send a message to all users on the server in the Server
ChatBase.Send(new ChatBase.Chat(string content, MessageType messageType));
//This will send a message to a specific user in the general channel
ChatBase.Send(new ChatBase.Chat(string content, User user, MessageType messageType));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Chat(string content, Player player, MessageType messageType));

<--Sending Messages to all users on the server and specific players and a specific Channel-->
//This will send a message to all users on the server in the Server
ChatBase.Send(new ChatBase.Chat(string content, DefaultChatTags defaultChatTags));
//This will send a message to a specific user in the general channel
ChatBase.Send(new ChatBase.Chat(string content, User user, DefaultChatTags defaultChatTags));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Chat(string content, Player player, DefaultChatTags defaultChatTags));

<--Specify Sending Permanent/Temp Messages to all users on the server and specific players and setting the specific channel to send too-->
//This will send a message to all users on the server in the Server
ChatBase.Send(new ChatBase.Chat(string content, MessageType messageType, DefaultChatTags defaultChatTags));
//This will send a message to a specific user in the general channel
ChatBase.Send(new ChatBase.Chat(string content, User user, MessageType messageType, DefaultChatTags defaultChatTags));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Chat(string content, Player player, MessageType messageType, DefaultChatTags defaultChatTags));

Just In case you are a little confused Here are some examples:

//Telling it to send to a specific user and using a permanent message
ChatBase.Send(new ChatBase.Chat(content, user, ChatBase.MessageType.Permanent));
//Telling it to send to a specific user and a specific channel  in this case trades
ChatBase.Send(new ChatBase.Chat(content, user, DefaultChatTags.Trades));
//Telling it to send to all in the server as a permanent message and a specific channel in this case trades
ChatBase.Send(new ChatBase.Chat(content, ChatBase.MessageType.Permanent, DefaultChatTags.Trades));

ChatBase.Error

ChatBase.Error is a simple little sending method for sending an error message to either a single user or all users on the server at that time

It Displays a little red error box similar to a failed action for a user

ChatBase.Error will not send to offline users

This sending method allows you a single option:

  • Content - This is your Message, the text that appears as the message too all users or the specified user

Here are All the Overloads with a description on each:

//Sending an error to all users on the server
ChatBase.Send(new ChatBase.Error(string content));
//Sending an error to a specific user
ChatBase.Send(new ChatBase.Error(string content, User user));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Error(string content, Player player));

ChatBase.Info

ChatBase.Info is a simple little sending method for sending an info message to either a single user or all users on the server at that time

It Displays a little box similar to a failed action for a user but is lighter in color designed for sending information

ChatBase.Info will not send to offline users

This sending method allows you a single option:

  • Content - This is your Message, the text that appears as the message too all users or the specified user

Here are All the Overloads with a description on each:

//Sending an error to all users on the server
ChatBase.Send(new ChatBase.Info(string content));
//Sending an error to a specific user
ChatBase.Send(new ChatBase.Info(string content, User user));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Info(string content, Player player));

ChatBase.InfoBox

ChatBase.InfoBox is a simple little sending method for sending an info message to either a single user or all users on the server at that time

It Displays a little info box similar to info but a different color to ChatBase.Info

ChatBase.InfoBox will not send to offline users

This sending method allows you a single option:

  • Content - This is your Message, the text that appears as the message too all users or the specified user

Here are All the Overloads with a description on each:

//Sending an error to all users on the server
ChatBase.Send(new ChatBase.InfoBox(string content));
//Sending an error to a specific user
ChatBase.Send(new ChatBase.InfoBox(string content, User user));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.InfoBox(string content, Player player));

ChatBase.InfoPane

ChatBase.InfoPane is a simple way to post Info Panels, Info Panels are a UI Based system that can display text in a beautiful way

This Sending method is quite customizable while giving you the option to send to server chat as well as setting the server chat message as a temp or permanent message.

ChatBase.InfoPane will not send to offline users

This sending method allows you a Few options but some are required to use this:

  • Title - Info Panels support a title that is displayed at the top, this allows you to set that text
  • Content - This is your Message, the text that appears as the message too all users or the specified user
  • Message Type - This is a bit different to the other sending options, this is a boolean This allows you to define if it is an info panel or the custom info panel
  • Send To Chat - This is a boolean that allows you to tell it to send to the chat as well
  • Temp Message - This is a boolean that allows you to tell it if the message sent to chat is a temp message or not

There are a few things to note here:

Message Type: Message Types for the info panel offer the option to use the Custom Info Panel, The Custom Info Panel is supposed to remember the size and position it had when it was closed where the Normal Info Panel does not.

If you only use Send To Chat without the Temp Message Overload it will default to a Permanent Message

When using ChatBase.InfoPane you must give it a title otherwise it will throw an error, you can use a blank string like: " " but not string.empty

Send To Chat is Default Set to False so you don't even need to include it in any of the below sending methods it is completely optional

Here are All the Overloads with a description on each:

<--Sending To All Users On The Server-->
//This will send to all users on the server a basic info panel
ChatBase.Send(new ChatBase.InfoPane(string title, string content, bool sendToChat));
//This will send to all users on the server a basic info panel with the option to use the custom info panel
ChatBase.Send(new ChatBase.InfoPane(string title, string content, bool messageType, bool sendToChat));
//This will send to all users on the server a basic info panel with the option to use the custom info panel and tell it to use temp 
//or permanent messages in the chat
ChatBase.Send(new ChatBase.InfoPane(string title, string content, bool messageType, bool tempMessage, bool sendToChat));

<--Sending To A Specific User On The Server-->
//This will send to a specific user on the server a basic info panel
 ChatBase.Send(new ChatBase.InfoPane(string title, string content, User user, bool sendToChat));
//This will send to a specific user on the server a basic info panel with the option to use the custom info panel
 ChatBase.Send(new ChatBase.InfoPane(string title, string content, User user, bool messageType, bool sendToChat));
//This will send to a specific user on the server a basic info panel with the option to use the custom info panel and tell it to use temp 
//or permanent messages in the chat
 ChatBase.Send(new ChatBase.InfoPane(string title, string content, User user, bool messageType, bool tempMessage, bool sendToChat));

<--Sending To A Specific User On The Server but using player instead-->
//This will send to a specific user on the server a basic info panel
 ChatBase.Send(new ChatBase.InfoPane(string title, string content, Player player, bool sendToChat));
//This will send to a specific user on the server a basic info panel with the option to use the custom info panel
 ChatBase.Send(new ChatBase.InfoPane(string title, string content, Player player, bool messageType, bool sendToChat));
//This will send to a specific user on the server a basic info panel with the option to use the custom info panel and tell it to use temp 
//or permanent messages in the chat
 ChatBase.Send(new ChatBase.InfoPane(string title, string content, Player player, bool messageType, bool tempMessage, bool sendToChat));

ChatBase.Mail

ChatBase.Mail Makes sending to the mailboxes of users nice and easy!

The ChatBase.Mail sends anything through this sending method to the Notification Bell on the right hand side of the users screen.

ChatBase.Mail will send to offline users as it goes to their MailBox

This sending method allows you a few options:

  • Content - This is your Message, the text that appears as the message too all users or the specified user
  • Tag - Tag's seem to be like the little notification Identifier, By Default we Specify it as a Notification

Little is known about the Tag overload but it is an option for adding mail to the users mail box, we provide you the option to change the tag as well though

Here are All the Overloads with a description on each:

//Sending a mail to all users on the server
ChatBase.Send(new ChatBase.Mail(string content));
//Sending a mail to all users on the server and specifying the tag
ChatBase.Send(new ChatBase.Mail(string content, string tag));
//Sending a mail to a specific user on the server
ChatBase.Send(new ChatBase.Mail(string content, User user));
//Sending a mail to a specific user on the server and specifying the tag
ChatBase.Send(new ChatBase.Mail(string content, string tag, User user));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Mail(string content, Player player));
//This is the same as sending to a user but just incase you are using player instead we support that as well as well as the Tag
ChatBase.Send(new ChatBase.Mail(string content, string tag, Player player));

ChatBase.Message

ChatBase.Message is probably the Hardest sending method to use but it is the most versatile, it has many options and overloads you can use to make it the most flexible sending method.

There is 2 ways ChatBase.Message works, Sending to Users/Players and Sending to All users in the server, ChatBase.Message can do everything all the other sending methods can it just seems a little more complicated at first.

This sending method allows you a Few options but some are required to use this:

  • Title - Title is used for setting titles when specifying the message type as an info panel
  • Content - This is the general text that is sent through any message type
  • Message Type - The Message Types here are are little confusing but i will explain them a little below
  • Message Category - Is used to set where it should be sent too, Check Message Category for more information
  • Default Chat Tags - This is used to specify which channel you are sending your message too, ie: General, Trades etc

Message Types in ChatBase.Message are not exactly simple to use, you must make sure your sending method has all the correct parameters otherwise you won't get your desired effect.

Sending To Users:

When sending to users you can pass through either User user or Player player, the chat Base will Accept Both, Below are a few examples on sending to a user and all parameters

//This is a basic server message to a specific user
ChatBase.Send(new ChatBase.Message(string content, User user));
//This is a basic server message to a specific user but being able to specify if its a permanent message or temporary message
ChatBase.Send(new ChatBase.Message(string content, User user, MessageType messageType));
//This is a basic server message to a specific user but being able to specify which channel you wish to send it too
ChatBase.Send(new ChatBase.Message(string content, User user, DefaultChatTags defaultChatTags));
//This is a basic server message to a specific user but being able to specify which channel you wish to send
//it too but also specifying which message category which normally would be Chat
ChatBase.Send(new ChatBase.Message(string content, User user, MessageCategory messageCategory, DefaultChatTags defaultChatTags));
//This gives you full rein over all the options except for info panels
ChatBase.Send(new ChatBase.Message(string content, User user, MessageCategory messageCategory, DefaultChatTags defaultChatTags, MessageType messageType));
//This allows you to send an info panel or popup ok box to the specified user, if title is null or empty it will send a popup ok box instead
ChatBase.Send(new ChatBase.Message(string title, string content, User user));

//This isn't just limited to User these can all be used with Player as well
//This is a basic server message to a specific user
ChatBase.Send(new ChatBase.Message(string content, Player player));
//This is a basic server message to a specific player but being able to specify if its a permanent message or temporary message
ChatBase.Send(new ChatBase.Message(string content, Player player, MessageType messageType));
//This is a basic server message to a specific player but being able to specify which channel you wish to send it too
ChatBase.Send(new ChatBase.Message(string content, Player player, DefaultChatTags defaultChatTags));
//This is a basic server message to a specific player but being able to specify which channel you wish to send
//it too but also specifying which message category which normally would be Chat
ChatBase.Send(new ChatBase.Message(string content, Player player, MessageCategory messageCategory, DefaultChatTags defaultChatTags));
//This gives you full rein over all the options except for info panels
ChatBase.Send(new ChatBase.Message(string content, Player player, MessageCategory messageCategory, DefaultChatTags defaultChatTags, MessageType messageType));
//This allows you to send an info panel or popup ok box to the specified player, if title is null or empty it will send a popup ok box instead
ChatBase.Send(new ChatBase.Message(string title, string content, Player player));
Sending To The Server:
//This is a basic server message to all online users
ChatBase.Send(new ChatBase.Message(string content));
//This is a basic server message to all online users but being able to specify if its a permanent message or temporary message
ChatBase.Send(new ChatBase.Message(string content, MessageType messageType));
//This is a basic server message to all online users but being able to specify which channel you wish to send it too
ChatBase.Send(new ChatBase.Message(string content, DefaultChatTags defaultChatTags));
//This is a basic server message to all online users but being able to specify which channel you wish to send
//it too but also specifying which message category which normally would be Chat
ChatBase.Send(new ChatBase.Message(string content, MessageCategory messageCategory, DefaultChatTags defaultChatTags));
//This gives you full rein over all the options except for info panels
ChatBase.Send(new ChatBase.Message(string content, MessageCategory messageCategory, DefaultChatTags defaultChatTags, MessageType messageType));
//This allows you to send an info panel or popup ok box to all online users, if title is null or empty it will send a popup ok box instead
ChatBase.Send(new ChatBase.Message(string title, string content));

More information:

ChatBase.Message will take a bit to get a handle on and might be very confusing to get the desired effect, it has alot of potential and flexibility and can achieve just about any kind of sending method, however if it is a bit too difficult to understand then any of the other methods can reach the desired effect without the complication of using this sending method.


ChatBase.OKBox

ChatBase.OkBox is a simple little sending method for sending an Ok Box to either a single user or all users on the server at that time

The Ok Box is a Popup that shows a desired message, it requires them to click ok to close the box

ChatBase.OkBox will not send to offline users

This sending method allows you a single option:

  • Content - This is your Message, the text that appears as the message too all users or the specified user

Here are All the Overloads with a description on each:

//Sending a Ok Box To all users on the server ( Requires them to click ok to close the box )
ChatBase.Send(new ChatBase.OkBox(string content));
//Sending an Ok Box to a specific online user
ChatBase.Send(new ChatBase.OkBox(string content, User user));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.OkBox(string content, Player player));

ChatBase.Warning

ChatBase.Warning is a simple little sending method for sending a warning message to either a single user or all users on the server at that time

It Displays a little info box similar to info but a different color to ChatBase.Info

ChatBase.Warning will not send to offline users

This sending method allows you a single option:

  • Content - This is your Message, the text that appears as the message too all users or the specified user

Here are All the Overloads with a description on each:

//Sending a warning to all users on the server
ChatBase.Send(new ChatBase.Warning(string content));
//Sending a warning to a specific user
ChatBase.Send(new ChatBase.Warning(string content, User user));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Warning(string content, Player player));

ChatBase.Whisper

ChatBase.Whisper is a simple little sending method for sending an info message to either a single user or all users on the server at that time

It Displays a little info box similar to info but a different color to ChatBase.Info

ChatBase.Whisper will not send to offline users

This sending method allows you a single option:

  • Content - This is your Message, the text that appears as the message too all users or the specified user

Here are All the Overloads with a description on each:

//Sending an error to all users on the server
ChatBase.Send(new ChatBase.Whisper(string content));
//Sending an error to a specific user
ChatBase.Send(new ChatBase.Whisper(string content, User user));
//This is the same as sending to a user but just incase you are using player instead we support that as well
ChatBase.Send(new ChatBase.Whisper(string content, Player player));

Message Types

Usage For the message types:

ChatBase.MessageType.Type - Types Listed Below.

Each Message Type Explained:

  • Temporary - Temporary Messages, will dissapear after a short time
  • Permanent - Permanent Messages, Will not dissapear
  • InfoPanel - Sets it as an Info Panel (Ui Based Display)
  • CustomInfo - Sets it as a Custom Info Panel
  • OkBox - Sets it as a Popup Ok Box that requires the user to Click ok
  • GlobalAnnouncement - Global Announcements are sent to the Notifications for users but displays no visible information besides whats in the notification Bell

For Users:

Temporary
Permanent
InfoPanel //Only Viable when using ChatBase.Message and ChatBase.InfoPane
CustomInfo //Only Viable when using ChatBase.Message and ChatBase.InfoPane
OkBox //Only Viable when using ChatBase.Message and ChatBase.OkBox

For the server

Temporary
Permanent
InfoPanel //Only Viable when using ChatBase.Message, ChatBase.InfoPane and ChatBase.Announcement
CustomInfo //Only Viable when using ChatBase.Message, ChatBase.InfoPane and ChatBase.Announcement
OkBox //Only Viable when using ChatBase.Message, ChatBase.OkBox and ChatBase.Announcement
GlobalAnnoucement //Only Viable when using ChatBase.Message

Additional Information

Available Chat Tags

To use these it requires a reference to the Eco.Shared.Services Namespace

These Are all the Different Chat Channels available by default for sending to

using Eco.Shared.Services;

DefaultChatTags.ChatTag

Welcome      
General      
Notifications
Government   
Elections    
Crafting     
Meteor       
Trades       
YourTrades   
Tax          
Property     
Skills       
Logins       
Auth         
Reputation   
Objectives   
Contracts    
YourContracts
ServerErrors 
Finance      
Wages        
Transfers    
Demographics 
Settlements

Available Message Categories

To use these it requires a refrence to the Eco.Shared.Services Namespace

Message Categories Are only Viable When using ChatBase.Message

using Eco.Shared.Services;

MessageCategory.Category

Chat
Whisper
Error
Info
Mail
Warning
Popup
InfoBox