• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IRpcProtocol类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IRpcProtocol的典型用法代码示例。如果您正苦于以下问题:C# IRpcProtocol类的具体用法?C# IRpcProtocol怎么用?C# IRpcProtocol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IRpcProtocol类属于命名空间,在下文中一共展示了IRpcProtocol类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetPropertiesRequest

        /// <summary>
        /// Initializes a new instance of the <see cref="SetPropertiesRequest"/> class.
        /// </summary>
        /// <param name="protocol">
        /// The protocol.
        /// </param>
        /// <param name="operationRequest">
        /// Operation request containing the operation parameters.
        /// </param>
        public SetPropertiesRequest(IRpcProtocol protocol, OperationRequest operationRequest)
            : base(protocol, operationRequest)
        {
            if (!this.IsValid)
            {
                return;
            }

            // special handling for game and actor properties send by AS3/Flash (Amf3 protocol) or JSON clients
            if (protocol.ProtocolType == ProtocolType.Amf3V16 || protocol.ProtocolType == ProtocolType.Json)
            {
                if (this.UpdatingGameProperties)
                {
                    Utilities.ConvertAs3WellKnownPropertyKeys(this.Properties, null);
                    Utilities.ConvertAs3WellKnownPropertyKeys(this.ExpectedValues, null);
                }
                else
                {
                    Utilities.ConvertAs3WellKnownPropertyKeys(null, this.Properties);
                    Utilities.ConvertAs3WellKnownPropertyKeys(null, this.ExpectedValues);
                }
            }

            if (this.UpdatingGameProperties)
            {
                this.isValid = GameParameterReader.TryGetProperties(this.Properties, out this.newMaxPlayer,
                    out this.newIsOpen, out this.newIsVisible,
                    out this.newLobbyProperties, out this.MasterClientId,
                    out this.ExpectedUsers, out this.errorMessage);
            }
        }
开发者ID:JerryBian,项目名称:PhotonSample,代码行数:40,代码来源:SetPropertiesRequest.cs


示例2: OutgoingMasterServerPeer

 public OutgoingMasterServerPeer(IRpcProtocol protocol, IPhotonPeer nativePeer, GameApplication application)
     : base(protocol, nativePeer)
 {
     this.application = application;
     log.InfoFormat("connection to master at {0}:{1} established (id={2}), serverId={3}", this.RemoteIP, this.RemotePort, this.ConnectionId, GameApplication.ServerId);
     this.RequestFiber.Enqueue(this.Register);
 }
开发者ID:azanium,项目名称:PopBloop-GameServer,代码行数:7,代码来源:OutgoingMasterServerPeer.cs


示例3: StarCollectorPeer

    public StarCollectorPeer(IRpcProtocol protocol, IPhotonPeer unmanagedPeer)
        : base(protocol, unmanagedPeer)
    {
        #region Assigned ID
        lock (allocateIDLock)
        {
            playerID = lastAssignedID;
            lastAssignedID++;
        }

        //notify player of their ID
        EventData evt = new EventData()
        {
            Code = (byte)AckEventType.AssignPlayerID,
            Parameters = new Dictionary<byte, object>()
            {
                { (byte)Parameter.PlayerID, this.playerID }
            }
        };
        evt.Parameters[(byte)Parameter.PlayerID] = playerID;
        this.SendEvent(evt, new SendParameters());
        #endregion

        #region Join to world
        lock (StarCollectorGame.Instance)
        {
            StarCollectorGame.Instance.PeerJoined(this);
        }
        #endregion
    }
开发者ID:anhle128,项目名称:demo_photon_with_unity,代码行数:30,代码来源:StarCollectorPeer.cs


示例4: OutgoingMasterServerPeer

 public OutgoingMasterServerPeer(IRpcProtocol protocol, IPhotonPeer nativePeer, SubServer subServer)
     : base(protocol, nativePeer)
 {
     _application = subServer;
     Log.InfoFormat("connection to master at {0}:{1} established (id={2})", RemoteIP, RemotePort, ConnectionId);
     RequestFiber.Enqueue(Register);
 }
开发者ID:Antaresgames,项目名称:AegisBornPhoton,代码行数:7,代码来源:OutgoingMasterServerPeer.cs


示例5: REPeer

 public REPeer(IRpcProtocol rpcprotocol, IPhotonPeer nativePeer, REServer serverApplication)
     : base(rpcprotocol,nativePeer)
 {
     guid = Guid.NewGuid();
     server = serverApplication;
     server.wandererDictionary.Add(guid, this);
 }
开发者ID:DSobscure,项目名称:Resource-Emperor,代码行数:7,代码来源:REPeer.cs


示例6: ChatPeer

 public ChatPeer(IRpcProtocol protocol, IPhotonPeer unmanagedPeer)
     : base(protocol, unmanagedPeer)
 {
     lock (syncRoot)
     {
         BroadcastMessage += this.OnBroadcastMessage;
     }
 }
开发者ID:rkdrnf,项目名称:photonserver,代码行数:8,代码来源:ChatPeer.cs


示例7: LatencyPeer

 public LatencyPeer(IRpcProtocol protocol, IPhotonPeer nativePeer)
     : base(protocol, nativePeer)
 {
     if (log.IsDebugEnabled)
     {
         log.DebugFormat("Latency monitoring client connected, serverId={0}", GameApplication.ServerId);
     }
 }
开发者ID:azanium,项目名称:PopBloop-GameServer,代码行数:8,代码来源:LatencyPeer.cs


示例8: GetPropertiesRequest

 /// <summary>
 ///   Initializes a new instance of the <see cref = "GetPropertiesRequest" /> class.
 /// </summary>
 /// <param name = "protocol">
 ///   The protocol.
 /// </param>
 /// <param name = "operationRequest">
 ///   Operation request containing the operation parameters.
 /// </param>
 public GetPropertiesRequest(IRpcProtocol protocol, OperationRequest operationRequest)
     : base(protocol, operationRequest)
 {
     // special treatment for game and actor properties sent by AS3/Flash or JSON clients
     if (protocol.ProtocolType == ProtocolType.Amf3V16 || protocol.ProtocolType == ProtocolType.Json)
     {
         Utilities.ConvertAs3WellKnownPropertyKeys(this.GamePropertyKeys, this.ActorPropertyKeys);
     }
 }
开发者ID:JerryBian,项目名称:PhotonSample,代码行数:18,代码来源:GetPropertiesRequest.cs


示例9: ServerPeer

        /// <summary>
        /// 类型:方法
        /// 名称:ServerPeer
        /// 作者:taixihuase
        /// 作用:构造 ServerPeer 对象
        /// 编写日期:2015/7/12
        /// </summary>
        /// <param name="protocol"></param>
        /// <param name="unmanagedPeer"></param>
        /// <param name="server"></param>
        public ServerPeer(IRpcProtocol protocol, IPhotonPeer unmanagedPeer, ServerApplication server)
            : base(protocol, unmanagedPeer)
        {
            PeerGuid = Guid.NewGuid();
            Server = server;

            // 将当前 peer 加入连线列表
            Server.Users.AddConnectedPeer(PeerGuid, this);
        }
开发者ID:taixihuase,项目名称:SiegeOnline,代码行数:19,代码来源:ServerPeer.cs


示例10: MmoPeer

        public MmoPeer(IRpcProtocol rpcProtocol, IPhotonPeer nativePeer)
            : base(rpcProtocol, nativePeer)
        {
            // this is the operation handler before entering a world
            this.SetCurrentOperationHandler(this);

            #region PopBloop

            string configFile = Path.Combine(DbSettings.BinaryPath, "PopBloopServer.config");
            if (File.Exists(configFile))
            {
                using (StreamReader reader = new StreamReader(configFile))
                {
                    string line = reader.ReadLine();

                    if (line.Length > 1)
                    {
                        string[] config = line.Split('@');
                        string address = config[1];
                        string username = config[0];
                        if (address.Trim().Length > 1 && address.Contains(":"))
                        {
                            DbSettings.DBServerAddress = address;
                            log.Info("DBServerAddress: " + address);
                        }

                        if (username.Trim().Length > 1 && username.Contains(":"))
                        {
                            string[] credentials = username.Split(':');
                            if (credentials.Length == 2)
                            {
                                DbSettings.DBServerUsername = credentials[0];
                                DbSettings.DBServerPassword = credentials[1];
                                log.Info("DBUserName: " + credentials[0] + ", DBPassword: " + credentials[1]);
                            }
                            else
                            {
                                log.Error("No credentials found on PopBloopServer.config");
                            }
                        }
                        else
                        {
                            log.Info("Credentials Invalid: '" + username +"'");
                        }
                    }
                }
            }

            #endregion
        }
开发者ID:azanium,项目名称:PopBloop-Unity,代码行数:50,代码来源:MmoPeer.cs


示例11: JoinGameRequest

        /// <summary>
        /// Initializes a new instance of the <see cref="JoinGameRequest"/> class.
        /// </summary>
        /// <param name="protocol">
        /// The protocol.
        /// </param>
        /// <param name="operationRequest">
        /// Operation request containing the operation parameters.
        /// </param>
        public JoinGameRequest(IRpcProtocol protocol, OperationRequest operationRequest)
            : base(protocol, operationRequest)
        {
            if (!this.IsValid)
            {
                return;
            }

            // special treatment for game and actor properties sent by AS3/Flash or JSON clients
            var protocolId = protocol.ProtocolType;
            if (protocolId == ProtocolType.Amf3V16 || protocolId == ProtocolType.Json)
            {
                Utilities.ConvertAs3WellKnownPropertyKeys(this.GameProperties, this.ActorProperties);
            }

            this.SetupRequest();
        }
