-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8a9f97
commit 830485f
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using API; | ||
using API.Commands; | ||
using Client.Stream; | ||
|
||
namespace Client.Commands | ||
{ | ||
public class CancelAllPhrases : CommandBase | ||
{ | ||
public override string CmdName => "CancelAllPhrases"; | ||
|
||
public override string CmdUsage => ""; | ||
|
||
public override string CmdDesc => "Called to cancel a Phrase link."; | ||
|
||
public override string Run(IClient handler, string command, Dictionary<string, object> localVars) | ||
{ | ||
if (!(handler is RyzomClient ryzomClient)) | ||
throw new Exception("Command handler is not a Ryzom client."); | ||
|
||
// Check parameters. | ||
if (HasArg(command)) | ||
return "Please specify no parameters."; | ||
|
||
// Create the message and send. | ||
const string msgName = "PHRASE:CANCEL_ALL"; | ||
var out2 = new BitMemoryStream(); | ||
|
||
if (ryzomClient.GetNetworkManager().GetMessageHeaderManager().PushNameToStream(msgName, out2)) | ||
ryzomClient.GetNetworkManager().Push(out2); | ||
else | ||
return $"Unknown message named '{msgName}'."; | ||
|
||
return ""; | ||
} | ||
|
||
public override IEnumerable<string> GetCmdAliases() | ||
{ | ||
return new string[] { }; | ||
} | ||
} | ||
} |