예제 #1
0
    public EmulatedSocket(ChainXController aController)
    {
        this.controller   = aController;
        this.socketBuffer = new byte[1024];
        this.socket       = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        IPAddress  ServerIP = IPAddress.Parse("127.0.0.1");
        IPEndPoint remoteEP = new IPEndPoint(ServerIP, 18080);

        try {
            this.socket.Connect(remoteEP);
        }
        catch (Exception e) {
            Debug.Log(e);
            //UnityEditor.EditorApplication.isPlaying = false;
            Application.Quit();
        }
        this.socket.BeginReceive(socketBuffer, 0, this.socketBuffer.Length, SocketFlags.None, this.OnReceiveData, this.socket);
    }
예제 #2
0
    /**
     * ChainVoxelのコンストラクタ
     */
    public ChainVoxel(ChainXController controller)
    {
        this.atoms          = new SortedDictionary <string, List <Voxel> >();
        this.negativeVoxels = new SortedDictionary <string, Voxel>();
        this.stt            = new StructureTable();
        this.controller     = controller;
        this.insertedPosIDs = new List <string>();
        this.deletedPosIDs  = new List <string>();
        this.movedPosIDs    = new Dictionary <string, string>();
        this.joinedGIDs     = new List <string>();
        this.leftGIDs       = new List <string>();

        this.selectedJoinedGIDs = new List <string>();
        this.selectedLeftGIDs   = new List <string>();
        if (!Directory.Exists(Const.SAVED_DIR))
        {
            Directory.CreateDirectory(Const.SAVED_DIR);
        }
    }
예제 #3
0
 public void SetController(ChainXController controller)
 {
     this.controller = controller;
 }
예제 #4
0
 public EmulatedWebSocket(ChainXController aController)
 {
     this.controller = aController;
     this.ws         = new WebSocket(new Uri("ws://" + Const.SERVER_ID + ":18080"));
 }