ElectroServer 5 Client: C#
Electrotank.Electroserver5.Api.DeleteUserVariableRequest Class Reference

This request deletes a user variable. More...

Inheritance diagram for Electrotank.Electroserver5.Api.DeleteUserVariableRequest:
Electrotank.Electroserver5.Api.EsRequest Electrotank.Electroserver5.Api.EsMessage Electrotank.Electroserver5.Api.IThriftSerializable

Public Member Functions

 DeleteUserVariableRequest ()
 
 DeleteUserVariableRequest (TBase t)
 
override TBase ToThrift ()
 
override TBase NewThrift ()
 
override void FromThrift (TBase t_)
 

Properties

string Name [get, set]
 Name of the variable to delete. More...
 

Detailed Description

This request deletes a user variable.

A user variable can also be deleted by the server. A client can only create, modify, or delete a user variable that it owns (so not one for another user).

      This shows how to delete a user variable and capture the resulting update event.
private var _es:ElectroServer;
private function initialize():void {
        _es.engine.addEventListener(MessageType.UserVariableUpdateEvent.name, onUserVariableUpdateEvent);
        testDeleteUserVariable();
}
private function testDeleteUserVariable():void {
create the request and populate it with info
        var duvr:DeleteUserVariableRequest = new DeleteUserVariableRequest();
        duvr.name = "myDescription";
send to the server
        _es.engine.send(duvr);
}
private function onUserVariableUpdateEvent(e:UserVariableUpdateEvent):void {
        var userVar:UserVariable;
        switch (e.updateAction) {
                case UserVariableUpdateAction.VariableCreated:
the user variable is managed, so grab it
                        userVar = _es.managerHelper.userManager.me.userVariableByName(e.variable.name);
                        trace("User variable created. Name: " + userVar.name + ", value: " + userVar.value.toString());
                        break;
                case UserVariableUpdateAction.VariableDeleted:
the user variable has already been deleted, so to see its name inspect the event object
                        trace("User variable deleted. Name: " + e.variable.name);
                        break;
                case UserVariableUpdateAction.VariableUpdated:
the user variable is managed, so grab it
                        userVar = _es.managerHelper.userManager.me.userVariableByName(e.variable.name);
                        trace("User variable updated. Name: " + userVar.name + ", value: " + userVar.value.toString());
                        break;
        }
}
 

Constructor & Destructor Documentation

Electrotank.Electroserver5.Api.DeleteUserVariableRequest.DeleteUserVariableRequest ( )
Electrotank.Electroserver5.Api.DeleteUserVariableRequest.DeleteUserVariableRequest ( TBase  t)

Member Function Documentation

override void Electrotank.Electroserver5.Api.DeleteUserVariableRequest.FromThrift ( TBase  t_)
virtual
override TBase Electrotank.Electroserver5.Api.DeleteUserVariableRequest.NewThrift ( )
virtual
override TBase Electrotank.Electroserver5.Api.DeleteUserVariableRequest.ToThrift ( )
virtual

Property Documentation

string Electrotank.Electroserver5.Api.DeleteUserVariableRequest.Name
getset

Name of the variable to delete.