Skip to content

Commit a54a11e

Browse files
committed
Added notification: notifyserveredited
1 parent ea0e587 commit a54a11e

5 files changed

Lines changed: 84 additions & 0 deletions

File tree

TS3QueryLib.Core.Framework/TS3QueryLib.Core.Framework.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@
365365
<Compile Include="..\TS3QueryLib.Core.Silverlight\Server\Notification\EventArgs\MessageReceivedEventArgs.cs">
366366
<Link>Server\Notification\EventArgs\MessageReceivedEventArgs.cs</Link>
367367
</Compile>
368+
<Compile Include="..\TS3QueryLib.Core.Silverlight\Server\Notification\EventArgs\ServerEditedEventArgs.cs">
369+
<Link>Server\Notification\EventArgs\ServerEditedEventArgs.cs</Link>
370+
</Compile>
368371
<Compile Include="..\TS3QueryLib.Core.Silverlight\Server\Notification\EventArgs\TokenUsedEventArgs.cs">
369372
<Link>Server\Notification\EventArgs\TokenUsedEventArgs.cs</Link>
370373
</Compile>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
using System;
2+
using TS3QueryLib.Core.CommandHandling;
3+
using TS3QueryLib.Core.Common;
4+
using TS3QueryLib.Core.Server.Responses;
5+
6+
namespace TS3QueryLib.Core.Server.Notification.EventArgs
7+
{
8+
public class ServerEditedEventArgs : System.EventArgs, IDump
9+
{
10+
#region Properties
11+
12+
public uint ReasonId { get; protected set; }
13+
public uint InvokerId { get; protected set; }
14+
public string InvokerName { get; protected set; }
15+
public string InvokerUniqueId { get; protected set; }
16+
17+
public string Name { get; set; }
18+
public uint? DefaultServerGroupId { get; set; }
19+
public uint? DefaultChannelGroupId { get; set; }
20+
public double? PrioritySpeakerDimmModification { get; set; }
21+
public string HostBannerUrl { get; set; }
22+
public string HostBannerGraphicsUrl { get; set; }
23+
public uint? HostBannerGraphicsInterval { get; set; }
24+
public string HostButtonGraphicsUrl { get; set; }
25+
public string HostButtonTooltip { get; set; }
26+
public string HostButtonUrl { get; set; }
27+
public HostBannerMode? HostBannerMode { get; set; }
28+
29+
public string PhoneticName { get; set; }
30+
public uint? IconId { get; set; }
31+
32+
#endregion
33+
34+
#region Constructors
35+
36+
37+
public ServerEditedEventArgs(CommandParameterGroupList commandParameterGroupList)
38+
{
39+
if (commandParameterGroupList == null)
40+
throw new ArgumentNullException(nameof(commandParameterGroupList));
41+
42+
ReasonId = commandParameterGroupList.GetParameterValue<uint>("reasonid");
43+
InvokerId = commandParameterGroupList.GetParameterValue<uint>("invokerid");
44+
InvokerName = commandParameterGroupList.GetParameterValue<string>("invokername");
45+
InvokerUniqueId = commandParameterGroupList.GetParameterValue<string>("invokeruid");
46+
47+
Name = commandParameterGroupList.GetParameterValue<string>("virtualserver_name");
48+
DefaultServerGroupId = commandParameterGroupList.GetParameterValue<uint?>("virtualserver_default_server_group");
49+
DefaultChannelGroupId = commandParameterGroupList.GetParameterValue<uint?>("virtualserver_default_channel_group");
50+
HostBannerUrl = commandParameterGroupList.GetParameterValue<string>("virtualserver_hostbanner_url");
51+
HostBannerGraphicsUrl = commandParameterGroupList.GetParameterValue<string>("virtualserver_hostbanner_gfx_url");
52+
53+
HostBannerGraphicsInterval = commandParameterGroupList.GetParameterValue<uint?>("virtualserver_hostbanner_gfx_interval");
54+
PrioritySpeakerDimmModification = commandParameterGroupList.GetParameterValue<double?>("virtualserver_priority_speaker_dimm_modificator");
55+
HostButtonTooltip = commandParameterGroupList.GetParameterValue("virtualserver_hostbutton_tooltip");
56+
HostButtonUrl = commandParameterGroupList.GetParameterValue("virtualserver_hostbutton_url");
57+
PhoneticName = commandParameterGroupList.GetParameterValue("virtualserver_name_phonetic");
58+
IconId = commandParameterGroupList.GetParameterValue<uint?>("virtualserver_icon_id");
59+
HostButtonGraphicsUrl = commandParameterGroupList.GetParameterValue<string>("virtualserver_hostbutton_gfx_url");
60+
HostBannerMode = (HostBannerMode?)commandParameterGroupList.GetParameterValue<uint?>("virtualserver_hostbanner_mode");
61+
}
62+
63+
#endregion
64+
}
65+
}

