Permalink
Browse files

addded setting to show/hide node Join/leave messages

  • Loading branch information...
1 parent bcce7e2 commit 9ac71b2900f6c4cfeca998b37b66b787e76ac22a seuffert committed May 11, 2011
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -279,6 +279,8 @@ private void initWithRegistryValues()
checkBox_filter_wellknown_ports.Checked = s.REG_FILTER_WELLKNOWN_PORTS;
checkBox_NAT_enablePS3mode.Checked = s.REG_PS3_COMPAT_MODE_ENABLE;
checkBox_excludeGatewayIPs.Checked = s.REG_SNIFFER_EXCLUDE_GATWAY_IPS;
+ checkBox_chat_nodeInfoMessagesInChat.Checked = s.REG_CHAT_NODEINFOMESSAGES;
+ xbs_chat.message_when_nodes_join_or_leave = s.REG_CHAT_NODEINFOMESSAGES;
if (checkBox_enable_MAC_list.Checked)
checkBox_mac_restriction.Enabled = true;
@@ -315,6 +317,7 @@ private void saveRegistryValues()
s.REG_FILTER_WELLKNOWN_PORTS = checkBox_filter_wellknown_ports.Checked;
s.REG_PS3_COMPAT_MODE_ENABLE = checkBox_NAT_enablePS3mode.Checked;
s.REG_SNIFFER_EXCLUDE_GATWAY_IPS = checkBox_excludeGatewayIPs.Checked;
+ s.REG_CHAT_NODEINFOMESSAGES = checkBox_chat_nodeInfoMessagesInChat.Checked;
s.Save();
}
@@ -1555,5 +1558,10 @@ private void checkBox_excludeGatewayIPs_CheckedChanged(object sender, EventArgs
}
}
+ private void checkBox_chat_nodeInfoMessagesInChat_CheckedChanged(object sender, EventArgs e)
+ {
+ xbs_chat.message_when_nodes_join_or_leave = checkBox_chat_nodeInfoMessagesInChat.Checked;
+ }
+
}
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -68,5 +68,8 @@
<Setting Name="REG_SNIFFER_EXCLUDE_GATWAY_IPS" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
+ <Setting Name="REG_CHAT_NODEINFOMESSAGES" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
</Settings>
</SettingsFile>
@@ -74,6 +74,9 @@
<setting name="REG_SNIFFER_EXCLUDE_GATWAY_IPS" serializeAs="String">
<value>True</value>
</setting>
+ <setting name="REG_CHAT_NODEINFOMESSAGES" serializeAs="String">
+ <value>False</value>
+ </setting>
</XBSlink.Properties.Settings>
</userSettings>
</configuration>
View
@@ -74,6 +74,9 @@
<setting name="REG_SNIFFER_EXCLUDE_GATWAY_IPS" serializeAs="String">
<value>True</value>
</setting>
+ <setting name="REG_CHAT_NODEINFOMESSAGES" serializeAs="String">
+ <value>False</value>
+ </setting>
</XBSlink.Properties.Settings>
</userSettings>
</configuration>
View
@@ -31,6 +31,7 @@ class xbs_chat
public static String STANDARD_NICKNAME { get { return _STANDARD_NICKNAME + (new Random().Next(1000, 9999)).ToString(); } }
public const String INCOMING_MESSAGE_SOUNG = "sounds/incoming_chat_msg.wav";
public static bool notify_on_incoming_message = true;
+ public volatile static bool message_when_nodes_join_or_leave = false;
public static void addChatMessage( String sender, String msg)
{
@@ -394,7 +394,7 @@ public void dispatch_in_msg(ref xbs_udp_message udp_msg)
{
xbs_messages.addInfoMessage("!! error on deleting node: "+ex.Message);
}
- if (tmp_node != null)
+ if (tmp_node != null && xbs_chat.message_when_nodes_join_or_leave)
xbs_chat.addSystemMessage(tmp_node.nickname + " left.");
break;
@@ -445,7 +445,8 @@ public void dispatch_in_msg(ref xbs_udp_message udp_msg)
sending_node.nickname = msg_nick.getNickname();
sending_node.nickname_received = true;
node_list.listHasJustChanged();
- xbs_chat.addSystemMessage(sending_node.nickname + " joined.");
+ if ( xbs_chat.message_when_nodes_join_or_leave )
+ xbs_chat.addSystemMessage(sending_node.nickname + " joined.");
}
break;
case xbs_node_message_type.GETNICKNAME:

0 comments on commit 9ac71b2

Please sign in to comment.