public bool SendRequest(OperationRequest op) { Thread.Sleep(40); var r = new Photon.SocketServer.OperationRequest { OperationCode = op.OperationCode, Parameters = op.Parameters }; return (this.SendOperationRequest(r) == SendResult.Ok); }
public bool SendRequest(OperationRequest op) { Thread.Sleep(40); var r = new Photon.SocketServer.OperationRequest { OperationCode = op.OperationCode, Parameters = op.Parameters }; return(this.SendOperationRequest(r) == SendResult.Ok); }
public OperationResponse LeaveGame(bool IsInActive = false) { var request = new OperationRequest { OperationCode = OperationCode.Leave, Parameters = new Dictionary <byte, object> { { ParameterCode.IsComingBack, IsInActive } } }; return(this.SendRequestAndWaitForResponse(request)); }
public bool SendRequest(OperationRequest op, bool encrypted) { if (this.Policy.UseSendDelayForOfflineTests) { Thread.Sleep(40); } var r = new Photon.SocketServer.OperationRequest { OperationCode = op.OperationCode, Parameters = op.Parameters }; return(this.SendOperationRequest(r, encrypted) == SendResult.Ok); }
public OperationResponse LeaveGame(bool IsInActive = false) { var request = new OperationRequest { OperationCode = OperationCode.Leave, Parameters = new Dictionary <byte, object> { { ParameterCode.IsInactive, IsInActive } } }; var response = this.SendRequestAndWaitForResponse(request); this.authenticationScheme.HandleAuthenticateResponse(this, response.Parameters); return(response); }
protected static void JoinRequestToDictionary(JoinGameRequest joinRequest, OperationRequest request) { if (joinRequest.GameId != null) { request.Parameters[ParameterCode.RoomName] = joinRequest.GameId; } if (joinRequest.LobbyName != null) { request.Parameters[ParameterCode.LobbyName] = joinRequest.LobbyName; } if (joinRequest.LobbyType != 0) { request.Parameters[ParameterCode.LobbyType] = joinRequest.LobbyType; } if (joinRequest.GameProperties != null) { request.Parameters[ParameterCode.GameProperties] = joinRequest.GameProperties; } if (joinRequest.ActorProperties != null) { request.Parameters[ParameterCode.PlayerProperties] = joinRequest.ActorProperties; request.Parameters[ParameterCode.Broadcast] = true; } if (joinRequest.BroadcastActorProperties) { request.Parameters[ParameterCode.Broadcast] = true; } if (joinRequest.DeleteCacheOnLeave) { request.Parameters[ParameterCode.CleanupCacheOnLeave] = joinRequest.DeleteCacheOnLeave; } if (joinRequest.CheckUserOnJoin) { request.Parameters[ParameterCode.CheckUserOnJoin] = joinRequest.CheckUserOnJoin; } if (joinRequest.PlayerTTL > 0 || joinRequest.PlayerTTL == -1) { request.Parameters[ParameterCode.PlayerTTL] = joinRequest.PlayerTTL; } if (joinRequest.EmptyRoomLiveTime != 0) { request.Parameters[ParameterCode.EmptyRoomTTL] = joinRequest.EmptyRoomLiveTime; } if (joinRequest.JoinMode != JoinMode.JoinOnly) { request.Parameters[ParameterCode.JoinMode] = joinRequest.JoinMode; } if (joinRequest.Plugins != null) { request.Parameters[ParameterCode.Plugins] = joinRequest.Plugins; } if (joinRequest.CacheSlice != null) { request.Parameters[ParameterCode.CacheSliceIndex] = joinRequest.CacheSlice; } if (joinRequest.ActorNr > 0) { request.Parameters[ParameterCode.ActorNr] = joinRequest.ActorNr; } if (joinRequest.AddUsers != null && joinRequest.AddUsers.Length > 0) { request.Parameters[ParameterCode.Add] = joinRequest.AddUsers; } if (joinRequest.SuppressRoomEvents) { request.Parameters[ParameterCode.SuppressRoomEvents] = true; } if (joinRequest.ForceRejoin) { request.Parameters[229] = true; } }