本文整理汇总了C#中PlayerCharacter.UpdateHeartBeat方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerCharacter.UpdateHeartBeat方法的具体用法?C# PlayerCharacter.UpdateHeartBeat怎么用?C# PlayerCharacter.UpdateHeartBeat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCharacter
的用法示例。
在下文中一共展示了PlayerCharacter.UpdateHeartBeat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: processMessage
private void processMessage(PlayerCharacter pc, IncommingMessage msg)
{
pc.UpdateHeartBeat();
try
{
switch (msg.MessageType)
{
case (IncommingMessageType.SEND_OPENING_SCREEN):
handleSendOpeningScreen(pc, msg);
break;
case (IncommingMessageType.SEND_VERSION):
handleSendVersion(pc, msg);
break;
case (IncommingMessageType.LOG_IN):
handleLogIn(pc, msg);
break;
case (IncommingMessageType.HEART_BEAT):
pc.UpdateHeartBeat();
break;
case (IncommingMessageType.CREATE_CHAR):
handleCreateChar(pc, msg);
break;
case(IncommingMessageType.MOVE_TO):
handleMoveTo(pc, msg);
break;
case(IncommingMessageType.SEND_PM):
handlePM(pc, msg);
break;
case(IncommingMessageType.SIT_DOWN):
handleSitDown(pc, msg);
break;
case(IncommingMessageType.TURN_LEFT):
handleTurnLeft(pc, msg);
break;
case (IncommingMessageType.TURN_RIGHT):
handleTurnRight(pc, msg);
break;
case (IncommingMessageType.RAW_TEXT):
handleRawText(pc, msg);
break;
case(IncommingMessageType.USE_MAP_OBJECT):
handleUseMapObject(pc, msg);
break;
case(IncommingMessageType.LOOK_AT_INVENTORY_ITEM):
handleLookAtInventoryItem(pc, msg);
break;
case(IncommingMessageType.DROP_ITEM):
handleDropItem(pc, msg);
break;
case(IncommingMessageType.MOVE_INVENTORY_ITEM):
handleMoveInventoryItem(pc, msg);
break;
case(IncommingMessageType.HARVEST):
handleHarvest(pc, msg);
break;
case(IncommingMessageType.TOUCH_PLAYER):
handleTouchPlayer(pc, msg);
break;
case (IncommingMessageType.RESPOND_TO_NPC):
handleRespondToNPC(pc, msg);
break;
case(IncommingMessageType.ATTACK_SOMEONE):
handleAttackSomeone(pc, msg);
break;
default:
Logger.LogWarning(LogSource.World,
string.Format("Message {0} - no action taken", msg.ToString()), null);
break;
}
}
catch (Exception ex)
{
Logger.LogError(LogSource.World,
string.Format("Failed to process message {0}", msg.ToString()), ex);
}
}