/// <inheritdoc />
        protected override Task HandleSubMessage(IPeerMessageContext <PSOBBGamePacketPayloadClient> context, Sub60DropInventoryItemCommand command)
        {
            if (this.Logger.IsDebugEnabled)
            {
                Logger.Debug($"Encountered ItemDrop ClientId: {command.Identifier} Unknown1: {command.Unknown1} Unknown2: {command.Unknown2} ZoneId: {command.ZoneId} Position: {command.Position} ItemId: {command.ItemId}");
            }

            //Create a network item in the world for others to see
            INetworkItem item = WorldItemFactory.CreateEntity(command.ItemId, UnitScaler.Scale(command.Position), Quaternion.identity);

            return(Task.CompletedTask);
        }
Esempio n. 2
0
 private void ClientTcpOnMessage(INetworkItem obj)          //todo
 {
     if (obj.MethodName == "CreateGameObject")
     {
         var gameObjectItem = (GameObjectNetworkItem)obj;
         Scene.AddGameObject(gameObjectItem.Value);
     }
     else if (obj.MethodName == "SetPosition")
     {
         var positionItem = (PositionNetworkItem)obj;
         var gameObject   = Scene.GetGameObject(obj.Id);
         if (gameObject != null)
         {
             gameObject.Position = positionItem.Value;
         }
     }
 }
Esempio n. 3
0
 protected virtual void OnMessage(INetworkItem obj)
 {
     Message?.Invoke(obj);
 }