TS3QueryLib.Core.Silverlight/Server/Notification/Notifications.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public class Notifications : NotificationsBase
9494
/// </summary>
9595
public event EventHandler<ChannelDeletedEventArgs> ChannelDeleted;
9696

97+
/// <summary>
98+
/// Raised, when the current server was edited
99+
/// </summary>
100+
public event EventHandler<ServerEditedEventArgs> ServerEdited;
101+
97102
/// <summary>
98103
/// Raised, when a unknown notification was received
99104
/// </summary>
@@ -127,6 +132,7 @@ protected override Dictionary<string, Action<CommandParameterGroupList>> GetNoti
127132
{ "notifychannelpasswordchanged", HandleChannelPasswordChanged },
128133
{ "notifychannelcreated", HandleChannelCreated },
129134
{ "notifychanneldeleted", HandleChannelDeleted },
135+
{ "notifyserveredited", HandleServerEdited },
130136
{ "*", HandleUnknownNotificationReceived },
131137
};
132138
}
@@ -255,6 +261,12 @@ private void HandleChannelDeleted(CommandParameterGroupList parameterGroupList)
255261
ThreadPool.QueueUserWorkItem(x => ChannelDeleted(this, new ChannelDeletedEventArgs(parameterGroupList)), null);
256262
}
257263

264+
private void HandleServerEdited(CommandParameterGroupList parameterGroupList)
265+
{
266+
if (ServerEdited != null)
267+
ThreadPool.QueueUserWorkItem(x => ServerEdited(this, new ServerEditedEventArgs(parameterGroupList)), null);
268+
}
269+
258270
private void HandleUnknownNotificationReceived(CommandParameterGroupList parameterGroupList)
259271
{
260272
if (UnknownNotificationReceived != null)

TS3QueryLib.Core.Silverlight/TS3QueryLib.Core.Silverlight.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
<Compile Include="Server\Notification\EventArgs\ClientMovedByClientEventArgs.cs" />
146146
<Compile Include="Server\Notification\EventArgs\ClientMovedEventArgs.cs" />
147147
<Compile Include="Server\Notification\EventArgs\MessageReceivedEventArgs.cs" />
148+
<Compile Include="Server\Notification\EventArgs\ServerEditedEventArgs.cs" />
148149
<Compile Include="Server\Notification\EventArgs\TokenUsedEventArgs.cs" />
149150
<Compile Include="Server\Notification\EventArgs\UnknownNotificationEventArgs.cs" />
150151
<Compile Include="Server\Notification\Notifications.cs" />

TS3QueryLib.Core.WP7/TS3QueryLib.Core.WP7.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@
399399
<Compile Include="..\TS3QueryLib.Core.Silverlight\Server\Notification\EventArgs\MessageReceivedEventArgs.cs">
400400
<Link>Server\Notification\EventArgs\MessageReceivedEventArgs.cs</Link>
401401
</Compile>
402+
<Compile Include="..\TS3QueryLib.Core.Silverlight\Server\Notification\EventArgs\ServerEditedEventArgs.cs">
403+
<Link>Server\Notification\EventArgs\ServerEditedEventArgs.cs</Link>
404+
</Compile>
402405
<Compile Include="..\TS3QueryLib.Core.Silverlight\Server\Notification\EventArgs\TokenUsedEventArgs.cs">
403406
<Link>Server\Notification\EventArgs\TokenUsedEventArgs.cs</Link>
404407
</Compile>

0 commit comments

Comments
 (0)