Пример #1
0
 public void PlayerNpcInteraction(
     Player player, NpcInstance npc, EntityActionInvoker action, int parameterId)
 {
     if (action.Invoke(player, npc, parameterId))
     {
         foreach (var playerConnection in connectionProvider.GetAll())
         {
             playerConnection.Send(new PlayerNpcActionResponse
             {
                 PlayerId    = player.Id,
                 ActionId    = action.Id,
                 NpcServerId = npc.Id,
                 ParameterId = parameterId,
                 Status      = 1 // 0: fail, 1: success
             }, SendOption.Reliable);
         }
     }
 }
Пример #2
0
 public void PlayerObjectInteraction(
     Player player, GameObjectInstance obj, EntityActionInvoker action, int parameterId)
 {
     // use
     if (action.Invoke(player, obj, parameterId))
     {
         foreach (var playerConnection in connectionProvider.GetAll())
         {
             playerConnection.Send(new PlayerObjectActionResponse
             {
                 PlayerId       = player.Id,
                 ActionId       = action.Id,
                 ObjectServerId = obj.Id,
                 ParameterId    = parameterId,
                 Status         = 1 // 0: fail, 1: success
             }, SendOption.Reliable);
         }
     }
 }