Beispiel #1
0
        //---------------------------------------------------------------------
        public PhotonServerPeerC(IRpcProtocol protocol, IPhotonPeer unmanaged_peer,
                                 EntityMgr entity_mgr, byte remote_node_type, RpcSessionListener listener)
            : base(protocol, unmanaged_peer)
        {
            mEntityMgr      = entity_mgr;
            mRpcSession     = new RpcSession(mEntityMgr, this);
            mListener       = listener;
            mRemoteNodeType = remote_node_type;

            Dictionary <byte, object> map_param = new Dictionary <byte, object>();

            map_param[0] = mEntityMgr.NodeType;
            map_param[1] = 0;// local_node_id
            OperationRequest operation_request = new OperationRequest((byte)_eRpcCmd.SyncPeerInfo, map_param);
            SendResult       r = SendOperationRequest(operation_request, new SendParameters {
                ChannelId = 0
            });

            if (r != SendResult.Ok)
            {
                EbLog.Error("PhotonServerPeerC SyncPeerInfo Result=" + r);
            }

            if (mListener != null)
            {
                mListener.onSessionConnect(mEntityMgr.NodeType, mRemoteNodeType, mRpcSession);
            }
        }
Beispiel #2
0
 //---------------------------------------------------------------------
 public PhotonServerPeerS(IRpcProtocol rpc_protocol, IPhotonPeer native_peer,
                          EntityMgr entity_mgr, RpcSessionListener listener)
     : base(rpc_protocol, native_peer)
 {
     mEntityMgr  = entity_mgr;
     mRpcSession = new RpcSession(mEntityMgr, this);
     mListener   = listener;
 }
Beispiel #3
0
        //---------------------------------------------------------------------
        public PhotonClientPeer(EntityMgr entity_mgr, byte remote_node_type, RpcSessionListener listener)
            : base(ConnectionProtocol.Tcp)
        {
            Listener        = this;
            mEntityMgr      = entity_mgr;
            mRpcSession     = new RpcSession(mEntityMgr, this);
            mListener       = listener;
            mRemoteNodeType = remote_node_type;

            DebugOut = DebugLevel.ERROR;
            //WarningSize = 500;
            //CommandBufferSize = 500;
            //TrafficStatsEnabled = true;
            //this.IsSimulationEnabled = true;
            //NetworkSimulationSet NetworkSimulationSettings
        }