// This function processes the action queue for all connected users when they have one.
 private void ActionWork()
 {
     foreach (User u in ServerGlobals.users)
     {
         // Process the action queue if it's not blank.
         while (u.ActionQueue.Count != 0)
         {
             Action act = u.ActionQueue.Dequeue();
             if (act == null)
             {
                 break;
             }
             if (act.binaryData == null)
             {
                 if (act.inst == null)
                 {
                     continue;
                 }
                 u.Socket.Send(ProtocolCodec.Encode(act.inst));
             }
             else
             {
                 u.Socket.Send(act.binaryData);
             }
         }
     }
 }