// Start is called before the first frame update
    void Start()
    {
        //inputField = GetComponent<InputField>();

        socket = GetComponent <SocketIOComponent>();

        socket.On("OnOwnerClientConnect", OnOwnerClientConnect);
        socket.On("OnClientConnect", OnClientConnect);
        socket.On("OnClientFetchPlayerList", OnClientFetchPlayerList);
        socket.On("OnClientDisconnect", OnClientDisconnect);

        socket.On("OnClientCreateRoomSuccess", OnClientCreateRoomSuccess);
        socket.On("OnClientCreateRoomFail", OnClientCreateRoomFail);
        socket.On("OnOwnerClientJoinRoomSuccess", OnOwnerClientJoinRoomSuccess);
        socket.On("OnClientJoinRoomSuccess", OnClientJoinRoomSuccess);
        socket.On("OnClientJoinRoomFail", OnClientJoinRoomFail);

        socket.On("OnClientLeaveRoom", OnClientLeaveRoom);

        socket.On("OnClientFetchRoomList", OnClientFetchRoomList);

        socket.On("OnClientUpdateMoveList", OnClientUpdateMoveList);
        socket.On("Fire", Fire);
        socket.On("Win", Win);
        socket.On("Lose", Lose);

        cachePlayerIDGroup = new PlayerIDGroup();
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        socket = GetComponent <SocketIOComponent>();

        socket.On("OnOwnerClientConnect", OnOwnerClientConnect);
        socket.On("OnClientConnect", OnClientConnect);
        socket.On("OnClientFetchPlayerList", OnClientFetchPlayerList);
        socket.On("OnClientDisconnect", OnClientDisconnect);

        socket.On("OnClientCreateRoomSuccess", OnClientCreateRoomSuccess);
        socket.On("OnClientCreateRoomFail", OnClientCreateRoomFail);
        socket.On("OnOwnerClientJoinRoomSuccess", OnOwnerClientJoinRoomSuccess);
        socket.On("OnClientJoinRoomSuccess", OnClientJoinRoomSuccess);
        socket.On("OnClientJoinRoomFail", OnClientJoinRoomFail);

        socket.On("OnClientLeaveRoom", OnClientLeaveRoom);

        socket.On("OnClientFetchRoomList", OnClientFetchRoomList);

        socket.On("OnClientUpdateMoveList", OnClientUpdateMoveList);

        socket.On("message.sent", OnListerMessage);

        cachePlayerIDGroup = new PlayerIDGroup();
    }
    // Start is called before the first frame update
    void Start()
    {
        socket = GetComponent <SocketIOComponent>();

        socket.On("OnOwnerClientConnect", OnOwnerClientConnect);
        socket.On("OnClientConnect", OnClientConnect);
        socket.On("OnClientFetchPlayerList", OnClientFetchPlayerList);
        socket.On("OnClientDisconnect", OnClientDisconnect);

        socket.On("OnClientCreateRoomSuccess", OnClientCreateRoomSuccess);
        socket.On("OnClientCreateRoomFail", OnClientCreateRoomFail);
        socket.On("OnOwnerClientJoinRoomSuccess", OnOwnerClientJoinRoomSuccess);
        socket.On("OnClientJoinRoomSuccess", OnClientJoinRoomSuccess);
        socket.On("OnClientJoinRoomFail", OnClientJoinRoomFail);

        socket.On("OnClientLeaveRoom", OnClientLeaveRoom);

        socket.On("OnClientFetchRoomList", OnClientFetchRoomList);

        socket.On("OnClientUpdateMoveList", OnClientUpdateMoveList);

        cachePlayerIDGroup = new PlayerIDGroup();
        nameRoom.gameObject.SetActive(false);
        CreateRoomBtn.gameObject.SetActive(true);
    }
Beispiel #4
0
    void Start()
    {
        socket = GetComponent <SocketIOComponent>();

        socket.On("OnOwnerClientConnect", OnOwnerClientConnect);
        socket.On("OnClientConnect", OnClientConnect);
        socket.On("OnClientFetchPlayerList", OnClientFetchPlayerList);
        socket.On("OnClientDisconnect", OnClientDisconnect);
        socket.On("GameIsFull", GameIsFull);

        socket.On("OnClientLeaveRoom", OnClientLeaveRoom);

        socket.On("OnClientFetchRoomList", OnClientFetchRoomList);

        socket.On("OnClientUpdateMoveList", OnClientUpdateMoveList);

        cachePlayerIDGroup = new PlayerIDGroup();
    }
    void OnClientFetchPlayerList(SocketIOEvent evt)
    {
        Debug.Log("OnClientFetchPlayerList : " + evt.data.ToString());

        playerIDGroup = JsonUtility.FromJson <PlayerIDGroup> (evt.data.ToString());
    }