开发者ID:JerryBian,项目名称:PhotonSample,代码行数:26,代码来源:JoinGameRequest.cs


示例12: ActorPeer

        public ActorPeer(IRpcProtocol protocol, IPhotonPeer unmanagedPeer)
            : base(protocol, unmanagedPeer)
        {
            #region Assigned ID
            lock (allocateIDLock)
            {
                playerID = lastAssignedID;
                lastAssignedID++;
            }
            #endregion

            #region Join to Arena
            lock (ServerArena.Instance)
            {
                ServerArena.Instance.Enter(this);
            }
            #endregion
        }
开发者ID:anhle128,项目名称:demo_photon_with_unity,代码行数:18,代码来源:ActorPeer.cs


示例13: LatencyMonitor

        public LatencyMonitor(
            IRpcProtocol protocol, IPhotonPeer nativePeer, byte operationCode, int maxHistoryLength, int intervalMs, WorkloadController workloadController)
            : base(protocol, nativePeer)
        {
            this.operationCode = operationCode;
            this.intervalMs = intervalMs;
            this.workloadController = workloadController;
            this.latencyHistory = new ValueHistory(maxHistoryLength);
            this.averageLatencyMs = 0;
            this.lastLatencyMs = 0;

            log.InfoFormat("{1} connection for latency monitoring established (id={0}), serverId={2}", this.ConnectionId, this.NetworkProtocol, GameApplication.ServerId);

            if (!Stopwatch.IsHighResolution)
            {
                log.InfoFormat("No hires stopwatch!");
            }
            
            this.pingTimer = this.RequestFiber.ScheduleOnInterval(this.Ping, 0, this.intervalMs);
        }
开发者ID:ommziSolution,项目名称:PhotonServer,代码行数:20,代码来源:LatencyMonitor.cs


示例14: PhotonAckPeer

        public PhotonAckPeer(IRpcProtocol protocol, IPhotonPeer unmanagedPeer)
            : base(protocol, unmanagedPeer)
        {
            lock (lockPlayerID)
            {
                this.playerID = lastAssignedPlayerID;
                lastAssignedPlayerID++;
            }
            PhotonAckGame.Instance.PeerConnected(this);

            EventData evn = new EventData((byte)AckEventType.AssignPlayerID)
            {
                Parameters = new Dictionary<byte, object>()
                {
                    { (byte)Parameter.PlayerID, this.playerID }
                }
            };
            Console.WriteLine("PhotonAckPeer PlayerID: " + this.playerID);
            this.SendEvent(evn,new SendParameters());
            Console.WriteLine("PhotonAckPeer SendEvent");
        }
开发者ID:anhle128,项目名称:demo_photon_with_unity,代码行数:21,代码来源:PhotonAckPeer.cs


示例15: RemoveGameEvent

 public RemoveGameEvent(IRpcProtocol protocol, IEventData eventData)
     : base(protocol, eventData.Parameters)
 {
 }
开发者ID:ommziSolution,项目名称:PhotonServer,代码行数:4,代码来源:RemoveGameEvent.cs


示例16: CreateGameRequest

 public CreateGameRequest(IRpcProtocol protocol, OperationRequest operationRequest)
     : base(protocol, operationRequest)
 {
 }
开发者ID:ommziSolution,项目名称:PhotonServer,代码行数:4,代码来源:CreateGameRequest.cs


示例17: LitePeer

 /// <summary>
 ///   Initializes a new instance of the <see cref = "LitePeer" /> class.
 /// </summary>
 /// <param name = "rpcProtocol">
 ///   The rpc protocol.
 /// </param>
 /// <param name = "nativePeer">
 ///   The native peer.
 /// </param>
 public LitePeer(IRpcProtocol rpcProtocol, IPhotonPeer nativePeer)
     : base(rpcProtocol, nativePeer)
 {
 }
开发者ID:azanium,项目名称:PopBloop-GameServer,代码行数:13,代码来源:LitePeer.cs


示例18: TestHivePeer

 public TestHivePeer(IRpcProtocol rpcProtocol, IPhotonPeer nativePeer, string userId)
     : this(rpcProtocol, nativePeer)
 {
     this.UserId = userId;
 }
开发者ID:JerryBian,项目名称:PhotonSample,代码行数:5,代码来源:TestExtra.cs


示例19: AuthenticateUpdateEvent

 public AuthenticateUpdateEvent(IRpcProtocol protocol, IEventData eventData)
     : base(protocol, eventData.Parameters)
 {
 }
开发者ID:JerryBian,项目名称:PhotonSample,代码行数:4,代码来源:AuthenticateUpdateEvent.cs


示例20: MyPeer

 public MyPeer(IRpcProtocol rpcProtocol, IPhotonPeer peer)
     : base(rpcProtocol, peer)
 {
 }
开发者ID:ommziSolution,项目名称:PhotonServer,代码行数:4,代码来源:MyPeer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IRule类代码示例发布时间:2022-05-24
下一篇:
C# IRpcController类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap