+ Reply to Thread
Page 1 of 7 1 2 3 ... LastLast
Results 1 to 10 of 61

Thread: i have some questions to ask,please help me!

  1. #1
    Member
    Join Date
    Oct 2010
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts

    i have some questions to ask,please help me!

    1.In ES5,i found esObject in the SearchCriteria is not useful (
    var fgr:FindGamesRequest = new FindGamesRequest();
    var findcriteria:SearchCriteria = new SearchCriteria();
    var esObject:EsObject = new EsObject();

    esObject.setString("defaultroom","121212");
    findcriteria.gameDetails = esObject;
    findcriteria.gameType = gameType;
    findcriteria.gameId = -1;

    fgr.searchCriteria = findcriteria;
    es.engine.send(fgr);

    var mes:QuickJoinGameRequest = new QuickJoinGameRequest();
    mes.createOnly = true;
    mes.zoneName = zonename;
    mes.gameType = gameType;
    var esObject:EsObject = new EsObject();

    esObject.setString("defaultroom","12312312322rosew j");

    esObject.setString("zonename",zonename);
    esObject.setString("gamename",userid + "的房间");
    mes.gameDetails = esObject;

    es.engine.send(mes);
    ) .
    i can only filter result in the findGamesResponse.


    2.how to use UpdateRoomVariableRequest .wo can only createRoomVariableRequest(
    var crvr:CreateRoomVariableRequest = new CreateRoomVariableRequest();
    crvr.roomId = defaultRoomid;
    crvr.zoneId = e.zoneId;
    crvr.name = e.gameId.toString();
    var esObject1:EsObject = new EsObject();
    esObject1.setInteger("roomid",e.roomId);
    crvr.value = esObject1;
    es.engine.send(crvr);


    )

    3.i think there are difference in zoneUpdateEvent between ES4 and ES5 .zoneUpdateEvent trigger before joinRoomEvent ,so there is a problem

    var jrq:JoinRoomRequest = new JoinRoomRequest();
    jrq.roomId = listZone.selectedItem.roomid;
    jrq.zoneId =listServer.selectedItem.id;
    jrq.receivingRoomAttributeUpdates = true;
    jrq.receivingRoomListUpdates = true;
    jrq.receivingRoomVariableUpdates = true;
    jrq.receivingUserListUpdates = true;
    jrq.receivingUserVariableUpdates = true;
    jrq.receivingVideoEvents = true;
    es.engine.send(jrq);

    ),but i found that in onzoneupdateEvent usercount can not refresh (
    public function OnZoneUpdateEvent(e:ZoneUpdateEvent):void {
    var defaultRoomList:Room = parentApplication.defaultRoom;
    var users:Array = defaultRoomList.users;
    Alert.show(users.length + "");

    }
    ) .we create a default room in the web administrator,User A join and User B join, Trigger zoneUpdateEvent in User A ,but the userCount of A is 1, e.roomCount is 2 ,userCount of B is 2?

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    Quote Originally Posted by rosewj View Post
    1.In ES5,i found esObject in the SearchCriteria is not useful (
    var fgr:FindGamesRequest = new FindGamesRequest();
    var findcriteria:SearchCriteria = new SearchCriteria();
    var esObject:EsObject = new EsObject();

    esObject.setString("defaultroom","121212");
    findcriteria.gameDetails = esObject;
    findcriteria.gameType = gameType;
    findcriteria.gameId = -1;

    fgr.searchCriteria = findcriteria;
    es.engine.send(fgr);

    var mes:QuickJoinGameRequest = new QuickJoinGameRequest();
    mes.createOnly = true;
    mes.zoneName = zonename;
    mes.gameType = gameType;
    var esObject:EsObject = new EsObject();

    esObject.setString("defaultroom","12312312322rosew j");

    esObject.setString("zonename",zonename);
    esObject.setString("gamename",userid + "的房间");
    mes.gameDetails = esObject;

    es.engine.send(mes);
    ) .
    i can only filter result in the findGamesResponse.
    For version ES5.0.0 you have to also set gameId to -1 to get SearchCriteria to work properly. This is fixed in ES5.0.1 which will be released soon.

    2.how to use UpdateRoomVariableRequest .wo can only createRoomVariableRequest(
    var crvr:CreateRoomVariableRequest = new CreateRoomVariableRequest();
    crvr.roomId = defaultRoomid;
    crvr.zoneId = e.zoneId;
    crvr.name = e.gameId.toString();
    var esObject1:EsObject = new EsObject();
    esObject1.setInteger("roomid",e.roomId);
    crvr.value = esObject1;
    es.engine.send(crvr);
    )
    When the room is created, you need to give users permission to change room variables. Do this by setting nonOperatorVariableUpdateAllowed to true.

    3.i think there are difference in zoneUpdateEvent between ES4 and ES5 .zoneUpdateEvent trigger before joinRoomEvent ,so there is a problem

    var jrq:JoinRoomRequest = new JoinRoomRequest();
    jrq.roomId = listZone.selectedItem.roomid;
    jrq.zoneId =listServer.selectedItem.id;
    jrq.receivingRoomAttributeUpdates = true;
    jrq.receivingRoomListUpdates = true;
    jrq.receivingRoomVariableUpdates = true;
    jrq.receivingUserListUpdates = true;
    jrq.receivingUserVariableUpdates = true;
    jrq.receivingVideoEvents = true;
    es.engine.send(jrq);

    ),but i found that in onzoneupdateEvent usercount can not refresh (
    public function OnZoneUpdateEvent(e:ZoneUpdateEvent):void {
    var defaultRoomList:Room = parentApplication.defaultRoom;
    var users:Array = defaultRoomList.users;
    Alert.show(users.length + "");

    }
    ) .we create a default room in the web administrator,User A join and User B join, Trigger zoneUpdateEvent in User A ,but the userCount of A is 1, e.roomCount is 2 ,userCount of B is 2?
    There is a bug in ES5.0.0 for JoinRoomRequest. All the defaults for the receiving properties are set to false instead of to true. You can set these manually and it will work correctly. This is fixed in ES5.0.1, due to be released very soon.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. The Following User Says Thank You to tcarr For This Useful Post:

    rosewj (10-16-2010)

  4. #3
    Member
    Join Date
    Oct 2010
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts
    think to tcarr , i understood question 1 and question2 ,but there are some puzzles in question3 ,when a user join a room ,trigger zoneUpdateEvent ,e.roomCount == (current userCount of Room) ,but es.managerHelper.zoneManager.zoneById(zoneId).room ById(roomid) == current userCount of Room - 1, what is the cause?

  5. #4
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    If you join a room using JoinRoomRequest, in ES5.0.0 you need to set the receivingUserListUpdates on the request to true. This is fixed in ES5.0.1 which will be released very soon. Joining rooms using a CreateRoomRequest works correctly.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  6. #5
    Member
    Join Date
    Oct 2010
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts
    and in question 2 ,i create room by quickJoinGameRequest(
    var mes:QuickJoinGameRequest = new QuickJoinGameRequest();
    mes.createOnly = true;
    mes.zoneName = zonename;

    mes.gameType = gameType;
    var esObject:EsObject = new EsObject();
    esObject.setString("defaultroom",defaultRoomName);
    esObject.setString("zonename",zonename);
    esObject.setString("gamename",userid + "的房间");
    mes.gameDetails = esObject;
    es.engine.removeEventListener(MessageType.FindGame sResponse.name, onFindGameResponse);

    es.engine.send(mes); )

    QuickJoinGameRequest has no nonOperatorUpdateAllowed attribute ,how to set ?
    and if a create room by web administrator ,can i set nonOperatorUpdateAllowed attribute ?

  7. #6
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    If a room is created using QuickJoinGameRequest, then the room configuration was set when the game was registered with GameManager, normally in a GMSInitializer class. For an example, see the LobbySystem example in ES5, or else the ES4 Game Manager article on the wiki. You will see several lines setting properties on the RoomConfiguration for the game. Just add similar lines for setNonOperatorUpdateAllowed or setNonOperatorVariableUpdateAllowed or whatever you need.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  8. #7
    Member
    Join Date
    Oct 2010
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts
    like ( gameRoomConfig.setReceivingRoomListUpdates(true);
    gameRoomConfig.setReceivingRoomVariableUpdates(tru e);
    gameRoomConfig.setReceivingUserListUpdates(true);
    gameRoomConfig.setReceivingUserVariableUpdates(tru e);
    gameRoomConfig.setReceivingVideoEvents(true) ?
    i can not find setNonOperatorUpdateAllowed or setNonOperatorVariableUpdateAllowed method . is the same as ReceivingRoomVariableUpdates?
    and in UpdateRoomVariableRequest,just do what i do in CreateRoomVariableRequest?
    (var crvr:UpdateRoomVariableRequest= new UpdateRoomVariableRequest();
    crvr.roomId = defaultRoomid;
    crvr.zoneId = e.zoneId;
    crvr.name = e.gameId.toString();
    var esObject1:EsObject = new EsObject();
    esObject1.setInteger("roomid",e.roomId);
    crvr.value = esObject1;
    es.engine.send(crvr)

  9. #8
    Member
    Join Date
    Oct 2010
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts
    and how about the room create by web administrator? how to set?

  10. #9
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    If you create a persistent room using the ES Admin, immediately below the Publish button is "Non-Operator Update Access" and "Non-Operator Variable Update Access". When a room is created by a user, that user has operator access and nobody else does. When a room is created by a plugin or the admin, nobody has operator access for that room. A plugin can always change a room's variables or whatever, so if a room has a plugin attached, a user could send a plugin request that could trigger the plugin making the change.

    Most games don't use room variables - they use plugins, which are far more flexible.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  11. #10
    Member
    Join Date
    Oct 2010
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts
    When a room is created by a plugin or the admin, nobody has operator access for that room. A plugin can always change a room's variables or whatever, so if a room has a plugin attached, a user could send a plugin request that could trigger the plugin making the change.

    what means? Do you have some samples?
    for example , a room create by admin , how to change the room variables? and if user a createRoom , user B,c join the room, User a leave ,that means nobody can change the room variables?and if i use quickjoinGameRequest to create a room,outside roomlist wants to listen to the changes of game state ,how to realize
    ?

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts