public AGF_TileDataStruct( OperationID op, string id, int instance, Vector3 pos, Vector3 size, Quaternion rot, int opGroup, string customStr ){
		operation = op;
		tileID = id;
		instanceID = instance; 
		position = pos;
		rotation = rot;
		scale = size;
		customString = customStr;
		operationGroup = opGroup;
	}
 public static void Encode(XdrDataOutputStream stream, OperationID encodedOperationID)
 {
     stream.WriteInt((int)encodedOperationID.Discriminant.InnerValue);
     switch (encodedOperationID.Discriminant.InnerValue)
     {
     case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_OP_ID:
         OperationIDId.Encode(stream, encodedOperationID.Id);
         break;
     }
 }
        public static OperationID Decode(XdrDataInputStream stream)
        {
            OperationID  decodedOperationID = new OperationID();
            EnvelopeType discriminant       = EnvelopeType.Decode(stream);

            decodedOperationID.Discriminant = discriminant;
            switch (decodedOperationID.Discriminant.InnerValue)
            {
            case EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_OP_ID:
                decodedOperationID.Id = OperationIDId.Decode(stream);
                break;
            }
            return(decodedOperationID);
        }
	public AGF_TileDataStruct( string str ){
		string[] dataString = str.Split(new char[]{ '~'});
		
		int i = 0;
		
		int parsedInt = 0;
		int.TryParse( dataString[i], out parsedInt );
		operation = (OperationID)parsedInt;
		
		int.TryParse( dataString[++i], out parsedInt );
		operationGroup = parsedInt;
		
		tileID = dataString[++i];
		
		int.TryParse( dataString[++i], out parsedInt );
		instanceID = parsedInt;
		
		float parsedFloatx = 0.0f, parsedFloaty = 0.0f, parsedFloatz = 0.0f;
		
		float.TryParse( dataString[++i], out parsedFloatx );
		float.TryParse( dataString[++i], out parsedFloaty );
		float.TryParse( dataString[++i], out parsedFloatz );
		
		position = new Vector3( parsedFloatx, parsedFloaty, parsedFloatz );
		
		float parsedFloatw = 0.0f;
		
		float.TryParse( dataString[++i], out parsedFloatx );
		float.TryParse ( dataString[++i], out parsedFloaty );
		float.TryParse (dataString[++i], out parsedFloatz );
		float.TryParse (dataString[++i], out parsedFloatw );
		
		rotation = new Quaternion( parsedFloatx, parsedFloaty, parsedFloatz, parsedFloatw );
		
		float.TryParse( dataString[++i], out parsedFloatx );
		float.TryParse( dataString[++i], out parsedFloaty );
		float.TryParse( dataString[++i], out parsedFloatz );
		
		scale = new Vector3( parsedFloatx, parsedFloaty, parsedFloatz );
		
		customString = dataString[++i];
	}
Exemple #5
0
        public override object RemoveSync(object[] keys, ItemRemoveReason reason, bool notify, OperationContext operationContext)
        {
            ArrayList depenedentItemList = new ArrayList();

            try
            {
                Hashtable totalRemovedItems = new Hashtable();

                CacheEntry            entry = null;
                IDictionaryEnumerator ide   = null;


                for (int i = 0; i < keys.Length; i++)
                {
                    try
                    {
                        if (keys[i] != null)
                        {
                            entry = Internal.Remove(keys[i], reason, false, null, LockAccessType.IGNORE_LOCK, operationContext);
                        }


                        if (entry != null)
                        {
                            totalRemovedItems.Add(keys[i], entry);
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
                ide = totalRemovedItems.GetEnumerator();
                while (ide.MoveNext())
                {
                    try
                    {
                        entry = ide.Value as CacheEntry;
                        if (entry != null)
                        {
                            if (entry.Value is CallbackEntry)
                            {
                                EventId       eventId      = null;
                                OperationID   opId         = operationContext.OperatoinID;
                                CallbackEntry cbEtnry      = (CallbackEntry)entry.Value;
                                EventContext  eventContext = null;

                                if (cbEtnry != null && cbEtnry.ItemRemoveCallbackListener != null && cbEtnry.ItemRemoveCallbackListener.Count > 0)
                                {
                                    //generate event id
                                    if (!operationContext.Contains(OperationContextFieldName.EventContext)) //for atomic operations
                                    {
                                        eventId = EventId.CreateEventId(opId);
                                    }
                                    else //for bulk
                                    {
                                        eventId = ((EventContext)operationContext.GetValueByField(OperationContextFieldName.EventContext)).EventID;
                                    }

                                    eventId.EventType = EventType.ITEM_REMOVED_CALLBACK;
                                    eventContext      = new EventContext();
                                    eventContext.Add(EventContextFieldName.EventID, eventId);
                                    EventCacheEntry eventCacheEntry = CacheHelper.CreateCacheEventEntry(cbEtnry.ItemRemoveCallbackListener, entry);
                                    eventContext.Item = eventCacheEntry;
                                    eventContext.Add(EventContextFieldName.ItemRemoveCallbackList, cbEtnry.ItemRemoveCallbackListener.Clone());

                                    //Will always reaise the whole entry for old clients
                                    NotifyCustomRemoveCallback(ide.Key, entry, reason, true, operationContext, eventContext);
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(depenedentItemList);
        }