本文整理汇总了C#中PlayerCharacter.FollowingFollow方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerCharacter.FollowingFollow方法的具体用法?C# PlayerCharacter.FollowingFollow怎么用?C# PlayerCharacter.FollowingFollow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCharacter
的用法示例。
在下文中一共展示了PlayerCharacter.FollowingFollow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: handleRawText
private void handleRawText(PlayerCharacter pc, IncommingMessage msg)
{
if (pc.LoginState == PlayerCharacterLoginState.LoginSuccesfull)
{
RawTextIncommingMessage msgRawText = (RawTextIncommingMessage)msg;
// Handling for different types of raw text
// TODO: Rewrite - add a separate module for handling server commands
switch (msgRawText.Text[0])
{
case('#'):
if (msgRawText.Text.ToLower() == "#save")
{
RawTextOutgoingMessage msgRawTextOut =
(RawTextOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.RAW_TEXT);
msgRawTextOut.Channel = PredefinedChannel.CHAT_LOCAL;
try
{
pc.Serialize(pcSerializer);
msgRawTextOut.Text = "Another page in Book of Life is filled...";
msgRawTextOut.Color = PredefinedColor.Blue1;
}
catch (Exception ex)
{
logger.LogError(LogSource.World, "Failed to serialize player " + pc.Name, ex);
msgRawTextOut.Text = "Your page in Book of Life remains blank...";
msgRawTextOut.Color = PredefinedColor.Red2;
}
pc.PutMessageIntoMyQueue(msgRawTextOut);
return;
}
if (msgRawText.Text.ToLower() == "#list_commands")
{
RawTextOutgoingMessage msgRawTextOut =
(RawTextOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.RAW_TEXT);
msgRawTextOut.Channel = PredefinedChannel.CHAT_LOCAL;
msgRawTextOut.Color = PredefinedColor.Green3;
msgRawTextOut.Text = "Available commands: list_commands, save, follow, stop_following, release_followers, list_skills";
pc.PutMessageIntoMyQueue(msgRawTextOut);
return;
}
if (msgRawText.Text.ToLower() == "#stop_following")
{
pc.FollowingStopFollowing();
return;
}
if (msgRawText.Text.ToLower() == "#release_followers")
{
pc.FollowingReleaseFollowers();
return;
}
if (msgRawText.Text.ToLower().IndexOf("#follow") == 0)
{
RawTextOutgoingMessage msgRawTextOut =
(RawTextOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.RAW_TEXT);
msgRawTextOut.Channel = PredefinedChannel.CHAT_LOCAL;
string[] tokens = msgRawText.Text.Split(' ');
if (tokens.Length != 2)
{
msgRawTextOut.Color = PredefinedColor.Red2;
msgRawTextOut.Text = "You are replied by silence...";
pc.PutMessageIntoMyQueue(msgRawTextOut);
return;
}
// Does character exist
PlayerCharacter pcTakenByHand = getPlayerByName(tokens[1]);
if (pcTakenByHand == null)
{
msgRawTextOut.Color = PredefinedColor.Blue1;
msgRawTextOut.Text = "The one you seek is not here...";
pc.PutMessageIntoMyQueue(msgRawTextOut);
return;
}
pc.FollowingFollow(pcTakenByHand);
return;
}
if ((msgRawText.Text.ToLower().IndexOf("#change_health") != -1) &&
serverConfiguration.EnableTestCommands)
{
string[] tokens = msgRawText.Text.Split(' ');
short changeVal = Convert.ToInt16(tokens[1]);
pc.EnergiesUpdateHealth(changeVal);
return;
}
if ((msgRawText.Text.ToLower().IndexOf("#resurrect") != -1) &&
serverConfiguration.EnableTestCommands)
{
pc.EnergiesResurrect();
return;
}
if ((msgRawText.Text.ToLower().IndexOf("#add_item") != -1) &&
serverConfiguration.EnableTestCommands)
{
//.........这里部分代码省略.........