OccupyStationHandler.cs 536 B

123456789101112131415161718192021
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using Sfs2X;
  5. using Sfs2X.Entities.Data;
  6. public class OccupyStationHandler : LocalRequestHandler {
  7. override public void HandleClientRequest(GameRoomService service, ISFSObject data)
  8. {
  9. int crystalIndex = data.GetInt("c");
  10. int teamId = data.GetInt("t");
  11. ServiceStation station = service.AttempAddStation(crystalIndex, teamId);
  12. if(station != null)
  13. {
  14. data.PutInt("i", station.id);
  15. service.Send(Command.Station.ToString(), data);
  16. }
  17. }
  18. }