123456789101112131415161718192021222324252627282930313233 |
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- using Sfs2X.Entities.Data;
- public class StationHandler : BAHandler
- {
- public StationHandler(BARoom room):base(room){}
- public override void HandleRequest (BAServer server, ISFSObject msg, int sender, int timeStamp)
- {
- ISFSObject data = msg.GetSFSObject (Message.LABEL_DATA);
- if(data.ContainsKey("i"))
- {
- server.RoomHandleResponse (msg);
- }
- else if(room.IsHost())
- {
- int crystalIndex = data.GetInt("c");
- int teamId = data.GetInt("t");
- BAStation station = room.AttempAddStation (crystalIndex, teamId);
- if(station != null)
- {
- data.PutInt ("i", station.id);
- server.Send (msg);
- }
- }
- }
- }
|