Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public abstract class LocalConfig {
// SERVER SETTINGS
private String serverName;

private String defaultChannel;

// GLOBAL CHAT SETTINGS
private boolean overrideGlobalFormat;
private String overrideGlobalFormatFormat;
Expand Down Expand Up @@ -118,6 +120,8 @@ private void setMemberAttributes() {
// Server
serverName = getString("server_name","SPIGOT_SERVER");

defaultChannel = getString("default_channel","global");

// Global Chat
overrideGlobalFormat = getBoolean("override_global_format", false);
overrideGlobalFormatFormat = getString("override_global_format_format", "&5[&dG&5] &f%DISPLAYNAME%&f: ");
Expand Down Expand Up @@ -181,7 +185,14 @@ public LocalConfigStatus reload() {
public String getServerName() {
return serverName;
}


/**
* @return the defaultChannel
*/
public String getDefaultChannel() {
return defaultChannel;
}

/**
* @return the overrideGlobalFormat
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
public abstract class LocalLoginLogoutListener {

protected abstract boolean isPlayerStillOnline(MultiChatLocalPlayer player);

protected void handleLoginEvent(MultiChatLocalPlayer player) {

MultiChatLocal.getInstance().getNameManager().registerPlayer(player.getUniqueId(), player.getName());

String defaultChannel = MultiChatLocal.getInstance().getConfigManager().getLocalConfig().getDefaultChannel();

Map<UUID, String> playerChannels = MultiChatLocal.getInstance().getDataStore().getPlayerChannels();
synchronized (playerChannels) {
if (!playerChannels.containsKey(player.getUniqueId())) {
playerChannels.put(player.getUniqueId(), "global");
playerChannels.put(player.getUniqueId(), defaultChannel);
}
}

Expand Down
3 changes: 3 additions & 0 deletions multichat/src/main/resources/localconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ version: "1.10" #
# Specify the name of this server here for the %SERVER% placeholder
server_name: "UNNAMED_SERVER"

# Specify the channel the user should connect to when first joining (local / global)
default_channel: "global"

############################################################
# +------------------------------------------------------+ #
# | Global | #
Expand Down