当前位置: 首页>>代码示例>>C#>>正文


C# ActionGetter.GetActionId方法代码示例

本文整理汇总了C#中ActionGetter.GetActionId方法的典型用法代码示例。如果您正苦于以下问题:C# ActionGetter.GetActionId方法的具体用法?C# ActionGetter.GetActionId怎么用?C# ActionGetter.GetActionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActionGetter的用法示例。


在下文中一共展示了ActionGetter.GetActionId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResponseError

 public virtual void ResponseError(BaseGameResponse response, ActionGetter actionGetter, int errorCode, string errorInfo)
 {
     MessageHead head = new MessageHead(actionGetter.GetMsgId(), actionGetter.GetActionId(), errorCode, errorInfo);
     MessageStructure sb = new MessageStructure();
     sb.WriteBuffer(head);
     response.BinaryWrite(sb.PopBuffer());
 }
开发者ID:juneman,项目名称:Scut,代码行数:7,代码来源:ActionDispatcher.cs

示例2: BaseAction

 protected BaseAction(int aActionId, ActionGetter actionGetter)
     : base(aActionId, actionGetter)
 {
     _resultData = new ResultData()
     {
         MsgId = actionGetter.GetMsgId(),
         ActionId = actionGetter.GetActionId(),
         ErrorInfo = ""
     };
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:10,代码来源:BaseAction.cs

示例3: ResponseError

 public override void ResponseError(BaseGameResponse response, ActionGetter actionGetter, int errorCode, string errorInfo)
 {
     var result = new ResultData()
     {
         MsgId = actionGetter.GetMsgId(),
         ActionId = actionGetter.GetActionId(),
         ErrorCode = errorCode,
         ErrorInfo = errorInfo,
         Data = null
     };
     //实现出错处理下发
     response.BinaryWrite(Encoding.UTF8.GetBytes(MathUtils.ToJson(result)));
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:13,代码来源:WebSocketActionDispatcher.cs

示例4: OnRequested

        protected override void OnRequested(ActionGetter actionGetter, BaseGameResponse response)
        {
            try
            {
                var actionId = actionGetter.GetActionId();
                var uid = actionGetter.GetUserId();
                Console.WriteLine("Action{0} from {1}", actionId, uid);
                ActionFactory.Request(actionGetter, response, GetUser);

            }
            catch (Exception ex)
            {
                TraceLog.WriteError("{0}", ex);
            }
        }
开发者ID:JohnnyXq,项目名称:Scut,代码行数:15,代码来源:GameHostApp.cs

示例5: ResponseError

 public void ResponseError(BaseGameResponse response, ActionGetter actionGetter, int errorCode, string errorInfo)
 {
     //实现出错处理下发
     ResponsePack head = new ResponsePack()
     {
         MsgId = actionGetter.GetMsgId(),
         ActionId = actionGetter.GetActionId(),
         ErrorCode = errorCode,
         ErrorInfo = errorInfo,
         St = actionGetter.GetSt()
     };
     byte[] headBytes = ProtoBufUtils.Serialize(head);
     byte[] buffer = BufferUtils.AppendHeadBytes(headBytes);
     response.BinaryWrite(buffer);
 }
开发者ID:guccang,项目名称:scutlogic,代码行数:15,代码来源:CustomActionDispatcher.cs

示例6: OnCallRemote

 /// <summary>
 /// Call remote method
 /// </summary>
 /// <param name="routePath"></param>
 /// <param name="actionGetter"></param>
 /// <param name="response"></param>
 protected virtual void OnCallRemote(string routePath, ActionGetter actionGetter, MessageStructure response)
 {
     try
     {
         string[] mapList = routePath.Split('.');
         string funcName = "";
         string routeName = routePath;
         if (mapList.Length > 1)
         {
             funcName = mapList[mapList.Length - 1];
             routeName = string.Join("/", mapList, 0, mapList.Length - 1);
         }
         string routeFile = "";
         int actionId = actionGetter.GetActionId();
         MessageHead head = new MessageHead(actionId);
         if (!ScriptEngines.SettupInfo.DisablePython)
         {
             routeFile = string.Format("Remote.{0}", routeName);
             dynamic scope = ScriptEngines.ExecutePython(routeFile);
             if (scope != null)
             {
                 var funcHandle = scope.GetVariable<RemoteHandle>(funcName);
                 if (funcHandle != null)
                 {
                     funcHandle(actionGetter, head, response);
                     response.WriteBuffer(head);
                     return;
                 }
             }
         }
         string typeName = string.Format(GameEnvironment.Setting.RemoteTypeName, routeName);
         routeFile = string.Format("Remote.{0}", routeName);
         var args = new object[] { actionGetter, response };
         var instance = (object)ScriptEngines.Execute(routeFile, typeName, args);
         if (instance is RemoteStruct)
         {
             var target = instance as RemoteStruct;
             target.DoRemote();
         }
     }
     catch (Exception ex)
     {
         TraceLog.WriteError("OnCallRemote error:{0}", ex);
     }
 }
开发者ID:yunjoker,项目名称:Scut,代码行数:51,代码来源:GameBaseHost.cs

示例7: OnRequested

 protected override void OnRequested(ActionGetter actionGetter, BaseGameResponse response)
 {
     Console.WriteLine("Receice actionId:{0}", actionGetter.GetActionId());
     base.OnRequested(actionGetter, response);
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:5,代码来源:MainClass.cs

示例8: OnRequested

 protected override void OnRequested(ActionGetter actionGetter, BaseGameResponse response)
 {
     Console.WriteLine("Client {0} request action {1}", actionGetter.GetSessionId(), actionGetter.GetActionId());
 }
开发者ID:Menq,项目名称:ScutServer_MQ,代码行数:4,代码来源:MainClass.cs

示例9: OnCallRemote

 private void OnCallRemote(string route, ActionGetter httpGet, MessageStructure response)
 {
     try
     {
         string[] mapList = route.Split('.');
         string funcName = "";
         string routeName = "";
         if (mapList.Length > 1)
         {
             funcName = mapList[mapList.Length - 1];
             routeName = string.Join("/", mapList, 0, mapList.Length - 1);
         }
         string routeFile = "";
         string typeName = string.Format("Game.Script.Remote.{0}", routeName);
         int actionId = httpGet.GetActionId();
         MessageHead head = new MessageHead(actionId);
         if (!ScriptEngines.SettupInfo.DisablePython)
         {
             routeFile = string.Format("Remote.{0}", routeName);
             dynamic scope = ScriptEngines.ExecutePython(routeFile);
             if (scope != null)
             {
                 var funcHandle = scope.GetVariable<RemoteHandle>(funcName);
                 if (funcHandle != null)
                 {
                     funcHandle(httpGet, head, response);
                     response.WriteBuffer(head);
                     return;
                 }
             }
         }
         routeFile = string.Format("Remote.{0}", routeName);
         var instance = (object)ScriptEngines.Execute(routeFile, typeName);
         if (instance != null)
         {
             var result = ObjectAccessor.Create(instance, true)[funcName];
         }
     }
     catch (Exception ex)
     {
         TraceLog.WriteError("{0}", ex);
     }
 }
开发者ID:juneman,项目名称:Scut,代码行数:43,代码来源:GameSocketHost.cs

示例10: ResponseError

 /// <summary>
 /// 
 /// </summary>
 /// <param name="response"></param>
 /// <param name="actionGetter"></param>
 /// <param name="errorCode"></param>
 /// <param name="errorInfo"></param>
 public virtual void ResponseError(BaseGameResponse response, ActionGetter actionGetter, int errorCode, string errorInfo)
 {
     string st = actionGetter.GetSt();
     ProtocolVersion prtcl = actionGetter.GetPtcl();
     MessageHead head = new MessageHead(actionGetter.GetMsgId(), actionGetter.GetActionId(), st, errorCode, errorInfo);
     MessageStructure sb = new MessageStructure();
     if (prtcl >= ProtocolVersion.ExtendHead)
     {
         sb.PushIntoStack(0); //不输出扩展头属性
     }
     sb.WriteBuffer(head);
     response.BinaryWrite(sb.PopBuffer());
 }
开发者ID:LeeWangyeol,项目名称:Scut,代码行数:20,代码来源:ActionDispatcher.cs


注:本文中的ActionGetter.GetActionId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。