فهرست منبع

增加ICE接口:transferUnit,传送单位到某个坐标

大爷 1 سال پیش
والد
کامیت
543c915495

+ 14 - 1
XmdsServerCS/XmdsServerEdgeJS/Zone/XmdsManagerICE.cs

@@ -732,7 +732,20 @@ namespace XmdsServerEdgeJS.Zone
             }
         }
 
-		public override void playerChangeSkill_async(AMD_XmdsManager_playerChangeSkill cb__, string playerId, int oldSkillID, int newSkillID, string data, Current current__)
+        public override void transferUnit_async(AMD_XmdsManager_transferUnit cb__, string instanceId, int unitObjectId, float x, float y, Current current__)
+        {
+            try
+            {
+                ZoneServiceICE.InstanceICE.r2b_transferUnit(instanceId, (uint)unitObjectId, x, y);
+                cb__.ice_response();
+            }
+            catch (System.Exception e)
+            {
+                cb__.ice_exception(e);
+            }
+        }
+
+        public override void playerChangeSkill_async(AMD_XmdsManager_playerChangeSkill cb__, string playerId, int oldSkillID, int newSkillID, string data, Current current__)
 		{
 			try
 			{

+ 13 - 0
XmdsServerCS/XmdsServerEdgeJS/Zone/ZoneServiceICE.cs

@@ -899,6 +899,19 @@ namespace XmdsServerEdgeJS.Zone
             }
         }
 
+        public void r2b_transferUnit(string instanceId, uint unitId, float x, float y)
+        {
+            var node = getZoneNode(instanceId);
+            if (node != null)
+            {
+                node.Node.QueueTaskAsync((zone) =>
+                {
+                    var unit = zone.getUnit(unitId);
+                    unit.transport(x, y);
+                });
+            }
+        }
+
         public void r2b_request_removePointUnit(string instanceId, int unitObjectId)
         {
             var node = getZoneNode(instanceId);

+ 158 - 0
XmdsServerCS/XmdsServerEdgeJS/generated/XmdsManager.cs

@@ -2143,6 +2143,9 @@ namespace BattleIce
     [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.6.4")]
     public delegate void Callback_XmdsManager_removePointUnit();
 
+    [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.6.4")]
+    public delegate void Callback_XmdsManager_transferUnit();
+
     [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.6.4")]
     public delegate void Callback_XmdsManager_removeItem();
 
@@ -2878,6 +2881,20 @@ namespace BattleIce
 
         void end_removePointUnit(Ice.AsyncResult r__);
 
+        void transferUnit(string instanceId, int unitObjectId, float x, float y);
+
+        void transferUnit(string instanceId, int unitObjectId, float x, float y, _System.Collections.Generic.Dictionary<string, string> ctx__);
+
+        Ice.AsyncResult<BattleIce.Callback_XmdsManager_transferUnit> begin_transferUnit(string instanceId, int unitObjectId, float x, float y);
+
+        Ice.AsyncResult<BattleIce.Callback_XmdsManager_transferUnit> begin_transferUnit(string instanceId, int unitObjectId, float x, float y, _System.Collections.Generic.Dictionary<string, string> ctx__);
+
+        Ice.AsyncResult begin_transferUnit(string instanceId, int unitObjectId, float x, float y, Ice.AsyncCallback cb__, object cookie__);
+
+        Ice.AsyncResult begin_transferUnit(string instanceId, int unitObjectId, float x, float y, _System.Collections.Generic.Dictionary<string, string> ctx__, Ice.AsyncCallback cb__, object cookie__);
+
+        void end_transferUnit(Ice.AsyncResult r__);
+
         void removeItem(string instanceId, int itemId);
 
         void removeItem(string instanceId, int itemId, _System.Collections.Generic.Dictionary<string, string> ctx__);
@@ -3035,6 +3052,8 @@ namespace BattleIce
 
         void removePointUnit_async(BattleIce.AMD_XmdsManager_removePointUnit cb__, string instanceId, int unitObjectId, Ice.Current current__);
 
+        void transferUnit_async(BattleIce.AMD_XmdsManager_transferUnit cb__, string instanceId, int unitObjectId, float x, float y, Ice.Current current__);
+
         void removeItem_async(BattleIce.AMD_XmdsManager_removeItem cb__, string instanceId, int itemId, Ice.Current current__);
 
         void changePlayerState_async(BattleIce.AMD_XmdsManager_changePlayerState cb__, string instanceId, string playerId, byte status, int time, Ice.Current current__);
@@ -3141,6 +3160,8 @@ namespace BattleIce
 
         void removePointUnit_async(BattleIce.AMD_XmdsManager_removePointUnit cb__, string instanceId, int unitObjectId);
 
+        void transferUnit_async(BattleIce.AMD_XmdsManager_transferUnit cb__, string instanceId, int unitObjectId, float x, float y);
+
         void removeItem_async(BattleIce.AMD_XmdsManager_removeItem cb__, string instanceId, int itemId);
 
         void changePlayerState_async(BattleIce.AMD_XmdsManager_changePlayerState cb__, string instanceId, string playerId, byte status, int time);
@@ -5006,6 +5027,21 @@ namespace BattleIce
             return end_transferToPointPos(begin_transferToPointPos(instanceId, playerId, point, setDirection, direction, context__, explicitCtx__, true, null, null));
         }
 
+        public void transferUnit(string instanceId, int unitObjectId, float x, float y)
+        {
+            this.transferUnit(instanceId, unitObjectId, x, y, null, false);
+        }
+
+        public void transferUnit(string instanceId, int unitObjectId, float x, float y, _System.Collections.Generic.Dictionary<string, string> ctx__)
+        {
+            this.transferUnit(instanceId, unitObjectId, x, y, ctx__, true);
+        }
+
+        private void transferUnit(string instanceId, int unitObjectId, float x, float y, _System.Collections.Generic.Dictionary<string, string> context__, bool explicitCtx__)
+        {
+            end_transferUnit(begin_transferUnit(instanceId, unitObjectId, x, y, context__, explicitCtx__, true, null, null));
+        }
+
         public void triggrBattleFunction(string playerId, int eventId, int value1, int valu2, int valu3, int valu4, int value5, int value6)
         {
             this.triggrBattleFunction(playerId, eventId, value1, valu2, valu3, valu4, value5, value6, null, false);
@@ -8636,6 +8672,66 @@ namespace BattleIce
             }
         }
 
+        public Ice.AsyncResult<BattleIce.Callback_XmdsManager_transferUnit> begin_transferUnit(string instanceId, int unitObjectId, float x, float y)
+        {
+            return begin_transferUnit(instanceId, unitObjectId, x, y, null, false, false, null, null);
+        }
+
+        public Ice.AsyncResult<BattleIce.Callback_XmdsManager_transferUnit> begin_transferUnit(string instanceId, int unitObjectId, float x, float y, _System.Collections.Generic.Dictionary<string, string> ctx__)
+        {
+            return begin_transferUnit(instanceId, unitObjectId, x, y, ctx__, true, false, null, null);
+        }
+
+        public Ice.AsyncResult begin_transferUnit(string instanceId, int unitObjectId, float x, float y, Ice.AsyncCallback cb__, object cookie__)
+        {
+            return begin_transferUnit(instanceId, unitObjectId, x, y, null, false, false, cb__, cookie__);
+        }
+
+        public Ice.AsyncResult begin_transferUnit(string instanceId, int unitObjectId, float x, float y, _System.Collections.Generic.Dictionary<string, string> ctx__, Ice.AsyncCallback cb__, object cookie__)
+        {
+            return begin_transferUnit(instanceId, unitObjectId, x, y, ctx__, true, false, cb__, cookie__);
+        }
+
+        private const string __transferUnit_name = "transferUnit";
+
+        public void end_transferUnit(Ice.AsyncResult r__)
+        {
+            end__(r__, __transferUnit_name);
+        }
+
+        private Ice.AsyncResult<BattleIce.Callback_XmdsManager_transferUnit> begin_transferUnit(string instanceId, int unitObjectId, float x, float y, _System.Collections.Generic.Dictionary<string, string> ctx__, bool explicitContext__, bool synchronous__, Ice.AsyncCallback cb__, object cookie__)
+        {
+            IceInternal.OnewayOutgoingAsync<BattleIce.Callback_XmdsManager_transferUnit> result__ = getOnewayOutgoingAsync<BattleIce.Callback_XmdsManager_transferUnit>(__transferUnit_name, transferUnit_completed__, cookie__);
+            if(cb__ != null)
+            {
+                result__.whenCompletedWithAsyncCallback(cb__);
+            }
+            try
+            {
+                result__.prepare(__transferUnit_name, Ice.OperationMode.Normal, ctx__, explicitContext__, synchronous__);
+                IceInternal.BasicStream os__ = result__.startWriteParams(Ice.FormatType.DefaultFormat);
+                os__.writeString(instanceId);
+                os__.writeInt(unitObjectId);
+                os__.writeFloat(x);
+                os__.writeFloat(y);
+                result__.endWriteParams();
+                result__.invoke();
+            }
+            catch(Ice.Exception ex__)
+            {
+                result__.abort(ex__);
+            }
+            return result__;
+        }
+
+        private void transferUnit_completed__(BattleIce.Callback_XmdsManager_transferUnit cb__)
+        {
+            if(cb__ != null)
+            {
+                cb__();
+            }
+        }
+
         public Ice.AsyncResult<BattleIce.Callback_XmdsManager_triggrBattleFunction> begin_triggrBattleFunction(string playerId, int eventId, int value1, int valu2, int valu3, int valu4, int value5, int value6)
         {
             return begin_triggrBattleFunction(playerId, eventId, value1, valu2, valu3, valu4, value5, value6, null, false, false, null, null);
@@ -9181,6 +9277,13 @@ namespace BattleIce
 
         public abstract void removePointUnit_async(BattleIce.AMD_XmdsManager_removePointUnit cb__, string instanceId, int unitObjectId, Ice.Current current__);
 
+        public void transferUnit_async(BattleIce.AMD_XmdsManager_transferUnit cb__, string instanceId, int unitObjectId, float x, float y)
+        {
+            transferUnit_async(cb__, instanceId, unitObjectId, x, y, Ice.ObjectImpl.defaultCurrent);
+        }
+
+        public abstract void transferUnit_async(BattleIce.AMD_XmdsManager_transferUnit cb__, string instanceId, int unitObjectId, float x, float y, Ice.Current current__);
+
         public void removeItem_async(BattleIce.AMD_XmdsManager_removeItem cb__, string instanceId, int itemId)
         {
             removeItem_async(cb__, instanceId, itemId, Ice.ObjectImpl.defaultCurrent);
@@ -10315,6 +10418,32 @@ namespace BattleIce
             return Ice.DispatchStatus.DispatchAsync;
         }
 
+        [_System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
+        public static Ice.DispatchStatus transferUnit___(XmdsManager obj__, IceInternal.Incoming inS__, Ice.Current current__)
+        {
+            Ice.ObjectImpl.checkMode__(Ice.OperationMode.Normal, current__.mode);
+            IceInternal.BasicStream is__ = inS__.startReadParams();
+            string instanceId;
+            int unitObjectId;
+            float x;
+            float y;
+            instanceId = is__.readString();
+            unitObjectId = is__.readInt();
+            x = is__.readFloat();
+            y = is__.readFloat();
+            inS__.endReadParams();
+            AMD_XmdsManager_transferUnit cb__ = new _AMD_XmdsManager_transferUnit(inS__);
+            try
+            {
+                obj__.transferUnit_async(cb__, instanceId, unitObjectId, x, y, current__);
+            }
+            catch(_System.Exception ex__)
+            {
+                cb__.ice_exception(ex__);
+            }
+            return Ice.DispatchStatus.DispatchAsync;
+        }
+
         [_System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011")]
         public static Ice.DispatchStatus removeItem___(XmdsManager obj__, IceInternal.Incoming inS__, Ice.Current current__)
         {
@@ -10465,6 +10594,7 @@ namespace BattleIce
             "removeUnit",
             "revivePlayer",
             "transferToPointPos",
+            "transferUnit",
             "triggrBattleFunction"
         };
 
@@ -10695,6 +10825,10 @@ namespace BattleIce
                     return transferToPointPos___(this, inS__, current__);
                 }
                 case 54:
+                {
+                    return transferUnit___(this, inS__, current__);
+                }
+                case 55:
                 {
                     return triggrBattleFunction___(this, inS__, current__);
                 }
@@ -12044,6 +12178,30 @@ namespace BattleIce
         }
     }
 
+    [_System.Runtime.InteropServices.ComVisible(false)]
+    [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.6.4")]
+    public interface AMD_XmdsManager_transferUnit : Ice.AMDCallback
+    {
+        void ice_response();
+    }
+
+    [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.6.4")]
+    class _AMD_XmdsManager_transferUnit : IceInternal.IncomingAsync, AMD_XmdsManager_transferUnit
+    {
+        public _AMD_XmdsManager_transferUnit(IceInternal.Incoming inc) : base(inc)
+        {
+        }
+
+        public void ice_response()
+        {
+            if(validateResponse__(true))
+            {
+                writeEmptyParams__();
+                response__();
+            }
+        }
+    }
+
     [_System.Runtime.InteropServices.ComVisible(false)]
     [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.6.4")]
     public interface AMD_XmdsManager_removeItem : Ice.AMDCallback

+ 3 - 0
XmdsServerCS/XmdsServerEdgeJS/slice/XmdsManager.ice

@@ -209,6 +209,9 @@ module BattleIce
 		
 		//移除单位,战斗服创建的unit
 		void removePointUnit(string instanceId, int unitObjectId);
+
+		//传送Unit到指定位置
+		void transferUnit(string instanceId, int unitObjectId, float x, float y);
 		
 		//移除物品
 		void removeItem(string instanceId, int itemId);