+ Reply to Thread
Results 1 to 4 of 4

Thread: For ES 3.6

  1. #1
    Electrotank jobem's Avatar
    Join Date
    Apr 2004
    Posts
    996
    Thanks
    0
    Thanked 24 Times in 17 Posts

    For ES 3.6

    Hi guys,

    I think that we are still on track to release ElectroServer 3.6 tonight. Unfortunately I have to leave town and have not finished all of the documentation updates. If Mike chooses to release 3.6 without my documentation updates then you'll need the code below for an example of how to use some of the latest features. If he wants to wait for my documenation updates then it might be another couple of days.

    Here is code for the various features. You can call the different functions to test it. Of course, this will only work with 3.6, so wait for its release.

    Code:
    ///////////////////////////////////////
    //			Buddy Code				 //
    ///////////////////////////////////////
    var es:ElectroServer;
    es.buddyLoggedIn = function(name) {
    	//This is fired when a buddy of yours logs in
    	trace(name +" just logged in")
    };
    es.buddyLoggedOut = function(name) {
    	//this is called when a buddy of yours logs out
    	trace(name+" just logged out");
    };
    function addBuddy(name) {
    	//This adds a new buddy. If he already exits then he is not added a 2nd time.
    	es.addBuddy(name);
    }
    function removeBuddy(name) {
    	//This removes an existing buddy. If he does not exist then no bid deal.
    	es.removeBuddy(name);
    }
    //////////////////////////////////////////////////////////
    //			To load users in a specific room			//
    //////////////////////////////////////////////////////////
    function loadUsersInASpecificRoom() {
    	//es.getUsersInRoom( zone_name, room_name)
    	es.getUsersInRoom("Chat Area", "Lobby");
    }
    es.usersInRoomLoaded = function(users) {
    	//This is fired when the users in a specific room have been loaded
    	//array is returned with user objects. They have only 1 property, username
    	for (var i = 0; i<users.length; ++i) {
    		var ob = users[i];
    		trace(ob.username);
    	}
    };
    //////////////////////////////////////////////////////////
    //			To load a user's location       			//
    //////////////////////////////////////////////////////////
    function loadAUsersLocation() {
    	//pass in the user's name
    	es.getUserLocation("jobe");
    }
    es.userLocationLoaded = function(username, zone, room) {
    	//This is fired when his loacation has been received
    	trace(username+", "+zone+", "+room);
    };
    //////////////////////////////////////////////////////////
    //			Get Rooms In Zone			       			//
    //////////////////////////////////////////////////////////
    function loadRoomsInAZone() {
    	//pass in a zone name
    	es.getRoomsInZone("Chat Area");
    }
    es.onRoomsInZoneLoaded = function(room_list, zone_name) {
    	//This is fired when the rooms have been loaded
    	//tracing zone name
    	trace(zone_name);
    	for (var i = 0; i<room_list.length; ++i) {
    		var ob = room_list[i];
    		//tracing room name
    		trace(ob.Name.value);
    	}
    };
    //////////////////////////////////////////////////////////
    //			Get All Zones				       			//
    //////////////////////////////////////////////////////////
    function loadAllZones() {
    	//Call the transaction
    	es.getAllZones();
    }
    es.allZonesLoaded = function(zones) {
    	//This is called when all zone names have been loaded
    	for (var i = 0; i<zones.length; ++i) {
    		//tracing zone names
    		trace(zones[i]);
    	}
    };
    ------
    Jobe Makar
    @jobemakar
    http://www.electrotank.com

    YouTube ElectroServer video tutorials
    http://www.youtube.com/user/ElectrotankInc

  2. #2
    Electrotank jobem's Avatar
    Join Date
    Apr 2004
    Posts
    996
    Thanks
    0
    Thanked 24 Times in 17 Posts
    The above code will work in ActionScript 1.0 as well as long as you remove the strict typing.
    ------
    Jobe Makar
    @jobemakar
    http://www.electrotank.com

    YouTube ElectroServer video tutorials
    http://www.youtube.com/user/ElectrotankInc

  3. #3
    Member
    Join Date
    Jul 2004
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can't wait to try it out. Look out MSN Messenger

    Dave

  4. #4
    Electrotank jobem's Avatar
    Join Date
    Apr 2004
    Posts
    996
    Thanks
    0
    Thanked 24 Times in 17 Posts
    It is released, see new thread.
    ------
    Jobe Makar
    @jobemakar
    http://www.electrotank.com

    YouTube ElectroServer video tutorials
    http://www.youtube.com/user/ElectrotankInc

+ 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