protected sealed override PeerBase CreatePeer(InitRequest initRequest) { Logger.PeerReceived(ApplicationName, initRequest.ApplicationId, initRequest.ClientVersion?.ToString() ?? "", initRequest.ConnectionId, initRequest.RemoteIP, initRequest.RemotePort); if (IsServerToServerPeer(initRequest)) { // Server-Server Connection var s2sPeer = new PhotonWireInboundS2SPeer(initRequest); PeerManager.InboundServerConnections.Add(s2sPeer); OnPeerCreated(s2sPeer, initRequest, true); return(s2sPeer); } else { // Client-Server Connection var peer = new PhotonWireClientPeer(initRequest); // PhotonWire.HubInvoker use only Json, flag is embeded. if (initRequest.InitObject != null && initRequest.InitObject.ToString() == "UseJsonSerializer") { peer.Items["PhotonWireApplicationBase.ModifySerializer"] = PhotonSerializers.Json; } PeerManager.ClientConnections.Add(peer); OnPeerCreated(peer, initRequest, false); return(peer); } }
public Subscription(PhotonWireClientPeer peer, Action<int, string> action) { this.peer = peer; this.action = action; }
public Subscription(PhotonWireClientPeer peer, Action <int, string> action) { this.peer = peer; this.action = action; }
protected sealed override PeerBase CreatePeer(InitRequest initRequest) { Logger.PeerReceived(ApplicationName, initRequest.ApplicationId, initRequest.ClientVersion?.ToString() ?? "", initRequest.ConnectionId, initRequest.RemoteIP, initRequest.RemotePort); if (IsServerToServerPeer(initRequest)) { // Server-Server Connection var s2sPeer = new PhotonWireInboundS2SPeer(initRequest); PeerManager.InboundServerConnections.Add(s2sPeer); OnPeerCreated(s2sPeer, initRequest, true); return s2sPeer; } else { // Client-Server Connection var peer = new PhotonWireClientPeer(initRequest); // PhotonWire.HubInvoker use only Json, flag is embeded. if (initRequest.InitObject != null && initRequest.InitObject.ToString() == "UseJsonSerializer") { peer.Items["PhotonWireApplicationBase.ModifySerializer"] = PhotonSerializers.Json; } PeerManager.ClientConnections.Add(peer); OnPeerCreated(peer, initRequest, false); return peer; } }