Example #1
0
 public void OnReceived()
 {
     if (NetworkServer.active)
     {
         // Request from client
         if (ZetDropifact.HandleClientRequest(this))
         {
             // Notify clients about success
             ZetDropReply dropReply = new ZetDropReply {
                 Body = Body, DropType = DropType, Index = Index
             };
             dropReply.Send(NetworkDestination.Clients);
         }
     }
 }
Example #2
0
        internal static void HandleServerReply(ZetDropReply dropReply)
        {
            if (!Enabled)
            {
                return;
            }

            CharacterBody body = dropReply.Body;

            if (!body || !LocalBody || body != LocalBody)
            {
                return;
            }

            Inventory inventory = body.inventory;

            if (!inventory)
            {
                return;
            }

            if (dropReply.DropType == 2)
            {
                EquipmentIndex equipIndex = (EquipmentIndex)dropReply.Index;

                CreateNotification(body, equipIndex);
            }
            else
            {
                bool scrap = dropReply.DropType == 1;

                ItemIndex itemIndex = (ItemIndex)dropReply.Index;

                CreateNotification(body, itemIndex, scrap);
            }
        }